Hi, I have switched my rendering stuff to deferred rendering, and I noticed some problems around the edges of the hills in the terrain (see attached picture) I write 3 buffers: -color -normal -position (fragment position in world coordinates)
I tried finding a problem in the buffers around the edges, but there are none there, they are also aligned with each other. Then I noticed the thing causing the edge problem is the 3d fog. to make the 3d fog I sample multiple times from a 3d texture. The places where I sample from the 3d-texture are only dependent on the camera position (uniform variable) and the fragment positions (from the buffer), so it samples from a line going from camera to fragment positions in a 3d texture. Works really well, and in the non- deferred rendering that i started with I had no edge problems. I inspected the position buffer well, I even exported it to an excel sheet, but there is no edge problem inside that buffer. Also when I replace the 3d fog with linear fog (also based on the exact same camera position and fragment position), there are no problems on the edges anymore. So I can only conclude that when I start sampling from that 3d texture, that somehow influences the final results. It seem that is causes it to do multi-samples on the final quad too, instead of just doing it pixel by pixel. But that is just my idea for now, I'm in no way an expert on the subject. Does anyone understand what is going on, or has ANY tips on how I could try to fix this? I could also post my code on how I create and use the buffers and the 3d fog texture, or the shaders, if that helps. Thanks for any help! ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54455#54455 Attachments: http://forum.openscenegraph.org//files/hilledges_982.png _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org