Search in sources :

Example 46 with Renderer

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());
}
Also used : Renderer(com.jme3.renderer.Renderer)

Example 47 with Renderer

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);
}
Also used : Renderer(com.jme3.renderer.Renderer)

Example 48 with Renderer

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       
}
Also used : Material(com.jme3.material.Material)

Aggregations

Renderer (com.jme3.renderer.Renderer)17 Camera (com.jme3.renderer.Camera)7 Vector3f (com.jme3.math.Vector3f)5 Material (com.jme3.material.Material)4 SceneProcessor (com.jme3.post.SceneProcessor)3 RendererException (com.jme3.renderer.RendererException)3 GLExt (com.jme3.renderer.opengl.GLExt)3 GLFbo (com.jme3.renderer.opengl.GLFbo)3 GLRenderer (com.jme3.renderer.opengl.GLRenderer)3 Uniform (com.jme3.shader.Uniform)3 CartoonSSAO (com.jme3.post.CartoonSSAO)2 Filter (com.jme3.post.Filter)2 FilterPostProcessor (com.jme3.post.FilterPostProcessor)2 HDRRenderer (com.jme3.post.HDRRenderer)2 FogFilter (com.jme3.post.filters.FogFilter)2 TranslucentBucketFilter (com.jme3.post.filters.TranslucentBucketFilter)2 SSAOFilter (com.jme3.post.ssao.SSAOFilter)2 Caps (com.jme3.renderer.Caps)2 RenderManager (com.jme3.renderer.RenderManager)2 LwjglGL (com.jme3.renderer.lwjgl.LwjglGL)2