[osg-users] Problem blending multiple render passes

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Sat Sep 9 05:48:43 PDT 2017



Am 09.09.2017 um 14:42 schrieb antiro black:
> Hi,
> 
> 1. I enabled blending on the root node of the subtree containing the camera's, I'm assuming this is carried over to the camera nodes.
I'd rather enable it under the camera. Camera's have a default state set 
when created IIRC. So start by enabling blending in the camera itself.
> 
> 2. I am using deferred rendering, all lighting calculations are based on the information in the GBuffer. I tried to get it to work with one camera and a subtree containing the lightvolumes with uniforms set per volume. However I couldn't get that to work, hence I thought I'd first try the simpler approach without writing to the stencil buffer.
You don't need the stencil buffer for this in any case. The stencil 
approach simply helps to improve performance here. Running a new camera 
per light basically is a full-screen pass per light! ...
> 
> 3. I get that it is hard to help without example code and I am really grateful that you are trying anyways! The problem is that I have a pretty advanced rendering engine written in pure openGL. I decided that I wanted to port this to use OSG for improved cross platform compatibility (slowly starting to regret that decision...). This means that I'm working in a project of ~20k lines of code, which makes it really hard to isolate things into minimal examples. I never expected it to be this hard to restructure the project to work with OSG. The previous code is rather straight forward / low level: first run this shader, then run than shader etc. Now everything is attached to nodes in the scene graph and it is harder to for me wrap my head around the order things are happening in and how the openGL state is modified. If I ever get to the end of this, I might write a tutorial on porting pure openGL code to OSG. It will be the tutorial I wish I had right now :P

You can still, for the sake of understanding the problem, set up a small 
example doing two pass on one geometry.

In order to keep the mailing list pollution down you can also contact me 
on a private channel.

Cheers
Sebastian
> 
> Thank you!
> 
> Cheers,
> antiro
> 
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71683#71683
> 
> 
> 
> 
> 
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 


More information about the osg-users mailing list