diff --git a/engine/src/core/com/jme3/renderer/RenderManager.java b/engine/src/core/com/jme3/renderer/RenderManager.java index cccd7b905..86305c5ca 100644 --- a/engine/src/core/com/jme3/renderer/RenderManager.java +++ b/engine/src/core/com/jme3/renderer/RenderManager.java @@ -429,6 +429,10 @@ public class RenderManager { tempVec2.set(viewWidth, viewHeight); u.setValue(VarType.Vector2, tempVec2); break; + case ResolutionInverse: + tempVec2.set(1f / viewWidth, 1f / viewHeight); + u.setValue(VarType.Vector2, tempVec2); + break; case Aspect: float aspect = ((float) viewWidth) / viewHeight; u.setValue(VarType.Float, aspect); diff --git a/engine/src/core/com/jme3/shader/UniformBinding.java b/engine/src/core/com/jme3/shader/UniformBinding.java index e1ee454fe..a30f58d81 100644 --- a/engine/src/core/com/jme3/shader/UniformBinding.java +++ b/engine/src/core/com/jme3/shader/UniformBinding.java @@ -119,6 +119,12 @@ public enum UniformBinding { * Type: vec2 */ Resolution, + + /** + * The inverse of the resolution, 1/width and 1/height. + * Type: vec2 + */ + ResolutionInverse, /** * Aspect ratio of the resolution currently set. Width/Height.