Your example with the forest is just too awesome ! What is also cool with dynamic impostors is you can rerender with new lights, so I assume it makes a lot of sense in your planet simulation. Really hope to test your work live soon, and to see this volume hull impostor in action
What do you do about shadows, can your impostors cast shadows ?
About the visual popping I understand that it’s possible to mitigate the problem by tweening the alpha channel between two textures, I’m gonna try this if I can fix my performance issue.
Yes that’s a lot of draw calls, I will try to use instanced plane meshes instead of sprites ( can we instance sprites ? ). Points would be easier but I read here that it may cause some issues.
What is bugging me though is that the impostors are actually reducing the render load by a lot in this demo compared to the original scene ( ~350 draw calls instead of ~1200, and ~65000 triangles instead of ~900000 ). But the original scene is still rendering much faster on my machine…
I ran a performance test and I began to see where I screwed up ( the redraw
function is an individual impostor texture update ) :
In order to isolate the real mesh for rendering on the impostor render target, I traverse the whole scene and enable layer 31 on the object to impersonate and all the lights, and disable layer 31 on everything else, then I render the scene with a camera set on layer 31. This is the way I found the most straightforward to render the object with the right lights and transformations ( and lights transformations ), but I realize I’ve been naive…
If instead of rendering the whole modified scene, I only add a random light to the forged object and render it directly ( renderer.render( forgedObject, camera )
), I get a solid 60FPS with a lot of room to spare :
And the profiling shows that calls to updateMatrixWorld
in WebGLRenderer.render
became trivial. Now the problem is, it looks completely wrong.
I will have to figure this out, but at least I have hope again that this technique is worth it. Thank you guys !
@Fyrestar How do you isolate the object to impersonate for render in your own implementation, and how do you ensure that it gets the right lights ?