?? texturedshinydiffuseshader.java
字號:
package org.sunflow.core.shader;
import org.sunflow.SunflowAPI;
import org.sunflow.core.ParameterList;
import org.sunflow.core.ShadingState;
import org.sunflow.core.Texture;
import org.sunflow.core.TextureCache;
import org.sunflow.image.Color;
public class TexturedShinyDiffuseShader extends ShinyDiffuseShader {
private Texture tex;
public TexturedShinyDiffuseShader() {
tex = null;
}
public boolean update(ParameterList pl, SunflowAPI api) {
String filename = pl.getString("texture", null);
if (filename != null)
tex = TextureCache.getTexture(api.resolveTextureFilename(filename), false);
return tex != null && super.update(pl, api);
}
public Color getDiffuse(ShadingState state) {
return tex.getPixel(state.getUV().x, state.getUV().y);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -