Skip to content

Standard Format

Ryandw11 edited this page Jan 16, 2021 · 1 revision

The standard shader format is used with the standard render pipeline. The standard shader and pipeline is used by the ItemHandler system.

Note: This format is not finalized and could change in the future.

Vertex Shader

Layouts

layout (location=0) in vec3 position;
layout (location=1) in vec2 texCoord;
layout (location=2) in vec3 vertexNormal;
layout (location=5) in mat4 modelViewInstancedMatrix;
layout (location=9) in mat4 modelLightViewInstancedMatrix;
layout (location=14) in float selectedInstanced;

Uniforms

uniform mat4 orthoProjectionMatrix;
uniform int isInstanced;
uniform mat4 modelViewNonInstancedMatrix;
uniform mat4 modelLightViewNonInstancedMatrix;
uniform mat4 projectionMatrix;
uniform float selectedNonInstanced;

Fragment Shader Uniforms

  • material :: The material for the object.
struct Material
{
    vec4 ambient;
    vec4 diffuse;
    vec4 specular;
    int hasTexture;
    float reflectance;

    sampler2D overlayTextures[5];
    int numberOfOverlays;
};
uniform Material material;
  • texture_sampler :: The primary texture for the object.
uniform sampler2D texture_sampler;
Clone this wiki locally