Time for action — creating a material

Now, we are going to create our own material using the white quad we created.

  1. Change the material name in the application from BaseWhiteNoLighting to MyMaterial1:
    manual->begin("MyMaterial1", RenderOperation::OT_TRIANGLE_LIST);
    
  2. Create a new file named Ogre3DBeginnersGuide.material in the media\materials\scripts folder of our Ogre3D SDK.
  3. Write the following code into the material file:
    material MyMaterial1
    {
    technique
    {
    pass
    {
    texture_unit
    {
    texture leaf.png
    }
    }
    }
    }
    
  4. Compile and run the application. You should see a white quad with a plant drawn onto it.
    Time for action — creating a material

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.