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()]));
}
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();
}
Aggregations