HLSL Shaders in Ogre

The HLSL shaders that you create with Render Monkey are interchangible with Nvidia Cg shaders. The code is pretty much identical. All you need to do is take your HLSL vertex shader and pixel shader code and put it in a Cg text file. Then you reference the Cg file from an Ogre material file. The Ogre [Manual] explains how to pass custom variables into your shaders. Or you can link directly to your HLSL shader. The benefit of using Cg is that it will work on more than just Windows. Although HLSL will work on the XBox 360. But I don’t that’s true for Nintendo or Sony products.

Leave a Reply