- Home /
A different kind of billboarding for particles..
When the camera is stationary (but rotating) billboarded items rotate as the camera rotates. There are some times when I'd prefer that this does not happen.
Has anyone faced this problem? (no pun intended). How do you fix it?
What kind of behaviour are you trying to create? Are you trying to have it so you can see these items as planes (like, see that they have no depth)?
No, in fact I think this behavior looks more real. They still turn to face the camera, but based on camera position only.
Answer by femi · Jun 24, 2011 at 05:55 PM
you can implement alternative "billboarding" in a shader. one way to achieve it is to set the size of all particles to 0 and use texture coordinates to distinguish the 4 corners of the particles (which will be 0,0; 0,1; 1,0 and 1,1). you then calculate the direction and offset by which to move each corner from its original position.
I can provide a code example to start with. It doesn't change the rotation, but does alternative size attenuation, but it could be an starting point. Is there something like https://gist.github.com/ for unity? If there isn't I can contribute to "how can we improve answers" question :)
Anyway, I went and published a bit on gist. It doesn't do syntax highlighting for unity shaders, but these aren't very long files: https://gist.github.com/1046323
$$anonymous$$eep in $$anonymous$$d this isn't exactly what you ask for: it does the standard billboarding, but it does it "manually", so that'll be the place to tweak.
Answer by superpig · Jun 24, 2011 at 05:56 PM
I assume you've tried the different billboarding modes available in the Particle Renderer component?
I have. They all rotate the billboard when the camera rotates.
Answer by GODLIKE · Jun 25, 2011 at 12:10 AM
The standard billboard is aligned to the screen coordinates for what I know.
This said, what do you need this for?
Your answer
Follow this Question
Related Questions
Particle billboard is visible if camera is to close. 0 Answers
How to rotate a gameobject over time to face another 1 Answer
Rotate to face player, drunk issues 0 Answers
Particle system billboard size 1 Answer
Rotate Object to face 2 axis? 1 Answer