Re: [osg-users] Advice on interacting with osgShadow

2008-10-24 Thread Wojciech Lewandowski
] Advice on interacting with osgShadow Wojtek, Just grab them from StandardShadowMap via getShadowVertexShader() & getShadowFragmentShader(). Ah. I missed that. Perils of browsing source via the website, I guess... Thanks, D

Re: [osg-users] Advice on interacting with osgShadow

2008-10-24 Thread David Spilling
Wojtek, Just grab them from StandardShadowMap via getShadowVertexShader() > & getShadowFragmentShader(). > Ah. I missed that. Perils of browsing source via the website, I guess... Thanks, David ___ osg-users mailing list osg-users@lists.openscenegrap

Re: [osg-users] Advice on interacting with osgShadow

2008-10-24 Thread Wojciech Lewandowski
David, > I saw this. Maybe I'm being daft, but presumably this only helps when you > have the SAME shader for the entire shadowed scene? I have a situation where > > the shadowed objects have a variety of different shaders. If I'm missing > something obvious, my apologies. Thats true. But oppo

Re: [osg-users] Advice on interacting with osgShadow

2008-10-24 Thread David Spilling
Dear Wojciech, J-S, > All classes belonging to ViewDependentShadow group derive shaders from > StandardShadowMap. If you look at these shaders you will notice that they > are split into main vertex and fragment shader and shadow vertex and > fragment shader. > I saw this. Maybe I'm being daft, b

Re: [osg-users] Advice on interacting with osgShadow

2008-10-23 Thread Wojciech Lewandowski
ld be able to everride proper shadow class and their internal ViewData class and adjust this fuctionality where needed. Cheers, Wojtek - Original Message - From: David Spilling To: OpenSceneGraph Users Sent: Thursday, October 23, 2008 2:04 PM Subject: Re: [osg-users] Advi

Re: [osg-users] Advice on interacting with osgShadow

2008-10-23 Thread Jean-Sébastien Guay
Hi David, Good to know you've got some progress. Regarding shader management, I think that it *would *be appropriate for OSG to provide something here. ( Obviously I realise that this is a large amount of code - I'm arguing about the appropriateness, not actually demanding that someone provid

Re: [osg-users] Advice on interacting with osgShadow

2008-10-23 Thread David Spilling
Hi J-S, Wojciech, Thanks for the help. I've got shadow maps working (I'm on 2.6.1) and when I get round to it, I'll migrate up to the 2.7 ViewDependant stuff and see if I can get the other techniques working as well. > Now, an add-on library could be written that would help unify the art > pipel

Re: [osg-users] Advice on interacting with osgShadow

2008-10-17 Thread Wojciech Lewandowski
Hi J-S, Ok, then lets postpone any changes to the moment we hear additional requests from others. Once you managed to solve your blending issue this discussion seems purely academic. Lets wait for some practical problems to appear. I think this is actually best choice. With every piece we add,

Re: [osg-users] Advice on interacting with osgShadow

2008-10-17 Thread Jean-Sébastien Guay
Hi Wojtek, Ok, then lets postpone any changes to the moment we hear additional requests from others. Once you managed to solve your blending issue this discussion seems purely academic. Lets wait for some practical problems to appear. I think this is actually best choice. With every piece we

Re: [osg-users] Advice on interacting with osgShadow

2008-10-17 Thread Wojciech Lewandowski
Hi J-S, Ok, then lets postpone any changes to the moment we hear additional requests from others. Once you managed to solve your blending issue this discussion seems purely academic. Lets wait for some practical problems to appear. I think this is actually best choice. With every piece we add,

Re: [osg-users] Advice on interacting with osgShadow

2008-10-16 Thread Jean-Sébastien Guay
Hi Wojtek, However, I understand that overridng proper Shadow class and their ViewData might be bit more complicated than overriding simpler things like node callback. So as a mid-solution for those lazy or those who don't know how to override a class, I would propose adding SetShadowMapCamer

Re: [osg-users] Advice on interacting with osgShadow

2008-10-16 Thread Wojciech Lewandowski
tober 15, 2008 10:21 PM To: [EMAIL PROTECTED]; OpenSceneGraph Users Subject: Re: [osg-users] Advice on interacting with osgShadow Hi Wojtek, Turning on AlphaTest/AlphaFunc is not mutually exclusive with RenderBin override. I don't want to make decision that has to be its either this or tha

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Wojciech Lewandowski
J-S, I agree. I will make proposed changes and resubmit. I will do it tomorrow. Cheers, Wojtek -Original Message- From: Jean-Sébastien Guay [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 15, 2008 10:21 PM To: [EMAIL PROTECTED]; OpenSceneGraph Users Subject: Re: [osg-users] Advice on

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hi Wojtek, Turning on AlphaTest/AlphaFunc is not mutually exclusive with RenderBin override. I don't want to make decision that has to be its either this or that. I would like to leave RenderBin override as default. I would also add setShadowMapRenderingSettings/getShadowMapRenderingSettings met

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Wojciech Lewandowski
J-S, >> I suppose that single overriden render bin with AlphaFunc/AlphaTest >> turned only when needed should be faster in theory. Other options turn >> AlphaFunce even when not needed. But in practice I doubt difference will >> be noticable. >> >> Even though you managed to activate AlphaFunc, I

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hello Wojtek, I suppose that single overriden render bin with AlphaFunc/AlphaTest turned only when needed should be faster in theory. Other options turn AlphaFunce even when not needed. But in practice I doubt difference will be noticable. Even though you managed to activate AlphaFunc, I agr

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Wojciech Lewandowski
Hi J-S, It looks like we are in sort of counter-phase.You convinced me to your arguments in the same time as I convinced you to mine ;-) However, I've confirmed that disabling the renderbin override is not necessary if I put an AlphaFunc on my root node, so I'd also be happy with the status

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hi Wojtek, I think your observations prove that AlphaFunc is activated by Transparent bin. IMHO safest way with dealing with AlphaFunc/AlphaTest is to activate it explicitly as a node state attribute whenever BLEND is activated or TransparentBin is selected through RenderingBin hint. That way

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hi Wojtek, J-S please look at this and add/adapt to your needs. Looks good and extensible too. Works fine as I expected. However, I've confirmed that disabling the renderbin override is not necessary if I put an AlphaFunc on my root node, so I'd also be happy with the status quo if no one n

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Wojciech Lewandowski
Hi J-S, I have sent proposed tweaks for submission. I think your observations prove that AlphaFunc is activated by Transparent bin. IMHO safest way with dealing with AlphaFunc/AlphaTest is to activate it explicitly as a node state attribute whenever BLEND is activated or TransparentBin is sel

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Wojciech Lewandowski
Hi Robert, J-S, Attached are proposed fixes to supress overly aggressive optimizations in StandardShadowMap rendering. I added ShadowMapRenderingSettings enum and setShadowMapRenderingSettings / getShadowMapRenderingSettings methods to provide mechanism for similar tweaks in the future. J-S

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hi Wojtek, Ok, now I think I understand - I will submit fix for this case or if You prefer you may do it. Basically we would want to add setter and getter for the flag which will turn off render bin override, right ? Hmmm... I added an osg::AlphaFunc with comparison GL_GREATER 0.0 to the roo

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Wojciech Lewandowski
Hi J-S, No, they won't be solid. As they are not solid in for trees drawn in island scene. But you have to use alpha ref. On the other hand if your transparency does not use alpha ref and sets Z-values it will still be solid even if color buffer would end transparent. Alpha ref? What's that?

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hi David, Thanks for the help. My pleasure. While I'm here, is there any reason why the shaded objects shouldn't do the TexGen in a vertex shader? They do... :-) Thinking about it though, I suppose that setting shadowCast to false on an intermediate node between the mirror and the reflec

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hi Wojtek, No, they won't be solid. As they are not solid in for trees drawn in island scene. But you have to use alpha ref. On the other hand if your transparency does not use alpha ref and sets Z-values it will still be solid even if color buffer would end transparent. Alpha ref? What's t

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread David Spilling
Dear J-S, Thanks for the help. If you're using the ViewDependentShadow techniques, they already disable > shaders while rendering the shadow pass. Ah - I hadn't spotted that in the code yet. So no problems there then. While I'm here, is there any reason why the shaded objects shouldn't do the

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Wojciech Lewandowski
Hi David, J-S As usual, Great thanks to J-S for doing my work ;-) But I would like to clarify the blending issue you mentioned. In the case where the objects that are casting shadows have expensive fragment shaders, I would prefer to turn these shaders off so that we just get a quick depth o

Re: [osg-users] Advice on interacting with osgShadow

2008-10-15 Thread Jean-Sébastien Guay
Hi David, In the case where the objects that are casting shadows have expensive fragment shaders, I would prefer to turn these shaders off so that we just get a quick depth only pass. Fortunately my expensive shaders sit above the object's scenegraph, and so I can envisage an approach in whic

[osg-users] Advice on interacting with osgShadow

2008-10-15 Thread David Spilling
Dear All, I'm just picking up osgShadow, and have a couple of questions that I would appreciate some advice on. The intention is to use one of the ShadowMap type methods. Case1 : Shadow casters already have expensive fragment shaders In the case where the objects that are casting shadows have ex