Operating System: Win10
Render System: DirectX11
Hello guys,
Recently I have ported my app from DX9 to DX11, and I have started replace FFP with own shaders in the materials. The next thing what i want to implement is the shadows. I have some surfaces with own shaders what i want to receive shadows using different Ogre techniques like (contour and texture based, modulative and additive as well). If I'm right to make shadows work I have to classify passes in these material in order to Ogre can make illumination passes. I have followed the tutorial about material pass classification and i got that material:
Code: Select all
material desert
{
technique
{
pass ambient
{
diffuse 0 0 0
}
pass perlight
{
ambient 0 0 0
iteration once_per_light
scene_blend add
vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
{
}
fragment_program_ref Ogre/BasicFragmentPrograms/PassthroughFpHLSL
{
}
// Vertex program reference
shadow_receiver_vertex_program_ref Ogre/DepthShadowmap/ReceiverVP_HLSL
{
}
// Fragment program
shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/ReceiverFP_HLSL
{
}
}
pass decal
{
lighting off
scene_blend dest_colour zero
vertex_program_ref ownVS
{
}
fragment_program_ref ownPS
{
}
texture_unit
{
texture "Terrain/terrain-1.bmp"
filtering linear linear linear
scale 20 20
}
}
}
}
Before that I had the possibility to change some properties of these surface materials during runtime with these Ogre functions: Ogre::pass->setAmbient( ), Ogre::pass->setDiffuse( ); Ogre::pass->setSelfIllumination(), and I could also set the material to transparent.
My question is, in what pass i have to call these functions? or I have to implement these features in the shader? but how?
Guys, could you give me some instructions because I have no idea what is the right way?
Thanks!