Hi,

On 30.08.2012 16:19, Carsten Neumann wrote:
>       Hello Christoph,
>
> On 08/28/2012 08:33 AM, "Christoph Fünfzig" wrote:
>> I am using a ShadowStage node for shadow rendering.
>> How do I incorporate shadowing effects into my own
>> vertex/fragment shader material?
>
> the ShadowStage runs a pass that combines all shadow maps from lights 
> into a full screen texture that is then combined with the rendered scene 
> to darken areas that are in shadow - so the you won't get coloured 
> shadows with it. That means your materials don't have to know about 
> shadow maps, they just compute lighting without testing for visibility.
>

Ok, this sounds good.
I use a vertex shader, which repositions vertices. It needs to be activated 
during shadow map generation to get correct shadows.

Please see here:
Image with just a quad (as Geometry)
http://dl.dropbox.com/u/15967626/shadow_without.png

Image with terrain nodes (10*10 tiles) with vertex shader to reposition 
vertices acc. to a float texture
http://dl.dropbox.com/u/15967626/shadow_terrain1.png

Image with terrain nodes (10*10 tiles) with vertex shader deactivated
http://dl.dropbox.com/u/15967626/shadow_terrain2.png

As you can see, shadows from the single point light with quad geometry looks 
correct.
With the terrain, the shadow looks like the vertex shader having been 
deactivated during shadow generation.
The terrain tile node is derived from OSG::MaterialDrawable having a 
OSG::SimpleMaterial and a OSG::SimpleSHLChunk setting the shader parameters.
So are there restrictions on the materials? Can you point me to
the code where the shadow casters are rendered?

Thanks,
Christoph 

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to