Fixed viewport uniforms binding

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9561 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 13 years ago
parent 2a18784041
commit 96ae823504
  1. 1
      engine/src/core/com/jme3/renderer/RenderManager.java
  2. 12
      engine/src/core/com/jme3/shader/UniformBindingManager.java

@ -813,6 +813,7 @@ public class RenderManager {
viewY = (int) (cam.getViewPortBottom() * cam.getHeight());
viewWidth = (int) ((cam.getViewPortRight() - cam.getViewPortLeft()) * cam.getWidth());
viewHeight = (int) ((cam.getViewPortTop() - cam.getViewPortBottom()) * cam.getHeight());
uniformBindingManager.setViewPort(viewX, viewY, viewWidth, viewHeight);
renderer.setViewPort(viewX, viewY, viewWidth, viewHeight);
renderer.setClipRect(viewX, viewY, viewWidth, viewHeight);
cam.clearViewportChanged();

@ -7,6 +7,7 @@ package com.jme3.shader;
import com.jme3.math.*;
import com.jme3.renderer.Camera;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.system.Timer;
import java.util.List;
@ -29,18 +30,14 @@ public class UniformBindingManager {
camLeft = new Vector3f(),
camDir = new Vector3f(),
camLoc = new Vector3f();
private Matrix4f tempMatrix = new Matrix4f();
private Matrix4f viewMatrix = new Matrix4f();
private Matrix4f projMatrix = new Matrix4f();
private Matrix4f viewProjMatrix = new Matrix4f();
private Matrix4f worldMatrix = new Matrix4f();
private Matrix4f worldViewMatrix = new Matrix4f();
private Matrix4f worldViewProjMatrix = new Matrix4f();
private Matrix3f normalMatrix = new Matrix3f();
private Matrix4f worldMatrixInv = new Matrix4f();
private Matrix4f viewMatrixInv = new Matrix4f();
private Matrix4f projMatrixInv = new Matrix4f();
@ -48,7 +45,6 @@ public class UniformBindingManager {
private Matrix4f worldViewMatrixInv = new Matrix4f();
private Matrix3f normalMatrixInv = new Matrix3f();
private Matrix4f worldViewProjMatrixInv = new Matrix4f();
private Vector4f viewPort = new Vector4f();
private Vector2f resolution = new Vector2f();
private Vector2f resolutionInv = new Vector2f();
@ -221,4 +217,10 @@ public class UniformBindingManager {
far = cam.getFrustumFar();
}
public void setViewPort(int viewX, int viewY, int viewWidth, int viewHeight) {
this.viewX = viewX;
this.viewY = viewY;
this.viewWidth = viewWidth;
this.viewHeight = viewHeight;
}
}

Loading…
Cancel
Save