Time for action — creating a material
Now, we are going to create our own material using the white quad we created.
- Change the material name in the application from
BaseWhiteNoLighting
toMyMaterial1:
manual->begin("MyMaterial1", RenderOperation::OT_TRIANGLE_LIST);
- Create a new file named
Ogre3DBeginnersGuide.material
in themedia\materials\scripts
folder of our Ogre3D SDK. - Write the following code into the material file:
material MyMaterial1 { technique { pass { texture_unit { texture leaf.png } } } }
- Compile and run the application. You should see a white quad with a plant drawn onto it.
What just happened?
We created our first material file. In Ogre ...
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.