Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/core/com/jme3/material/Material.java
- ===================================================================
- --- src/core/com/jme3/material/Material.java (revision 9461)
- +++ src/core/com/jme3/material/Material.java (working copy)
- @@ -467,15 +467,16 @@
- name = checkSetParam(type, name);
- MatParam val = getParam(name);
- - if (technique != null) {
- - technique.notifySetParam(name, type, value);
- - }
- if (val == null) {
- MatParam paramDef = def.getMaterialParam(name);
- - paramValues.put(name, new MatParam(type, name, value, paramDef.getFixedFuncBinding()));
- + val = new MatParam(type, name, value, paramDef.getFixedFuncBinding());
- + paramValues.put(name, val);
- } else {
- val.setValue(value);
- }
- + if (technique != null) {
- + technique.notifySetParam(val);
- + }
- }
- /**
- @@ -550,13 +551,14 @@
- name = checkSetParam(type, name);
- MatParamTexture val = getTextureParam(name);
- if (val == null) {
- - paramValues.put(name, new MatParamTexture(type, name, value, nextTexUnit++));
- + val = new MatParamTexture(type, name, value, nextTexUnit++);
- + paramValues.put(name, val);
- } else {
- val.setTextureValue(value);
- }
- if (technique != null) {
- - technique.notifySetParam(name, type, nextTexUnit - 1);
- + technique.notifySetParam(val);
- }
- // need to recompute sort ID
- @@ -996,7 +998,7 @@
- continue;
- }
- - technique.updateUniformParam(param.getName(),
- + technique.updateUniformParam(param.getPrefixedName(),
- param.getVarType(),
- param.getValue(), true);
- }
- Index: src/core/com/jme3/material/Technique.java
- ===================================================================
- --- src/core/com/jme3/material/Technique.java (revision 9461)
- +++ src/core/com/jme3/material/Technique.java (working copy)
- @@ -111,13 +111,13 @@
- /**
- * Called by the material to tell the technique a parameter was modified
- */
- - void notifySetParam(String paramName, VarType type, Object value) {
- - String defineName = def.getShaderParamDefine(paramName);
- + void notifySetParam(MatParam param) {
- + String defineName = def.getShaderParamDefine(param.getName());
- if (defineName != null) {
- - needReload = defines.set(defineName, type, value);
- + needReload = defines.set(defineName, param.getVarType(), param.getValue());
- }
- if (shader != null) {
- - updateUniformParam(paramName, type, value);
- + updateUniformParam(param.getPrefixedName(), param.getVarType(), param.getValue());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement