Re: [osg-users] Strategies for reducing visual terrain-tile-popping with osgTerrain
Hi Robert, Thanks for the quick reply. I'm not sure whether the trade-off would be beneficial, but what if VPB was modified to generate normal maps as the terrain database was generated. This would save run-time normal map computations, but increase the size of the database. And since the normal map requires floating point resolution, I guess one would have to add a normal map field instead of using an image layer for this... Your thoughts? Best regards, John On 04/24/2012 03:08 PM, Robert Osfield wrote: Hi John, Avoiding popping is a challenge for sure. However even with the popping it's a rather nice model BTW :-) Given the lighting changes looked to be the most obvious perhaps directly addressing this by using a normal map texture as well as a colour texture would be appropriate. This would require a custom fragment shader and the creation of the normal map texture when building the database. Another alternative might be to have a custom TerrainTechnique read a high res height field - the same res as the texture map so 256x256 rather than normal default 64x64, then have the TerrainTechnique down sample the data for geometry rendering but also create a normal map automatically from the height field. Another approach would be to read the height field in vertex shader and in the fragment shader use the same height field to compute normals for lighting purpose. One complication in doing the normal computation is that it's a whole earth model so one would need to compute the normals in local coords that fit the overal curvature of the geocentric model. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strategies for reducing visual terrain-tile-popping with osgTerrain
Hi Glenn, Yes, it definitely sounds like a fairly large implementation task, but a geomorph (as Shayne put it), seems like the most generic fix to the popping issue. Best regards, John On 04/24/2012 12:54 PM, Glenn Waldron wrote: John, osgEarth's LOD Blending function does this for imagery - it references two LOD textures per tile (level n and level n+1) and blends then in the shader based on camera distance. We are (once again) considering implementing something similar for heightfield data in the next version of osgEarth. The idea is that you use the vertex shader to alter a heightfield patch on the GPU using vertex texture lookups. Supply n and n+1 heightfields and morph between them using the shader. But..it's complicated. If you go down the route of creating and/or tessellating terrain on the GPU, you need to consider things like intersection testing and shadowing and other things that (currently) rely on having triangles on the CPU. Glenn Waldron / @glennwaldron On Tue, Apr 24, 2012 at 7:47 AM, John Vidar Larring larr...@weatherone.tv mailto:larr...@weatherone.tv wrote: Hi, Thankfully, there's a lot of people on this list using osgTerrain, which means that hopefully others have pondered about the same issue that we are currently having when rendering high resolution terrain: the visual popping of terrain tiles in the terrain. In the sample videos below, we have tweaked the lighting to make the visual effect more obvious: ftp://ftp.weatherone.tv/projects/popping/popping_dive_sample.mp4 ftp://ftp.weatherone.tv/projects/popping/popping_flight_sample.mp4 Since we normally work with large high resolution terrains, we would like to keep the geodetic-quadtree structure of the pagedLOD database, but we're a bit unsure about how to address the popping issue within this framework. One approach could possibly be to implement some kind of heightfield interpolation between LOD-n and its four children in LOD-n+1 based on camera distance*LOS_scale over a fraction of max/min view distance for the two LOD levels...(?) . What approach / strategy would you suggest? Anyone who have have tried and succeeded/failed and willing to share their experience? A similar discussion for terrain rendering in osgEarth is discussed here: http://forum.osgearth.org/height-mapping-on-GPU-td7432851.html Best regards, John -- This email was Anti Virus checked by Astaro Security Gateway. http://www.astaro.com ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strategies for reducing visual terrain-tile-popping with osgTerrain
John, osgEarth's LOD Blending function does this for imagery - it references two LOD textures per tile (level n and level n+1) and blends then in the shader based on camera distance. We are (once again) considering implementing something similar for heightfield data in the next version of osgEarth. The idea is that you use the vertex shader to alter a heightfield patch on the GPU using vertex texture lookups. Supply n and n+1 heightfields and morph between them using the shader. But..it's complicated. If you go down the route of creating and/or tessellating terrain on the GPU, you need to consider things like intersection testing and shadowing and other things that (currently) rely on having triangles on the CPU. Glenn Waldron / @glennwaldron On Tue, Apr 24, 2012 at 7:47 AM, John Vidar Larring larr...@weatherone.tvwrote: Hi, Thankfully, there's a lot of people on this list using osgTerrain, which means that hopefully others have pondered about the same issue that we are currently having when rendering high resolution terrain: the visual popping of terrain tiles in the terrain. In the sample videos below, we have tweaked the lighting to make the visual effect more obvious: ftp://ftp.weatherone.tv/**projects/popping/popping_dive_**sample.mp4ftp://ftp.weatherone.tv/projects/popping/popping_dive_sample.mp4 ftp://ftp.weatherone.tv/**projects/popping/popping_**flight_sample.mp4ftp://ftp.weatherone.tv/projects/popping/popping_flight_sample.mp4 Since we normally work with large high resolution terrains, we would like to keep the geodetic-quadtree structure of the pagedLOD database, but we're a bit unsure about how to address the popping issue within this framework. One approach could possibly be to implement some kind of heightfield interpolation between LOD-n and its four children in LOD-n+1 based on camera distance*LOS_scale over a fraction of max/min view distance for the two LOD levels...(?) . What approach / strategy would you suggest? Anyone who have have tried and succeeded/failed and willing to share their experience? A similar discussion for terrain rendering in osgEarth is discussed here: http://forum.osgearth.org/**height-mapping-on-GPU-**td7432851.htmlhttp://forum.osgearth.org/height-mapping-on-GPU-td7432851.html Best regards, John -- This email was Anti Virus checked by Astaro Security Gateway. http://www.astaro.com __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strategies for reducing visual terrain-tile-popping with osgTerrain
Hi John, Avoiding popping is a challenge for sure. However even with the popping it's a rather nice model BTW :-) Given the lighting changes looked to be the most obvious perhaps directly addressing this by using a normal map texture as well as a colour texture would be appropriate. This would require a custom fragment shader and the creation of the normal map texture when building the database. Another alternative might be to have a custom TerrainTechnique read a high res height field - the same res as the texture map so 256x256 rather than normal default 64x64, then have the TerrainTechnique down sample the data for geometry rendering but also create a normal map automatically from the height field. Another approach would be to read the height field in vertex shader and in the fragment shader use the same height field to compute normals for lighting purpose. One complication in doing the normal computation is that it's a whole earth model so one would need to compute the normals in local coords that fit the overal curvature of the geocentric model. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strategies for reducing visual terrain-tile-popping with osgTerrain
Hi, The popping is the effect of an abrupt change from one LOD to another. The typical solution is to geomorph the terrain over several frames with the LOD change. It smooths out the transition so that LOD changes are subtle. High end visual IGs have been doing geomorphing a long time with terrain skins. With the advent of shader technology, this technique is making its way into the standard desktop PCs. As others have pointed out, its complicated but it can be done. Here's an interesting article on it that may shed light on the problem and how to address it. http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/terrain-geomorphing-in-the-vertex-shader-r1936 -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47273#47273 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strategies for reducing visual terrain-tile-popping with osgTerrain
Just throwing out ideas -- what about using a fade LOD technique? I know it temporarily incurs a higher draw overhead of drawing a tile at two different LODs at the same time, but perhaps it would be worthwhile in your case. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org