Search in sources :

Example 26 with RenderManager

use of com.jme3.renderer.RenderManager in project jmonkeyengine by jMonkeyEngine.

the class ToneMapFilter method initFilter.

@Override
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
    material = new Material(manager, "Common/MatDefs/Post/ToneMap.j3md");
    material.setVector3("WhitePoint", whitePoint);
}
Also used : Material(com.jme3.material.Material)

Example 27 with RenderManager

use of com.jme3.renderer.RenderManager in project jmonkeyengine by jMonkeyEngine.

the class TranslucentBucketFilter method initFilter.

@Override
protected void initFilter(AssetManager manager, RenderManager rm, ViewPort vp, int w, int h) {
    this.renderManager = rm;
    this.viewPort = vp;
    material = new Material(manager, "Common/MatDefs/Post/Overlay.j3md");
    material.setColor("Color", ColorRGBA.White);
    Texture2D tex = processor.getFilterTexture();
    material.setTexture("Texture", tex);
    if (tex.getImage().getMultiSamples() > 1) {
        material.setInt("NumSamples", tex.getImage().getMultiSamples());
    } else {
        material.clearParam("NumSamples");
    }
    renderManager.setHandleTranslucentBucket(false);
    if (enabledSoftParticles && depthTexture != null) {
        initSoftParticles(vp, true);
    }
}
Also used : Texture2D(com.jme3.texture.Texture2D) Material(com.jme3.material.Material)

Example 28 with RenderManager

use of com.jme3.renderer.RenderManager in project jmonkeyengine by jMonkeyEngine.

the class SimpleWaterProcessor method initialize.

public void initialize(RenderManager rm, ViewPort vp) {
    this.rm = rm;
    this.vp = vp;
    loadTextures(manager);
    createTextures();
    applyTextures(material);
    createPreViews();
    material.setVector2("FrustumNearFar", new Vector2f(vp.getCamera().getFrustumNear(), vp.getCamera().getFrustumFar()));
    if (debug) {
        dispRefraction = new Picture("dispRefraction");
        dispRefraction.setTexture(manager, refractionTexture, false);
        dispReflection = new Picture("dispRefraction");
        dispReflection.setTexture(manager, reflectionTexture, false);
        dispDepth = new Picture("depthTexture");
        dispDepth.setTexture(manager, depthTexture, false);
    }
}
Also used : Picture(com.jme3.ui.Picture)

Example 29 with RenderManager

use of com.jme3.renderer.RenderManager in project jmonkeyengine by jMonkeyEngine.

the class DepthOfFieldFilter method initFilter.

@Override
protected void initFilter(AssetManager assets, RenderManager renderManager, ViewPort vp, int w, int h) {
    material = new Material(assets, "Common/MatDefs/Post/DepthOfField.j3md");
    material.setFloat("FocusDistance", focusDistance);
    material.setFloat("FocusRange", focusRange);
    xScale = 1.0f / w;
    yScale = 1.0f / h;
    material.setFloat("XScale", blurScale * xScale);
    material.setFloat("YScale", blurScale * yScale);
}
Also used : Material(com.jme3.material.Material)

Example 30 with RenderManager

use of com.jme3.renderer.RenderManager in project jmonkeyengine by jMonkeyEngine.

the class FXAAFilter method initFilter.

@Override
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
    material = new Material(manager, "Common/MatDefs/Post/FXAA.j3md");
    material.setFloat("SubPixelShift", subPixelShift);
    material.setFloat("VxOffset", vxOffset);
    material.setFloat("SpanMax", spanMax);
    material.setFloat("ReduceMul", reduceMul);
}
Also used : Material(com.jme3.material.Material)

Aggregations

Material (com.jme3.material.Material)25 Camera (com.jme3.renderer.Camera)15 Renderer (com.jme3.renderer.Renderer)11 Vector3f (com.jme3.math.Vector3f)8 Texture2D (com.jme3.texture.Texture2D)5 DirectionalLight (com.jme3.light.DirectionalLight)4 Geometry (com.jme3.scene.Geometry)4 Picture (com.jme3.ui.Picture)4 TempVars (com.jme3.util.TempVars)4 Light (com.jme3.light.Light)3 PointLight (com.jme3.light.PointLight)3 SpotLight (com.jme3.light.SpotLight)3 Pass (com.jme3.post.Filter.Pass)3 RenderManager (com.jme3.renderer.RenderManager)3 Spatial (com.jme3.scene.Spatial)3 Shader (com.jme3.shader.Shader)3 FrameBuffer (com.jme3.texture.FrameBuffer)3 Texture (com.jme3.texture.Texture)3 Test (org.junit.Test)3 Technique (com.jme3.material.Technique)2