use of com.jme3.renderer.Renderer in project jmonkeyengine by jMonkeyEngine.
the class PreNormalCaching method getPreNormals.
/**
* Get pre-normals from the given rendering.
* @param renderManager the render manager.
* @param normalPass the normal pass.
* @param viewPort the viewport.
*/
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());
}
use of com.jme3.renderer.Renderer in project jmonkeyengine by jMonkeyEngine.
the class AbstractShadowRendererVR method postQueue.
@SuppressWarnings("fallthrough")
public void postQueue(RenderQueue rq) {
lightReceivers.clear();
skipPostPass = false;
if (!checkCulling(viewPort.getCamera())) {
skipPostPass = true;
return;
}
updateShadowCams(viewPort.getCamera());
Renderer r = renderManager.getRenderer();
renderManager.setForcedMaterial(preshadowMat);
renderManager.setForcedTechnique("PreShadow");
for (int shadowMapIndex = 0; shadowMapIndex < nbShadowMaps; shadowMapIndex++) {
if (debugfrustums) {
doDisplayFrustumDebug(shadowMapIndex);
}
renderShadowMap(shadowMapIndex);
}
debugfrustums = false;
//restore setting for future rendering
r.setFrameBuffer(viewPort.getOutputFrameBuffer());
renderManager.setForcedMaterial(null);
renderManager.setForcedTechnique(null);
renderManager.setCamera(viewPort.getCamera(), false);
}
use of com.jme3.renderer.Renderer in project jmonkeyengine by jMonkeyEngine.
the class AbstractShadowRendererVR method clearMatParams.
private void clearMatParams() {
for (Material mat : matCache) {
//at least 1 shadow map and will set it on each frame anyway.
for (int j = 1; j < nbShadowMaps; j++) {
mat.clearParam(lightViewStringCache[j]);
}
for (int j = 1; j < nbShadowMaps; j++) {
mat.clearParam(shadowMapStringCache[j]);
}
mat.clearParam("FadeInfo");
clearMaterialParameters(mat);
}
//No need to clear the postShadowMat params as the instance is locale to each renderer
}
Aggregations