|
|
@ -788,6 +788,7 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
private void updateShaderMaterialParameters(Renderer renderer, Shader shader, List<MatParamOverride> overrides) { |
|
|
|
private void updateShaderMaterialParameters(Renderer renderer, Shader shader, List<MatParamOverride> overrides) { |
|
|
|
int unit = 0; |
|
|
|
int unit = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (overrides != null) { |
|
|
|
for (MatParamOverride override : overrides) { |
|
|
|
for (MatParamOverride override : overrides) { |
|
|
|
VarType type = override.getVarType(); |
|
|
|
VarType type = override.getVarType(); |
|
|
|
|
|
|
|
|
|
|
@ -797,6 +798,7 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Uniform uniform = shader.getUniform(override.getPrefixedName()); |
|
|
|
Uniform uniform = shader.getUniform(override.getPrefixedName()); |
|
|
|
|
|
|
|
if (override.getValue() != null) { |
|
|
|
if (type.isTextureType()) { |
|
|
|
if (type.isTextureType()) { |
|
|
|
renderer.setTexture(unit, (Texture) override.getValue()); |
|
|
|
renderer.setTexture(unit, (Texture) override.getValue()); |
|
|
|
uniform.setValue(VarType.Int, unit); |
|
|
|
uniform.setValue(VarType.Int, unit); |
|
|
@ -804,6 +806,10 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uniform.setValue(type, override.getValue()); |
|
|
|
uniform.setValue(type, override.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
uniform.clearValue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < paramValues.size(); i++) { |
|
|
|
for (int i = 0; i < paramValues.size(); i++) { |
|
|
|