Skip to content

Commit

Permalink
Merge pull request #747 from HifiExperiments/particleBillboard
Browse files Browse the repository at this point in the history
particle billboarding is wrong in VR
  • Loading branch information
ksuprynowicz authored Dec 3, 2023
2 parents 649c45f + dfad009 commit 91abf8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/entities-renderer/src/textured_particle.slv
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ void main(void) {
<$transformModelToWorldDir(cam, obj, UP, modelUpWorld)$>
vec3 upWorld = mix(UP, normalize(modelUpWorld), float(particle.rotateWithEntity));
vec3 upEye = normalize(view3 * upWorld);
vec3 FORWARD = vec3(0, 0, -1);
vec3 particleRight = normalize(cross(FORWARD, upEye));
vec3 particleUp = cross(particleRight, FORWARD); // don't need to normalize
vec3 eyeToParticle = normalize(anchorPoint.xyz - vec3(0.0));
vec3 particleRight = cross(eyeToParticle, upEye);
vec3 particleUp = cross(particleRight, eyeToParticle); // don't need to normalize
// This ordering ensures that un-rotated particles render upright in the viewer.
vec3 UNIT_QUAD[NUM_VERTICES_PER_PARTICLE] = vec3[NUM_VERTICES_PER_PARTICLE](
normalize(-particleRight + particleUp),
Expand Down

0 comments on commit 91abf8f

Please sign in to comment.