is there way to do multiple pass rendering using HLMS like old Ogre::Material ?
For Example, i have a piece of old material code here that on first pass it renders a renderable as PM_SOLID polygon mode and the second pass it renders it as PM_WIREFRAME polygon mode. I'm out of ideas here on how to do this in ogre-next.
I would be really helpful if someone can help me out here.
However, im just brainstorming here since this approach creates an additional Ogre::Item resource. is there a way to solve this through Compositor passes ? like 2 render_scene passes on first pass, it renders an Item in a certain rasterizer state and on second pass, it renders the same item in another rasterizer state.
That'd be quite inefficient in comparison because setDatablock is a relatively expensive operation.
If the problem itself only required different shaders then yes that is a good option because you could add a property in preparePassHash to activate a special pass-specific shader path in the during your special render_scene pass.
However because your problem requires changing blendblocks (and hence flushing the datablocks) it'd be expensive.
is there a way to disable only colour writing of a particular SubItem in a render_scene Pass ? something more analogous to Ogre::Pass::setColourWriteEnabled in Ogre 1.X.
i figured out a way to do this by splitting Each SubMesh into a Mesh, and move them into a specific RenderQueueGroup after Item creation. But can this be done at SubItem level ?
hlms my_material pbs
{
colour_write false
// Alternatively set the blend mask (it's the same thing)
channel_mask 0
// This is how you enable all channels (i.e. the opposite)
channel_mask rgba
}