Background:
The built-in billboard options seem to make the particles’ angle reflect that of the camera. My goal is to create my own version of “billboarding” which simply “looks” at the active camera at all times. (The quick explanation is I’m trying to make a look_at() function in particle shaders.)
Current Progress:
I’m testing with simple cube-mesh particles. Rotating about the Y-axis to follow the camera works perfectly.
To accomplish this, I’m passing the current camera coords. to a uniform in the shader then calculating the needed change in angle from there.
Issue(s):
The problem resides in trying to extend this functionality to the X-axis. The rotation is simply more incorrect the closer the camera approaches the X-axis.
This makes me believe the issue resides in the fact I’m not rotating about a “local X-axis” relative to the individual particle, as opposed to the global I’m using now. (However I believe global is the way to go for the Y-axis in this case.)
Is there a means of converting to a local axis in this way for particles?
I attempted this in a spatial shader, as well, and I ended up with the same problem, but it also introduced the problem of the cube warping, since every single vertex in the mesh was rotated individually. However I’m still very new to Spatial shader, so I’m sure someone out there knows a way around this (if using Spatial ends up as a better option for my scenerio.)
Thanks for taking the time to read.