Search in sources :

Example 1 with IVertexOperation

use of codechicken.lib.render.CCRenderState.IVertexOperation in project LogisticsPipes by RS485.

the class Model3D method render.

@Override
public void render(I3DOperation... i3dOperations) {
    List<IVertexOperation> list = new ArrayList<>();
    for (I3DOperation op : i3dOperations) {
        list.add((IVertexOperation) op.getOriginal());
    }
    model.render(list.toArray(new IVertexOperation[list.size()]));
}
Also used : IVertexOperation(codechicken.lib.render.CCRenderState.IVertexOperation) ArrayList(java.util.ArrayList) I3DOperation(logisticspipes.proxy.object3d.interfaces.I3DOperation)

Example 2 with IVertexOperation

use of codechicken.lib.render.CCRenderState.IVertexOperation in project CodeChickenLib by Chicken-Bones.

the class CCRenderPipeline method rebuild.

public void rebuild() {
    if (ops.isEmpty() || CCRenderState.model == null)
        return;
    //ensure enough nodes for all ops
    while (nodes.size() < CCRenderState.operationCount()) nodes.add(new PipelineNode());
    unbuild();
    if (CCRenderState.useNormals)
        addAttribute(CCRenderState.normalAttrib);
    if (CCRenderState.useColour)
        addAttribute(CCRenderState.colourAttrib);
    if (CCRenderState.computeLighting)
        addAttribute(CCRenderState.lightingAttrib);
    for (int i = 0; i < ops.size(); i++) {
        IVertexOperation op = ops.get(i);
        loading = nodes.get(op.operationID());
        boolean loaded = op.load();
        if (loaded)
            loading.op = op;
        if (op instanceof VertexAttribute)
            if (loaded)
                attribs.add((VertexAttribute) op);
            else
                ((VertexAttribute) op).active = false;
    }
    for (int i = 0; i < nodes.size(); i++) nodes.get(i).add();
}
Also used : IVertexOperation(codechicken.lib.render.CCRenderState.IVertexOperation) VertexAttribute(codechicken.lib.render.CCRenderState.VertexAttribute)

Aggregations

IVertexOperation (codechicken.lib.render.CCRenderState.IVertexOperation)2 VertexAttribute (codechicken.lib.render.CCRenderState.VertexAttribute)1 ArrayList (java.util.ArrayList)1 I3DOperation (logisticspipes.proxy.object3d.interfaces.I3DOperation)1