📓
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
  • Initialization
  • Rendering
  • Rendering the Depth Map

Was this helpful?

  1. Render System
  2. Extensible Render Pipeline

Custom Pipelines

PreviousLighting Shader Format

Last updated 4 years ago

Was this helpful?

Custom pipelines are used to control how objects are passed to the GPU for rendering. To make a custom pipeline you need to make a class that implements the interface.

public class CustomPipeline implements RenderPipeline {

    @Override
    public void init(ShaderManager manager, Transformation transformation, FrustumCullingFilter frustumFilter, ShadowMap shadowMap) {

    }

    @Override
    public void render(Scene scene) {

    }

    @Override
    public void renderDepthMap(Scene scene, Shader depthMap, Matrix4f lightViewMatrix) {

    }

}

Initialization

@Override
public void init(ShaderManager manager, Transformation transformation, FrustumCullingFilter frustumFilter, ShadowMap shadowMap) {

}

The init method is ran when the pipeline is initalized. Constant information is passed here and is expected to be stored in fields. Argument Overview: ShaderManager - The shader manager is used to obtain the shader from. Transformation - This class contains the transformation methods. FrustumCullingFilter - This class is to test for frustum culling. ShadowMap - This class is the map of shadows in the visible scene.

Rendering

@Override
public void render(Scene scene) {

}

The render method is ran every time a frame needs to be rendered. You will need to bind your shaders and set the required shader uniforms here. (Don't forget to unbind your shader at the end). Argument Overview: Scene - The current scene.

Rendering the Depth Map

@Override
public void renderDepthMap(Scene scene, Shader depthMap, Matrix4f lightViewMatrix) {

}

The renderDepthMap method is ran every frame before the normal render method. This method is used used for shadow calculations. If you do not want your pipeline to do anything with the default lighting system, than this method can be left empty. Argument Overview: Scene - The current scene. Shader - The depthMap shader. Matrix4f The light view matrix.

RenderPipeline