Robert_h Posted July 10, 2016 Share Posted July 10, 2016 Hey guys, I'm looking for some help with my scene, specifically the grass that I am trying to create using the SPS. An example can be found here: https://roberthucks.com/3D/tests/test5/test5.html As you can see, when you move the camera (arrow keys) the grass does not face the camera despite these settings: grassSPS.billboard = true; grassSPS.isAlwaysVisible = true; grassSPS.computeParticleRotation = false; grassSPS.computeParticleColor = false; grassSPS.computeParticleTexture = false; I have an idea as to why, it being that the way in which this project it set up the world is generated before the player so when the grass gets made there isn't a camera for it to face. Atleast thats my working theory. So my question is, is there a way for me to change which camera the particles billboard to or is there any other methods I can use to produce the effect I am after. ps. I would make a playground but I don't know how to import textures. =) Quote Link to comment Share on other sites More sharing options...
adam Posted July 10, 2016 Share Posted July 10, 2016 Why not use sprites for this? http://www.babylonjs-playground.com/#12KWTV#5 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2016 Share Posted July 10, 2016 The SPS is low-level system based on the mesh object. Therefore its internal billboard mode (billboard for its particles, not the whole mesh) is not managed by the engine and you have to call setParticles() in the render loop so each particle is billboarded (rotated) :http://doc.babylonjs.com/overviews/Solid_Particle_System#sps-creation ex : http://www.babylonjs-playground.com/#WCDZS#7 [EDIT] Note : if you disable the particle rotation computation, the billboarding won't run... billboarding is rotating a particle. As Adam said, if you are using only planar particles and not solid ones, the sprites could be a better option Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.