Class EntityShader
- java.lang.Object
-
- de.coreengine.rendering.programs.Shader
-
- de.coreengine.rendering.programs.entity.EntityShader
-
- Direct Known Subclasses:
EntityShaderAdvanced
public class EntityShader extends Shader
Shader for the object renderer Default simple entity shader. Supports diffuse map and diffusecolor, tiling, reflectivity and shine damping, picking and simple glow color.- Author:
- Darius Dinger
-
-
Field Summary
Fields Modifier and Type Field Description protected intcamPosLocprotected intclipPlaneLocprotected intdiffuseColorLocprotected intdiffuseMapUnitprotected intglowColorLocprotected intpickingColorLocprotected intreflectivityLocprotected intshineDamperLocprotected inttilingLocprotected inttransMatLocprotected intvpMatLoc-
Fields inherited from class de.coreengine.rendering.programs.Shader
SHADERS_LOCATION
-
-
Constructor Summary
Constructors Constructor Description EntityShader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddShaders()Adding shaders to programprotected voidbindAttribs()Binding all vbo attributes to shader attribute ("in" variable)protected voidloadUniforms()Loading uniform locationsvoidprepareEntity(Entity entity)voidprepareMaterial(Material mat)Preparing shader for next materialvoidsetCamera(Camera cam, boolean rotateWithCam)voidsetClipPlane(float x, float y, float z, float w)Setting clip plane for next entity-
Methods inherited from class de.coreengine.rendering.programs.Shader
addShader, bindAttribute, bindTexture, bindTextureUnit, getUniformLocation, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniformArray1f, setUniformArray1i, setUniformArray2f, setUniformArray3f, start, stop
-
-
-
-
Field Detail
-
diffuseMapUnit
protected int diffuseMapUnit
-
vpMatLoc
protected int vpMatLoc
-
transMatLoc
protected int transMatLoc
-
tilingLoc
protected int tilingLoc
-
camPosLoc
protected int camPosLoc
-
reflectivityLoc
protected int reflectivityLoc
-
shineDamperLoc
protected int shineDamperLoc
-
diffuseColorLoc
protected int diffuseColorLoc
-
pickingColorLoc
protected int pickingColorLoc
-
clipPlaneLoc
protected int clipPlaneLoc
-
glowColorLoc
protected int glowColorLoc
-
-
Method Detail
-
addShaders
protected void addShaders()
Description copied from class:ShaderAdding shaders to program- Specified by:
addShadersin classShader
-
bindAttribs
protected void bindAttribs()
Description copied from class:ShaderBinding all vbo attributes to shader attribute ("in" variable)- Specified by:
bindAttribsin classShader
-
loadUniforms
protected void loadUniforms()
Description copied from class:ShaderLoading uniform locations- Specified by:
loadUniformsin classShader
-
setClipPlane
public void setClipPlane(float x, float y, float z, float w)Setting clip plane for next entity- Parameters:
x- X value of the plane normaly- Y value of the plane normalz- Z value of the plane normalw- Distance of the plane normal
-
setCamera
public void setCamera(Camera cam, boolean rotateWithCam)
- Parameters:
cam- Camera to render next models fromrotateWithCam- Should the entity rotate and move with the camera
-
prepareEntity
public void prepareEntity(Entity entity)
-
prepareMaterial
public void prepareMaterial(Material mat)
Preparing shader for next material- Parameters:
mat- Material to prepare
-
-