Time for action — our first shader application
Let's write our first vertex and fragment shaders:
- In our application, we only need to change the used material. Change it to
MyMaterial13
. Also remove the second quad:manual->begin("MyMaterial13", RenderOperation::OT_TRIANGLE_LIST);
- Now we need to create this material in our material file. First, we are going to define the fragment shader. Ogre 3D needs five pieces of information about the shader:
- The name of the shader
- In which language it is written
- In which source file it is stored
- How the main function of this shader is called
- In what profile we want the shader to be compiled
- All this information should be in the material file:
fragment_program MyFragmentShader1 cg { source Ogre3DBeginnersGuideShaders.cg ...
Get Ogre 3D 1.7 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.