Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-15 Thread Trajce Nikolov NICK
Hi Michael,

this sounds good but I just tried and it seam without changing the OSG code
it is not possible as well. The StandardShadowMap does not holds any
instance of the StandardShadowMap::ViewData where the _stateset is kept.

Nick


On Tue, Apr 15, 2014 at 7:29 AM, michael kapelko korn...@gmail.com wrote:

 I would derive from StandardShadowMap to gain access to _stateset
 variable. Then, osg::StateSet::getAttribute can return osg::Program it
 contains.


 2014-04-14 22:44 GMT+07:00 Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com:

 I looked at the code of StandardShadowMap.cpp and I think this object at
 line: 544 osg::Program has to be exposed to the interface as well. Robert,
 will You accept such a change, it is minor but will change the interface
 with one getProgram() method and will not brake anything. This case is good
 example of such a need when you for example wants to mix the shaders of the
 ShadowMap with your own

 Nick


 On Mon, Apr 14, 2014 at 12:35 PM, Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com wrote:

 Knowing the problem a bit I think the question is how to access the
 osg::Program of the shader technique for binding vertex attributes like the
 binormal and tangents arrays.

 Nick


 On Mon, Apr 14, 2014 at 11:07 AM, Jaime xatp...@hotmail.com wrote:

 Thanks kornerr.

 I was checking your code, but the problem is that I don't want deferred
 shading, because I need transparency too.

 I think I should use LightSpacePerspectiveShadowMap because there I can
 use setShadowVertex/FragementeShader.

 Nick helped me with his code (thanks again Nick!), but we need to pass
 the attributes (binormal and tangent) to the shader, and then it has to be
 used by osg Shadow Mapping.

 So, does anybody know how to pass attributes to this shaders??

 Thanks a lot!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58910#58910





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org

 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 --
 trajce nikolov nick




 --
 trajce nikolov nick

 ___
 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




-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-15 Thread michael kapelko
Well, you said you want osg::Program at StandardShadowMap.cpp:544. That
osg::Program is set to _stateset just on the next line. So if osg::Program
of _stateset doesn't work for you, there's no use exposing it.


2014-04-15 17:50 GMT+07:00 Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com:

 Hi Michael,

 this sounds good but I just tried and it seam without changing the OSG
 code it is not possible as well. The StandardShadowMap does not holds any
 instance of the StandardShadowMap::ViewData where the _stateset is kept.

 Nick


 On Tue, Apr 15, 2014 at 7:29 AM, michael kapelko korn...@gmail.comwrote:

 I would derive from StandardShadowMap to gain access to _stateset
 variable. Then, osg::StateSet::getAttribute can return osg::Program it
 contains.


 2014-04-14 22:44 GMT+07:00 Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com:

 I looked at the code of StandardShadowMap.cpp and I think this object at
 line: 544 osg::Program has to be exposed to the interface as well. Robert,
 will You accept such a change, it is minor but will change the interface
 with one getProgram() method and will not brake anything. This case is good
 example of such a need when you for example wants to mix the shaders of the
 ShadowMap with your own

 Nick


 On Mon, Apr 14, 2014 at 12:35 PM, Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com wrote:

 Knowing the problem a bit I think the question is how to access the
 osg::Program of the shader technique for binding vertex attributes like the
 binormal and tangents arrays.

 Nick


 On Mon, Apr 14, 2014 at 11:07 AM, Jaime xatp...@hotmail.com wrote:

 Thanks kornerr.

 I was checking your code, but the problem is that I don't want
 deferred shading, because I need transparency too.

 I think I should use LightSpacePerspectiveShadowMap because there I
 can use setShadowVertex/FragementeShader.

 Nick helped me with his code (thanks again Nick!), but we need to pass
 the attributes (binormal and tangent) to the shader, and then it has to be
 used by osg Shadow Mapping.

 So, does anybody know how to pass attributes to this shaders??

 Thanks a lot!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58910#58910





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org

 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 --
 trajce nikolov nick




 --
 trajce nikolov nick

 ___
 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




 --
 trajce nikolov nick

 ___
 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


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-14 Thread Jaime
Thanks kornerr.

I was checking your code, but the problem is that I don't want deferred 
shading, because I need transparency too. 

I think I should use LightSpacePerspectiveShadowMap because there I can use 
setShadowVertex/FragementeShader.

Nick helped me with his code (thanks again Nick!), but we need to pass the 
attributes (binormal and tangent) to the shader, and then it has to be used by 
osg Shadow Mapping.

So, does anybody know how to pass attributes to this shaders??

Thanks a lot!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58910#58910





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-14 Thread Trajce Nikolov NICK
Knowing the problem a bit I think the question is how to access the
osg::Program of the shader technique for binding vertex attributes like the
binormal and tangents arrays.

Nick


On Mon, Apr 14, 2014 at 11:07 AM, Jaime xatp...@hotmail.com wrote:

 Thanks kornerr.

 I was checking your code, but the problem is that I don't want deferred
 shading, because I need transparency too.

 I think I should use LightSpacePerspectiveShadowMap because there I can
 use setShadowVertex/FragementeShader.

 Nick helped me with his code (thanks again Nick!), but we need to pass the
 attributes (binormal and tangent) to the shader, and then it has to be used
 by osg Shadow Mapping.

 So, does anybody know how to pass attributes to this shaders??

 Thanks a lot!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58910#58910





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-14 Thread Trajce Nikolov NICK
I looked at the code of StandardShadowMap.cpp and I think this object at
line: 544 osg::Program has to be exposed to the interface as well. Robert,
will You accept such a change, it is minor but will change the interface
with one getProgram() method and will not brake anything. This case is good
example of such a need when you for example wants to mix the shaders of the
ShadowMap with your own

Nick


On Mon, Apr 14, 2014 at 12:35 PM, Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com wrote:

 Knowing the problem a bit I think the question is how to access the
 osg::Program of the shader technique for binding vertex attributes like the
 binormal and tangents arrays.

 Nick


 On Mon, Apr 14, 2014 at 11:07 AM, Jaime xatp...@hotmail.com wrote:

 Thanks kornerr.

 I was checking your code, but the problem is that I don't want deferred
 shading, because I need transparency too.

 I think I should use LightSpacePerspectiveShadowMap because there I can
 use setShadowVertex/FragementeShader.

 Nick helped me with his code (thanks again Nick!), but we need to pass
 the attributes (binormal and tangent) to the shader, and then it has to be
 used by osg Shadow Mapping.

 So, does anybody know how to pass attributes to this shaders??

 Thanks a lot!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58910#58910





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 --
 trajce nikolov nick




-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-14 Thread michael kapelko
I would derive from StandardShadowMap to gain access to _stateset variable.
Then, osg::StateSet::getAttribute can return osg::Program it contains.


2014-04-14 22:44 GMT+07:00 Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com:

 I looked at the code of StandardShadowMap.cpp and I think this object at
 line: 544 osg::Program has to be exposed to the interface as well. Robert,
 will You accept such a change, it is minor but will change the interface
 with one getProgram() method and will not brake anything. This case is good
 example of such a need when you for example wants to mix the shaders of the
 ShadowMap with your own

 Nick


 On Mon, Apr 14, 2014 at 12:35 PM, Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com wrote:

 Knowing the problem a bit I think the question is how to access the
 osg::Program of the shader technique for binding vertex attributes like the
 binormal and tangents arrays.

 Nick


 On Mon, Apr 14, 2014 at 11:07 AM, Jaime xatp...@hotmail.com wrote:

 Thanks kornerr.

 I was checking your code, but the problem is that I don't want deferred
 shading, because I need transparency too.

 I think I should use LightSpacePerspectiveShadowMap because there I can
 use setShadowVertex/FragementeShader.

 Nick helped me with his code (thanks again Nick!), but we need to pass
 the attributes (binormal and tangent) to the shader, and then it has to be
 used by osg Shadow Mapping.

 So, does anybody know how to pass attributes to this shaders??

 Thanks a lot!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58910#58910





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 --
 trajce nikolov nick




 --
 trajce nikolov nick

 ___
 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


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-11 Thread Trajce Nikolov NICK
Hi Jaime,

yes, I have such an example. If you have the bump mapping GLSL code ready
you can mix it with the shadow map shaders and set it to your shadow
mapping technique - there are methods
like 
setShadowVertexShader/setShadowFragmentShader/setMainVertexShader/setMainFragmentShader

Nick


On Fri, Apr 11, 2014 at 10:50 AM, Jaime xatp...@hotmail.com wrote:

 Hi,

 Does anybody have any example where I could find any solution to combine
 shadow maps and other shaders, specially bump mapping??

 Thanks!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58876#58876





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-11 Thread Jaime
Thanks for your response Nick.

Yes, I have my bump shader. But I don't know how to combine.

Please, could you give me an example with code?? 

Thanks!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58878#58878





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-11 Thread Trajce Nikolov NICK
yes. I will ping you on email

Nick


On Fri, Apr 11, 2014 at 11:05 AM, Jaime xatp...@hotmail.com wrote:

 Thanks for your response Nick.

 Yes, I have my bump shader. But I don't know how to combine.

 Please, could you give me an example with code??

 Thanks!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58878#58878





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShadowMap + Other shaders (bump, specular, etc) example???

2014-04-11 Thread michael kapelko
Hi.

Here's my example: https://bitbucket.org/kornerr/osg-deferred-shading (
http://youtu.be/AjWOSuLxZ68 )
It has 2 implementaions: plain OSG and EffectCompositor (not part of OSG).
The basic idea behind my implementation is to:
* render the shadow only information to texture;
* do all the rest effects myself and then combine those with the shadow
info.



2014-04-11 16:04 GMT+07:00 Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com:

 yes. I will ping you on email

 Nick


 On Fri, Apr 11, 2014 at 11:05 AM, Jaime xatp...@hotmail.com wrote:

 Thanks for your response Nick.

 Yes, I have my bump shader. But I don't know how to combine.

 Please, could you give me an example with code??

 Thanks!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58878#58878





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 --
 trajce nikolov nick

 ___
 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