Hi,
I was googling and trying to find a running example of Depth Shadow mapping and PSSM with custom receiver shader and custom caster shader. For simplicity, lets call the receiver mesh terrain and caster mesh unit.
I found examples of terrain and unit which are without custom shaders, but not applied to custom shaders (even the simple ones, which simply do the same as fixed pipeline).
Does anyone have a link or code where this is used?
Thank you very much in advance.
Depth shadow mapping and PSSM with custom shader
-
- Gnome
- Posts: 368
- Joined: Tue Jan 06, 2009 1:12 pm
- x 43
-
- OGRE Team Member
- Posts: 5490
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1361
Re: Depth shadow mapping and PSSM with custom shader
The sample ShadowsV2 under Samples/ApiUsage/Lights/ShadowsV2 in the 2.0 branch shows how to do exactly this, and the code should work in 1.x as well (Materials + Shaders in 1.x and 2.0 remained the same. Compositor part only applies to 2.0)
-
- Gnome
- Posts: 368
- Joined: Tue Jan 06, 2009 1:12 pm
- x 43
Re: Depth shadow mapping and PSSM with custom shader
I was able to create functional custom shader, which shows lit and cast shadows on the plane.
My last problem is self shadowing and my knowledge about shadows is limited, so I have few questions:
I just want to clarify what I mean by self shadowing - it means that the mesh can cast shadow on itself, like you can see here
My last problem is self shadowing and my knowledge about shadows is limited, so I have few questions:
I just want to clarify what I mean by self shadowing - it means that the mesh can cast shadow on itself, like you can see here
- Is it possible in general to have self shadows for integrated texture based shadows? The screenshot was taken from the ogre samples, but when stencil shadows were turned on. When I switched to texture shadows, there was no example of successful self-shadowing...?
- How exactly is shadow texture unit created? In my case I can see the colour channel only full or empty (the colour channel is either 0 or 1, but never anything between).
- Is there a way how I can change the shadow texture creation?
- Is there a working sample where texture based shadows have self shadows?
-
- Gnome
- Posts: 368
- Joined: Tue Jan 06, 2009 1:12 pm
- x 43
Re: Depth shadow mapping and PSSM with custom shader
And one more question:
where can be the problem when my meshes have lit but the shadow texture is always pure red? Can I have something incorrectly setup?
where can be the problem when my meshes have lit but the shadow texture is always pure red? Can I have something incorrectly setup?