|
|
@ -55,7 +55,7 @@ import com.jme3.texture.Texture2D; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
public class TechniqueDefMatParamOverrideTest { |
|
|
|
public class MaterialMatParamOverrideTest { |
|
|
|
|
|
|
|
|
|
|
|
private static final HashSet<String> IGNORED_UNIFORMS = new HashSet<String>( |
|
|
|
private static final HashSet<String> IGNORED_UNIFORMS = new HashSet<String>( |
|
|
|
Arrays.asList(new String[]{"m_ParallaxHeight", "m_Shininess"})); |
|
|
|
Arrays.asList(new String[]{"m_ParallaxHeight", "m_Shininess"})); |
|
|
@ -119,6 +119,27 @@ public class TechniqueDefMatParamOverrideTest { |
|
|
|
outUniforms(uniform("AlphaDiscardThreshold", VarType.Float, 2.79f)); |
|
|
|
outUniforms(uniform("AlphaDiscardThreshold", VarType.Float, 2.79f)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testMpoDisable() { |
|
|
|
|
|
|
|
material("Common/MatDefs/Light/Lighting.j3md"); |
|
|
|
|
|
|
|
inputMp(mpoFloat("AlphaDiscardThreshold", 3.12f)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MatParamOverride override = mpoFloat("AlphaDiscardThreshold", 2.79f); |
|
|
|
|
|
|
|
inputMpo(override); |
|
|
|
|
|
|
|
outDefines(def("DISCARD_ALPHA", VarType.Float, 2.79f)); |
|
|
|
|
|
|
|
outUniforms(uniform("AlphaDiscardThreshold", VarType.Float, 2.79f)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reset(); |
|
|
|
|
|
|
|
override.setEnabled(false); |
|
|
|
|
|
|
|
outDefines(def("DISCARD_ALPHA", VarType.Float, 3.12f)); |
|
|
|
|
|
|
|
outUniforms(uniform("AlphaDiscardThreshold", VarType.Float, 3.12f)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reset(); |
|
|
|
|
|
|
|
override.setEnabled(true); |
|
|
|
|
|
|
|
outDefines(def("DISCARD_ALPHA", VarType.Float, 2.79f)); |
|
|
|
|
|
|
|
outUniforms(uniform("AlphaDiscardThreshold", VarType.Float, 2.79f)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testIntMpoOnly() { |
|
|
|
public void testIntMpoOnly() { |
|
|
|
material("Common/MatDefs/Light/Lighting.j3md"); |
|
|
|
material("Common/MatDefs/Light/Lighting.j3md"); |
|
|
@ -349,13 +370,13 @@ public class TechniqueDefMatParamOverrideTest { |
|
|
|
private final NullRenderer renderer = new NullRenderer() { |
|
|
|
private final NullRenderer renderer = new NullRenderer() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setShader(Shader shader) { |
|
|
|
public void setShader(Shader shader) { |
|
|
|
TechniqueDefMatParamOverrideTest.this.usedShader = shader; |
|
|
|
MaterialMatParamOverrideTest.this.usedShader = shader; |
|
|
|
evaluated = true; |
|
|
|
evaluated = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setTexture(int unit, Texture texture) { |
|
|
|
public void setTexture(int unit, Texture texture) { |
|
|
|
TechniqueDefMatParamOverrideTest.this.usedTextures[unit] = texture; |
|
|
|
MaterialMatParamOverrideTest.this.usedTextures[unit] = texture; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
private final RenderManager renderManager = new RenderManager(renderer); |
|
|
|
private final RenderManager renderManager = new RenderManager(renderer); |