Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions jme3-core/src/main/java/com/jme3/material/MaterialDef.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.jme3.texture.Texture;

/**
* Describes a J3MD (Material definition).
Expand Down Expand Up @@ -129,10 +130,11 @@ public void addMaterialParam(VarType type, String name, Object value) {
* @param type Type of the parameter
* @param name Name of the parameter
* @param colorSpace the color space of the texture required by this texture param
* @param value Default value of the parameter
* @see ColorSpace
*/
public void addMaterialParamTexture(VarType type, String name, ColorSpace colorSpace) {
matParams.put(name, new MatParamTexture(type, name, null, colorSpace));
public void addMaterialParamTexture(VarType type, String name, ColorSpace colorSpace,Texture value) {
matParams.put(name, new MatParamTexture(type, name, value, colorSpace));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ private Texture parseTextureType(final VarType type, final String value) {
for (final TextureOptionValue textureOptionValue : textureOptionValues) {
textureOptionValue.applyToTexture(texture);
}
}

}
return texture;
}

Expand Down Expand Up @@ -402,7 +401,7 @@ private void readParam(String statement) throws IOException{
defaultValObj = readValue(type, defaultVal);
}
if(type.isTextureType()){
materialDef.addMaterialParamTexture(type, name, colorSpace);
materialDef.addMaterialParamTexture(type, name, colorSpace,(Texture)defaultValObj);
}else{
materialDef.addMaterialParam(type, name, defaultValObj);
}
Expand Down