use of com.jme3.shadow.EdgeFilteringMode in project jmonkeyengine by jMonkeyEngine.
the class AbstractShadowRendererVR method setShadowCompareMode.
/**
* Sets the shadow compare mode. See {@link CompareMode} for more info.
*
* @param compareMode the desired compare mode (not null)
*/
public final void setShadowCompareMode(CompareMode compareMode) {
if (compareMode == null) {
throw new IllegalArgumentException("Shadow compare mode cannot be null");
}
this.shadowCompareMode = compareMode;
for (Texture2D shadowMap : shadowMaps) {
if (compareMode == CompareMode.Hardware) {
shadowMap.setShadowCompareMode(ShadowCompareMode.LessOrEqual);
if (edgeFilteringMode == EdgeFilteringMode.Bilinear) {
shadowMap.setMagFilter(MagFilter.Bilinear);
shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps);
} else {
shadowMap.setMagFilter(MagFilter.Nearest);
shadowMap.setMinFilter(MinFilter.NearestNoMipMaps);
}
} else {
shadowMap.setShadowCompareMode(ShadowCompareMode.Off);
shadowMap.setMagFilter(MagFilter.Nearest);
shadowMap.setMinFilter(MinFilter.NearestNoMipMaps);
}
}
postshadowMat.setBoolean("HardwareShadows", compareMode == CompareMode.Hardware);
}
Aggregations