Re: [osg-users] Skybox (horizon and ground) in GLSL?
In a first step I would actually be okay if the terrain was infinite and flat. It can be extended to do heightfield raycasting later. I have plenty of papers about this topic (e.g. cone step mapping and more advanced methods). The main difficulty for me is how to cast rays from the screen aligned quad into the scene, i.e. finding the right matrices and transformations to do this in the vertex and pixel shaders. Once I have a ray vector per pixel, intersection with a ground plane should be trivial. Christian. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Skybox (horizon and ground) in GLSL?
Hi, Not sure if this or its been superseded, you might want to take a look at OSGTDS. http://andesengineering.com/Projects/TDS/ This is for deforming terrain for the placement of objects. I have never used it, but it might be worth a shot? Cheers Martin. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Christian Buchner Sent: 17 January 2011 09:58 To: OpenSceneGraph Users Subject: [osg-users] Skybox (horizon and ground) in GLSL? Hi, I managed to load some 20 buildings from a freely available GIS database from the city of Winston-Salem and I render them with OSG. Buildings floating in space look kind of funny though and I need a ground, a horizon and some sky. I do not want to use a flat ground geometry or sky dome - that's too old-fashioned. I was thinking to use a screen aligned quad (coordinates forced to screen dimensions in a vertex shader) and a pixel shader to set ground and sky zbuffer values and to render the ground and sky color. The ground zbuffer values for sure depend on the camera height over ground. And how the horizon is oriented would depend on the camera orientation (view matrix) Unfortunately having little prior experience with GLSL, I think I might need some input from the community how to pull this off. Christian ___ 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
[osg-users] Skybox (horizon and ground) in GLSL?
Hi, I managed to load some 20 buildings from a freely available GIS database from the city of Winston-Salem and I render them with OSG. Buildings floating in space look kind of funny though and I need a ground, a horizon and some sky. I do not want to use a flat ground geometry or sky dome - that's too old-fashioned. I was thinking to use a screen aligned quad (coordinates forced to screen dimensions in a vertex shader) and a pixel shader to set ground and sky zbuffer values and to render the ground and sky color. The ground zbuffer values for sure depend on the camera height over ground. And how the horizon is oriented would depend on the camera orientation (view matrix) Unfortunately having little prior experience with GLSL, I think I might need some input from the community how to pull this off. Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Skybox (horizon and ground) in GLSL?
Hi, I think it would not be possible to pull of some kind of non-flat good looking ground + something like skybox via posteffect (thats what you suggest) with interactive camera. Use actual geometry or something like parallax mapping on plane for ground. You can get good shader based sky tho, but i'ts definitely simplier to get that with skybox-like geometry than with posteffect based approach. Cheers, Sergey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35692#35692 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org