Esempio n. 1
0
 public static void getPreNormals(
     RenderManager renderManager, Pass normalPass, ViewPort viewPort) {
   curCount++;
   // do we already have a valid cache to set the framebuffer to?
   Renderer r = renderManager.getRenderer();
   if (cachedPreNormals != null) {
     r.copyFrameBuffer(cachedPreNormals, normalPass.getRenderFrameBuffer(), false);
   } else {
     // lets make the prenormals
     r.setFrameBuffer(normalPass.getRenderFrameBuffer());
     renderManager.getRenderer().clearBuffers(true, true, true);
     if (renderManager.getRenderer().getCaps().contains(Caps.GLSL150)) {
       renderManager.setForcedTechnique("PreNormalPass15");
     } else {
       renderManager.setForcedTechnique("PreNormalPass");
     }
     renderManager.renderViewPortQueues(viewPort, false);
     renderManager.setForcedTechnique(null);
     // if we should cache this, do it now
     if (lastNormalPassesCount > 1) {
       cachedPreNormals = normalPass.getRenderFrameBuffer();
     }
   }
   renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
 }
 @Override
 protected void postQueue(RenderQueue queue) {
   Renderer r = renderManager.getRenderer();
   r.setFrameBuffer(normalPass.getRenderFrameBuffer());
   renderManager.getRenderer().clearBuffers(true, true, true);
   renderManager.setForcedTechnique("PreNormalPass");
   renderManager.renderViewPortQueues(viewPort, false);
   renderManager.setForcedTechnique(null);
   renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
 }