Hello,
I progressed a bit with my Planet Generation Shader. I played a bit with vertex position modifications inside the shader to draw mountains and hills correctly on my planet. (Maybe i want to add realtime landing sometimes). The good thing is that the shader is real light, i have still > 1500fps on full hd.
The odd part is, that it seems that jme (of course) does not know about the vertex modifications and so (i assume) jme assumes that the object is still a plain sphere. This leads jme to cull the objects even if some mountain is still visible. In the video after 0:14sec
Is there a way to overcome this issue? Like update the model bound automatically?
Yeah, i know, video recorder sux, and i do not want to use the jme internal recorder because last time i used it all my jme apps where limited to 30fps
Sometimes (at certain angles) a slight movement of the camera makes the whole planet disapear even if it should be still visible.
Use fraps if you’re on windows (no idea if it’s offered in other flavors). With the demo you can record for 30 secs. At worse you can record a couple and merge them with a video editor.
Looks like the bounding box needs to be updated for the new geometry?
BTW are you going for a “cartoon” type effect or did you exaggerate it to demo the effect? Those mountains are extremely disproportionate. In a real planet the mountains vary the surface size by less than 1% so you won’t get the same problem.
@zarch said:
Looks like the bounding box needs to be updated for the new geometry?
BTW are you going for a "cartoon" type effect or did you exaggerate it to demo the effect? Those mountains are extremely disproportionate. In a real planet the mountains vary the surface size by less than 1% so you won't get the same problem.
True, but since the geometry is calculated in the .vert shader i have no access to it. I know generating the geometry in the shader is not the best way, but the same shader could be used for animated surface nearly without any performance costs.
Well, this all is for testing, but the shader could be used for asteroids too, and then the dimensions are good. On the video the radius is 1000wu with up to 500wu high montains.
Best thing I can suggest is either manually increasing the size of the bounding box to be however much larger than the geometry the shader can make it…or invert the action of the shader and have it carve valleys/etc in rather than extruding mountains out.
(This will also be a problem for collisions and stuff later though won’t it - if someone tries to fly into a valley it won’t let them as only the shader knows the valley exists - or alternatively people can fly through mountains as the mountains don’t exist).
@pspeed said:
You can also turn culling off for the object... though in my opinion it's probably better to just set a new larger bounding sphere.
Thank you, but i think leaving the bounding sphere as it is and carving valleys in it is more straightforward, as i see no downsides using this approach.