Knowledge Base » How to create a pipeline

The Untold Engine allows you to create a pipeline with the respective shader. The snippet below shows how you can create a pipeline:

//create a new pipeline

U4DEngine::U4DModelPipeline *nonvisiblePipeline=new U4DEngine::U4DModelPipeline("nonvisible");

//Set the shaders used by the pipeline
nonvisiblePipeline->initPipeline("vertexNonVisibleShader", "fragmentNonVisibleShader");

Once you have the pipeline created, you can apply to an object, as shown below:

//Create an object that will represent the map of the scene. This will be used for collision detection with walls by using raycasts
U4DEngine::U4DGameObject *mapLevel=new U4DEngine::U4DGameObject();

//load the model information
if(mapLevel->loadModel("map")){

    //since we don't want to render the map, we just want to use the geometric information, we set the pipeline declared previously. The shader will make the object invisible.
    mapLevel->setPipeline("nonvisible");

    //enable the mesh manager for raycasting collision detection
    mapLevel->enableMeshManager(2);

    //load the rendering information to the GPU
    mapLevel->loadRenderingInformation();

    //add the model to the scenegraph
    addChild(mapLevel);

}