Object get's culled even when it should be visible

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?

It’s damn hard to see, the video is so small. :confused:



But from what I’ve seen I honestly don’t see any culling…

1 Like

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 :frowning:



Sometimes (at certain angles) a slight movement of the camera makes the whole planet disapear even if it should be still visible.

I will try to make a better video

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.

1 Like

I haven’t really looked in detail but the 30 frame rate is hardcoded. Could it not be added as a constructor argument?



[java]public class VideoRecorderAppState extends AbstractAppState {



private int framerate = 30;

private VideoProcessor processor;

private File file;

private Application app;

[/java]



I think youtube runs at 30fps anyways, but its still nice to play at 60fps

@wezrule2 said:
I haven't really looked in detail but the 30 frame rate is hardcoded. Could it not be added as a constructor argument?

[java]public class VideoRecorderAppState extends AbstractAppState {

private int framerate = 30;
private VideoProcessor processor;
private File file;
private Application app;
[/java]


No, the VideoRecorder messed up all my projects, even the once where no VR was used. I do not blaim the VRappState, probably its my fault.

Here is the new video. Now even FULLSCREEN :evil:
http://www.youtube.com/watch?v=MfpM6nPp7O8

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.

1 Like

(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).

1 Like

True to both. I might reconsider letting the player land :wink: and use the valley approach.

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.

@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.

Dear spammer, why this thread twice in a day?

@zzuegg said: Dear spammer, why this thread twice in a day?

This thread has more spam in it than regular messages, you just can’t see them because they were marked:
http://hub.jmonkeyengine.org/forum/topic/object-gets-culled-even-when-it-should-be-visible/page/3/?view=all

For some reason, the forum has been inundated with spammers this past month. Lots of threads lately seem to have all of these spam messages in them.