Hey, thanks for the info Frederic!
Actually, the atmospheric scattering effect you're pointing me at is what I've been trying to integrate into OSG for a few days now and the reason why I ask those questions :-) So I already know the content of the main.cpp and copyInscatter1 program quite well. But the problem now is that I'm still relying on OSG 2.9.6 (snif...) so I haven't seen this FACE_CONTROLLED_BY_GEOMETRY_SHADER parameter, and thus I ended up removing the geometry shaders from the atmosphere precomputation process and using multiple cameras... At least now I know there is a second path I could investigate if I really cannot go further with my current implementation... (but there is still some hope left ! :-) ) Also, if this "face" parameter if not available for Image attachment, I don't think this would fit into my design: from what I understand the pure openGL implementation from Eric Bruneton will actually precompute the textures in a given context and then use them directly in that context (so no image generated in the process). For my part, I would like to perform the precompute stage only once, save the resulting images, and use them in multiple GL contexts...[and attaching textures will not allow an easy access to the image data as far as I know...] Cheers! Manu. 2010/8/6 Frederic Bouvier <fredlis...@free.fr> > > ----- "Emmanuel Roche" a écrit : > > Just let me know if you need some code to have a better idea of what > > I'm doing (but almost everything is written in Lua). > > If you have OSG 2.9.8, there is a new possible value for the face parameter > : osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER > > To render to a 3d texture in one run, with only one camera, you can : > > * draw a quad with draw instancing, the number of instance being the number > of slice, > * in the vertex shader, copy the gl_InstanceID uniform to a varying > * in the geometry shader, copy the varying holding the instance id into > gl_Layer that control the slice > * do what you want in the fragment shader. > > If you get > http://www-evasion.imag.fr/Membres/Eric.Bruneton/PrecomputedAtmosphericScattering2.zip > > Look in Main.cpp and in copyInscatter1.glsl, there is a variant of this, > without instancing, drawing each quad separately. > > Regards, > -Fred > _______________________________________________ > 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