- added a ColorRGBA to tempVars
- Used tempvars in Materila.renderMultipassLighting git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7903 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
0b7f96726f
commit
310193018d
@ -61,6 +61,7 @@ import com.jme3.shader.Uniform;
|
||||
import com.jme3.shader.VarType;
|
||||
import com.jme3.texture.Texture;
|
||||
import com.jme3.util.ListMap;
|
||||
import com.jme3.util.TempVars;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
@ -698,9 +699,6 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
|
||||
lightIndex++;
|
||||
}
|
||||
}
|
||||
Quaternion tmpLightDirection = new Quaternion();
|
||||
Quaternion tmpLightPosition = new Quaternion();
|
||||
ColorRGBA tmpLightColor = new ColorRGBA();
|
||||
|
||||
protected void renderMultipassLighting(Shader shader, Geometry g, Renderer r) {
|
||||
LightList lightList = g.getWorldLightList();
|
||||
@ -729,6 +727,11 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
|
||||
isSecondLight = false;
|
||||
}
|
||||
|
||||
TempVars vars = TempVars.get();
|
||||
Quaternion tmpLightDirection = vars.quat1;
|
||||
Quaternion tmpLightPosition = vars.quat2;
|
||||
ColorRGBA tmpLightColor = vars.color;
|
||||
|
||||
ColorRGBA color = l.getColor();
|
||||
tmpLightColor.set(color);
|
||||
tmpLightColor.a = l.getType().getId();
|
||||
@ -767,7 +770,7 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
|
||||
default:
|
||||
throw new UnsupportedOperationException("Unknown type of light: " + l.getType());
|
||||
}
|
||||
|
||||
vars.release();
|
||||
r.setShader(shader);
|
||||
r.renderMesh(g.getMesh(), g.getLodLevel(), 1);
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
package com.jme3.util;
|
||||
|
||||
import com.jme3.collision.bih.BIHNode.BIHStackData;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.Eigen3f;
|
||||
import com.jme3.math.Matrix4f;
|
||||
import com.jme3.math.Matrix3f;
|
||||
@ -160,6 +161,11 @@ public class TempVars {
|
||||
* Fetching triangle from mesh
|
||||
*/
|
||||
public final Triangle triangle = new Triangle();
|
||||
|
||||
/**
|
||||
* Color
|
||||
*/
|
||||
public final ColorRGBA color = new ColorRGBA();
|
||||
/**
|
||||
* General vectors.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user