O'Reilly logo

Mastering Android NDK by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Demo application and a rendering technique

The most important part of the new code is in the OnDrawFrame() method. It uses the clForwardRenderingTechnique class to render the scene. Let's take a look at Technique.cpp.

A helper function RenderROPs() is used to render a vector of rendering operations:

void RenderROPs( sMatrices& Matrices, const std::vector<clRenderOp>& RenderQueue, ePass Pass )
{
  for ( const auto& ROP : RenderQueue )
  {
    ROP.Render( Matrices, g_MatSys, Pass );
  }
}

Now, all the passes can be described in terms of this function. Take a look at the function clForwardRenderingTechnique::Render(). First, let's construct two rendering queues, for opaque and transparent objects. Transparent objects are those with the string Particle as their ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required