Search in sources :

Example 1 with SceneGraphRenderer

use of gaiasky.render.SceneGraphRenderer in project gaiasky by langurmonkey.

the class ModelBody method prepareShadowEnvironment.

/**
 * Sets the shadow environment
 */
protected void prepareShadowEnvironment() {
    if (Settings.settings.scene.renderer.shadow.active) {
        Environment env = mc.env;
        SceneGraphRenderer sgr = GaiaSky.instance.sgr;
        if (shadow > 0 && sgr.smTexMap.containsKey(this)) {
            Matrix4 combined = sgr.smCombinedMap.get(this);
            Texture tex = sgr.smTexMap.get(this);
            if (env.shadowMap == null) {
                if (shadowMap == null)
                    shadowMap = new ShadowMapImpl(combined, tex);
                env.shadowMap = shadowMap;
            }
            shadowMap.setProjViewTrans(combined);
            shadowMap.setDepthMap(tex);
            shadow--;
        } else {
            env.shadowMap = null;
        }
    } else {
        mc.env.shadowMap = null;
    }
}
Also used : SceneGraphRenderer(gaiasky.render.SceneGraphRenderer) ShadowMapImpl(gaiasky.render.ShadowMapImpl) Environment(gaiasky.util.gdx.shader.Environment) Texture(com.badlogic.gdx.graphics.Texture) Matrix4(com.badlogic.gdx.math.Matrix4)

Aggregations

Texture (com.badlogic.gdx.graphics.Texture)1 Matrix4 (com.badlogic.gdx.math.Matrix4)1 SceneGraphRenderer (gaiasky.render.SceneGraphRenderer)1 ShadowMapImpl (gaiasky.render.ShadowMapImpl)1 Environment (gaiasky.util.gdx.shader.Environment)1