diff --git a/jme3-android/src/main/java/com/jme3/renderer/android/OGLESShaderRenderer.java b/jme3-android/src/main/java/com/jme3/renderer/android/OGLESShaderRenderer.java index 5a2bbeabe..5b3e829c1 100644 --- a/jme3-android/src/main/java/com/jme3/renderer/android/OGLESShaderRenderer.java +++ b/jme3-android/src/main/java/com/jme3/renderer/android/OGLESShaderRenderer.java @@ -556,6 +556,9 @@ public class OGLESShaderRenderer implements Renderer { case ModulateX2: GLES20.glBlendFunc(GLES20.GL_DST_COLOR, GLES20.GL_SRC_COLOR); break; + case Screen: + GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_COLOR); + break; default: throw new UnsupportedOperationException("Unrecognized blend mode: " + state.getBlendMode()); diff --git a/jme3-core/src/main/java/com/jme3/material/RenderState.java b/jme3-core/src/main/java/com/jme3/material/RenderState.java index 65733a451..2cea1c8e6 100644 --- a/jme3-core/src/main/java/com/jme3/material/RenderState.java +++ b/jme3-core/src/main/java/com/jme3/material/RenderState.java @@ -176,7 +176,14 @@ public class RenderState implements Cloneable, Savable { *
* Result = 2 * Source Color * Dest Color -> (GL_DST_COLOR, GL_SRC_COLOR) */ - ModulateX2 + ModulateX2, + /** + * Opposite effect of Modulate/Multiply. Invert both colors, multiply and + * then invert the result. + *
+ * Result = 1 - (1 - Source Color) * (1 - Dest Color) -> (GL_ONE, GL_ONE_MINUS_SRC_COLOR) + */ + Screen } /** diff --git a/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglRenderer.java b/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglRenderer.java index dcad44ef0..1df80f66a 100644 --- a/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglRenderer.java +++ b/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglRenderer.java @@ -698,6 +698,9 @@ public class JoglRenderer implements Renderer { case ModulateX2: gl.glBlendFunc(GL.GL_DST_COLOR, GL.GL_SRC_COLOR); break; + case Screen: + gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_COLOR); + break; default: throw new UnsupportedOperationException("Unrecognized blend mode: " + state.getBlendMode()); diff --git a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java index b093467fc..c30c706f4 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java +++ b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java @@ -647,6 +647,9 @@ public class LwjglRenderer implements Renderer { case ModulateX2: glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); break; + case Screen: + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); + break; default: throw new UnsupportedOperationException("Unrecognized blend mode: " + state.getBlendMode());