* Added ResolutionInverse (thanks kwando)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9210 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent 7a7b2c3f5f
commit b2e086bbee
  1. 4
      engine/src/core/com/jme3/renderer/RenderManager.java
  2. 6
      engine/src/core/com/jme3/shader/UniformBinding.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);

@ -120,6 +120,12 @@ public enum UniformBinding {
*/
Resolution,
/**
* The inverse of the resolution, 1/width and 1/height.
* Type: vec2
*/
ResolutionInverse,
/**
* Aspect ratio of the resolution currently set. Width/Height.
* Type: float

Loading…
Cancel
Save