MaterialDebugAppState now properly applies renderStates
Added a set method in RenderState
This commit is contained in:
parent
d921847f35
commit
d33853d393
@ -1312,6 +1312,44 @@ public class RenderState implements Cloneable, Savable {
|
|||||||
state.cachedHashCode = -1;
|
state.cachedHashCode = -1;
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
public void set(RenderState state) {
|
||||||
|
pointSprite = state.pointSprite;
|
||||||
|
wireframe = state.wireframe;
|
||||||
|
cullMode = state.cullMode;
|
||||||
|
depthWrite = state.depthWrite;
|
||||||
|
depthTest = state.depthTest;
|
||||||
|
colorWrite = state.colorWrite;
|
||||||
|
blendMode = state.blendMode;
|
||||||
|
alphaTest = state.alphaTest;
|
||||||
|
alphaFallOff = state.alphaFallOff;
|
||||||
|
offsetEnabled = state.offsetEnabled;
|
||||||
|
offsetFactor = state.offsetFactor;
|
||||||
|
offsetUnits = state.offsetUnits;
|
||||||
|
stencilTest = state.stencilTest;
|
||||||
|
frontStencilStencilFailOperation = state.frontStencilStencilFailOperation;
|
||||||
|
frontStencilDepthFailOperation = state.frontStencilDepthFailOperation;
|
||||||
|
frontStencilDepthPassOperation = state.frontStencilDepthPassOperation;
|
||||||
|
backStencilStencilFailOperation = state.backStencilStencilFailOperation;
|
||||||
|
backStencilDepthFailOperation = state.backStencilDepthFailOperation;
|
||||||
|
backStencilDepthPassOperation = state.backStencilDepthPassOperation;
|
||||||
|
frontStencilFunction = state.frontStencilFunction;
|
||||||
|
backStencilFunction = state.backStencilFunction;
|
||||||
|
depthFunc = state.depthFunc;
|
||||||
|
alphaFunc = state.alphaFunc;
|
||||||
|
|
||||||
|
applyPointSprite = true;
|
||||||
|
applyWireFrame = true;
|
||||||
|
applyCullMode = true;
|
||||||
|
applyDepthWrite = true;
|
||||||
|
applyDepthTest = true;
|
||||||
|
applyColorWrite = true;
|
||||||
|
applyBlendMode = true;
|
||||||
|
applyAlphaTest = true;
|
||||||
|
applyAlphaFallOff = true;
|
||||||
|
applyPolyOffset = true;
|
||||||
|
applyDepthFunc = true;
|
||||||
|
applyAlphaFunc = false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -43,6 +43,7 @@ import com.jme3.input.controls.ActionListener;
|
|||||||
import com.jme3.input.controls.Trigger;
|
import com.jme3.input.controls.Trigger;
|
||||||
import com.jme3.material.MatParam;
|
import com.jme3.material.MatParam;
|
||||||
import com.jme3.material.Material;
|
import com.jme3.material.Material;
|
||||||
|
import com.jme3.material.RenderState;
|
||||||
import com.jme3.post.Filter;
|
import com.jme3.post.Filter;
|
||||||
import com.jme3.post.Filter.Pass;
|
import com.jme3.post.Filter.Pass;
|
||||||
import com.jme3.renderer.RenderManager;
|
import com.jme3.renderer.RenderManager;
|
||||||
@ -206,6 +207,8 @@ public class MaterialDebugAppState extends AbstractAppState {
|
|||||||
dummy.setParam(matParam.getName(), matParam.getVarType(), matParam.getValue());
|
dummy.setParam(matParam.getName(), matParam.getVarType(), matParam.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dummy.getAdditionalRenderState().set(mat.getAdditionalRenderState());
|
||||||
|
|
||||||
//creating a dummy geom and assigning the dummy material to it
|
//creating a dummy geom and assigning the dummy material to it
|
||||||
Geometry dummyGeom = new Geometry("dummyGeom", new Box(1f, 1f, 1f));
|
Geometry dummyGeom = new Geometry("dummyGeom", new Box(1f, 1f, 1f));
|
||||||
dummyGeom.setMaterial(dummy);
|
dummyGeom.setMaterial(dummy);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user