Custom Pipeline Stages - ZackWilde27/Z3dPy GitHub Wiki

I'll be explaining the various stages of the render pipeline:

def MyRenderPipeline(mesh):

    transformed = z3dpy.TransformTris(zp.MeshGetTris(mesh), zp.MeshGetPos(mesh), target, up)

    viewed = z3dpy.ViewTris(translated)

    projected = z3dpy.ProjectTris(viewed)

    return projected

Transform moves and rotates triangles to their world position, given the position, look target, and up direction.

View will move and distort triangles so that they appear in front of the camera, like they would if the camera was the one moving.

Project takes the View triangles, and flattens them to produce a 2D version for the screen.

You could sacrifice or modify these stages for the sake of speed, as Transform only applies to movable things.

Some tasks are best suited for specific stages of the pipeline. For example, depth calculations should be done after View, and before Project so we can simply test the Z value.