Rastar Posted September 21, 2013 Share Posted September 21, 2013 I am laying out a large array of mesh patches that will be heightmap displaced in the shader. It's working fine, except that when the camera moves a certain distance from the origin (about 1500 units or so) all meshes suddenly vanish. Moving a little back they appear again. This is independent of the camera's clipping planes. Bug or feature? If feature: Is there a way around this? There... ...and gone. The meshes in the back are gone as well. Quote Link to comment Share on other sites More sharing options...
shadmar Posted September 21, 2013 Share Posted September 21, 2013 Sounds to me that AABB for your meshes is not updated. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rastar Posted September 21, 2013 Author Share Posted September 21, 2013 I call patch->UpdateAABB(Entity::LocalAABB|Entity::GlobalAABB); after creating and/or scaling a patch. But a question: I am displacing many of those patches a fair amaount after creating them. Do I have to call UpdateAABB(Entity::GlobalAABB) after moving them? Quote Link to comment Share on other sites More sharing options...
shadmar Posted September 21, 2013 Share Posted September 21, 2013 http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/surface/surfaceupdate-r638 perhaps? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rastar Posted September 21, 2013 Author Share Posted September 21, 2013 Mmmh, no, both Update() nethods don't seem to help. Quote Link to comment Share on other sites More sharing options...
shadmar Posted September 21, 2013 Share Posted September 21, 2013 Try diable culling or set aabb manually. I dont know, usually it's aabb related. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Flexman Posted September 22, 2013 Share Posted September 22, 2013 As Shadmar says, culling is done using AABB. Workarounds might include manually adjusting the AABB values (then calling the aabb update) or adding a couple of vertices to the mesh to make it bigger. Could be a bug though, had many frustrating times with objects being culled. Are these patches parented at all? Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Rastar Posted September 22, 2013 Author Share Posted September 22, 2013 No, currently they are not parented. Do they have to be? I have a set of 7 different patch types (Models) which I instance, scale and position to create the "mesh puzzle" seen in the screenshot. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 22, 2013 Share Posted September 22, 2013 It's hard to say without seeing your code. If the local AABB is correct then the engine will automatically adjust the global and recursive AABBs whenever things move. There is also a cull distance command that will make them disappear a certain distance away. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rastar Posted September 22, 2013 Author Share Posted September 22, 2013 Well, here is my code (don't be too harsh, I'm in the process of relearning C++ ... ;-) I am trying an implementation of the geometric clipmap method as described here http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter02.html. It uses a series of concentric mesh rings with decreasing LOD, each ring assembled from several patches. As described, run forward using "W" to about 1500 units and all patches vanish. Thanks! Quote Link to comment Share on other sites More sharing options...
Josh Posted September 22, 2013 Share Posted September 22, 2013 Try adding this to the end of the RectangleTesselator::Computer function: surface->UpdateAABB(); I am curious why you are duplicating the built-in terrain. That paper is describing almost the same exact technique I implemented. (Their geometry approach is a little different, but it looks like the texturing technique is identical.) Not that I mind. Their geometry approach is nice in that it would only require a few passes, although it would be more restrictive with LOD distances and max view range. Something to think about at some later point... Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rastar Posted September 22, 2013 Author Share Posted September 22, 2013 Whoaa, I wasn't aware of that. I noticed your texturing approach looked similar to their structure for the heightmap base mesh. I am heading for a very large terrain, and their approach seemed very interesting to me, especially with the method for compressing the height data. If I can use that with the built-in terrain I would be more than happy! I've tried the various UpdateAABB() calls, but that doesn't seem to help. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 22, 2013 Share Posted September 22, 2013 Well you're missing the Surface::UpdateAABB call right now, and it is required: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/model/modelcone-r348 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rastar Posted September 22, 2013 Author Share Posted September 22, 2013 I understand, but adding that call to the RectangleTesselator doesn't change the behavior, at least on my end. Just wanted To say: I really appreciate your support, I know you have a load of stuff on your plate and more urgent business to do than fixing other people's code... 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.