Class 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 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
    • Constructor Detail

      • EntityShader

        public EntityShader()
    • Method Detail

      • addShaders

        protected void addShaders()
        Description copied from class: Shader
        Adding shaders to program
        Specified by:
        addShaders in class Shader
      • bindAttribs

        protected void bindAttribs()
        Description copied from class: Shader
        Binding all vbo attributes to shader attribute ("in" variable)
        Specified by:
        bindAttribs in class Shader
      • loadUniforms

        protected void loadUniforms()
        Description copied from class: Shader
        Loading uniform locations
        Specified by:
        loadUniforms in class Shader
      • 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 normal
        y - Y value of the plane normal
        z - Z value of the plane normal
        w - Distance of the plane normal
      • setCamera

        public void setCamera​(Camera cam,
                              boolean rotateWithCam)
        Parameters:
        cam - Camera to render next models from
        rotateWithCam - 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