Time for action — adding shadows

Use the previously used code.

  1. After adding all the other code in the createScene() function, add the following line:
    mSceneMgr->setShadowTechnique(Ogre:: SHADOWTYPE_STENCIL_ADDITIVE);
    
  2. Compile and run the application.
    Time for action — adding shadows

What just happened?

With just one line, we added shadows to our scene. Ogre 3D does the rest of the work for us. Ogre 3D supports different shadow techniques. We used additive stencil shadows. Stencil means a special texture buffer used while rendering the scene. Additive implies that the scene is rendered once from the camera perspective and the contribution of each light is accumulated into the final render. ...

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.