Hello Michael,

Michael Babcock wrote:
> I need to save the alpha channel to images rendered using OpenSG (1.8 
> recent cvs). I'm using a FileGrabForeground and it works fine with a 
> normal Viewport.
> 
> However I've found that it doesn't work with a ShadowViewport because 
> the alpha channel is overwritten with 1. ShadowViewport::setAlpha(false) 
> doesn't work.
> 
> Looking at the code, the simplest solution is to use 
> glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE) around the 
> drawCombineMap() and createShadowFactorMap() functions. However this 
> doesn't work if USE_FBO_FOR_COLOR_AND_FACTOR_MAP is defined, and for me 
> using FBOs is a win for performance.
> 
> So instead I changed the color map texture from GL_RGB to GL_RGBA and 
> modified the shadow_combine shader to pass through the alpha instead of 
> overwriting it.
> 
> I tested with the 5 different tree renderers with and without 
> USE_FBO_FOR_COLOR_AND_FACTOR_MAP and it works. I've attached a patch in 
> case others run across this issue. Apply in 
> Source/Experimental/ShadowViewport.

thank you for sending the patch. I'm somewhat tempted to just apply it 
and make this the default, but since it may increase graphics memory 
consumption [1] and so far you are the first to need the alpha passed 
through, I'm a little uncertain.
Dirk or anybody else here have an opinion on this? Thanks.

        Cheers,
                Carsten

[1] not sure if it really needs more memory on the graphics card since 
i'd almost expect the card to use padding to make sure the RGB triples 
are 4 byte aligned.



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to