|
|
@ -60,6 +60,7 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
|
|
|
|
|
|
|
|
protected VarType type; |
|
|
|
protected VarType type; |
|
|
|
protected String name; |
|
|
|
protected String name; |
|
|
|
|
|
|
|
protected String prefixedName; |
|
|
|
protected Object value; |
|
|
|
protected Object value; |
|
|
|
protected FixedFuncBinding ffBinding; |
|
|
|
protected FixedFuncBinding ffBinding; |
|
|
|
|
|
|
|
|
|
|
@ -69,6 +70,7 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
public MatParam(VarType type, String name, Object value, FixedFuncBinding ffBinding){ |
|
|
|
public MatParam(VarType type, String name, Object value, FixedFuncBinding ffBinding){ |
|
|
|
this.type = type; |
|
|
|
this.type = type; |
|
|
|
this.name = name; |
|
|
|
this.name = name; |
|
|
|
|
|
|
|
this.prefixedName = "m_" + name; |
|
|
|
this.value = value; |
|
|
|
this.value = value; |
|
|
|
this.ffBinding = ffBinding; |
|
|
|
this.ffBinding = ffBinding; |
|
|
|
} |
|
|
|
} |
|
|
@ -105,6 +107,15 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
return name; |
|
|
|
return name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the name with "m_" prefixed to it. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return the name with "m_" prefixed to it |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public String getPrefixedName() { |
|
|
|
|
|
|
|
return prefixedName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Used internally |
|
|
|
* Used internally |
|
|
|
* @param name |
|
|
|
* @param name |
|
|
@ -140,7 +151,7 @@ public class MatParam implements Savable, Cloneable { |
|
|
|
void apply(Renderer r, Technique technique) { |
|
|
|
void apply(Renderer r, Technique technique) { |
|
|
|
TechniqueDef techDef = technique.getDef(); |
|
|
|
TechniqueDef techDef = technique.getDef(); |
|
|
|
if (techDef.isUsingShaders()) { |
|
|
|
if (techDef.isUsingShaders()) { |
|
|
|
technique.updateUniformParam(getName(), getVarType(), getValue(), true); |
|
|
|
technique.updateUniformParam(getPrefixedName(), getVarType(), getValue(), true); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ffBinding != null && r instanceof GL1Renderer){ |
|
|
|
if (ffBinding != null && r instanceof GL1Renderer){ |
|
|
|
((GL1Renderer)r).setFixedFuncBinding(ffBinding, getValue()); |
|
|
|
((GL1Renderer)r).setFixedFuncBinding(ffBinding, getValue()); |
|
|
|