Reputation:
Currently I replace default.sp with my custom shader and it works fine. But this shader is applied to all objects in the scene.
Scene->SetMtl()
works only with materials and not OpenGL shaders.
How can I use my custom shader only for some objects?
Upvotes: 1
Views: 104
Reputation:
There is a method clScene::SetMtlFromShader()
which accepts three clRenderState
variables. One for each pass: normal, shadow and reflection.
You need to create your own clRenderState
and set the OpenGL shader program to it using clRenderState::SetShaderProgram()
method. It should work fine.
Upvotes: 1