📓
engine
  • Kakara Engine
  • Debugging
  • Getting Started
    • Getting the Engine
    • A New Game
    • Game Items
    • Components
    • Textures
    • Model Loading
    • The Camera
    • Player Input
      • Practical use of the Input
    • Lighting
    • User Interface
  • Scene System
    • Scene System
  • Render System
    • Extensible Render Pipeline
      • Standard Shader Format
      • Voxel Shader Format
      • Particle Shader Format
      • Lighting Shader Format
      • Custom Pipelines
  • Java Documentation
Powered by GitBook
On this page
  • Vertex Shader
  • Layouts
  • Uniforms
  • Fragment Shader Uniforms

Was this helpful?

  1. Render System
  2. Extensible Render Pipeline

Standard Shader Format

PreviousExtensible Render PipelineNextVoxel Shader Format

Last updated 4 years ago

Was this helpful?

The standard shader format is used with the standard render pipeline. The standard pipeline and shader are used by the 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;

ItemHandler
Lighting Format