use of io.xol.chunkstories.api.events.rendering.WorldRenderingDecalsEvent in project chunkstories by Hugobros3.
the class DecalsRendererImplementation method renderDecals.
public void renderDecals(RenderingInterface renderingInterface) {
for (DecalType decalType : decalsTypes.values()) {
Texture2D diffuseTexture = decalType.getTexture();
diffuseTexture.setTextureWrapping(false);
diffuseTexture.setLinearFiltering(false);
renderingInterface.bindAlbedoTexture(diffuseTexture);
if (!decalType.verticesObject.isDataPresent())
continue;
renderingInterface.bindAttribute("vertexIn", decalType.verticesObject.asAttributeSource(VertexFormat.FLOAT, 3, 4 * (3 + 2), 0));
renderingInterface.bindAttribute("texCoordIn", decalType.verticesObject.asAttributeSource(VertexFormat.FLOAT, 2, 4 * (3 + 2), 4 * 3));
renderingInterface.draw(Primitive.TRIANGLE, 0, decalType.kount);
}
WorldRenderingDecalsEvent event = new WorldRenderingDecalsEvent(world, worldRenderer, renderingInterface, this);
world.getGameContext().getPluginManager().fireEvent(event);
}
Aggregations