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;
}
}
Aggregations