use of net.coderbot.iris.mixin.LevelRendererAccessor in project Iris by IrisShaders.
the class ShadowRenderer method renderEntities.
private void renderEntities(LevelRendererAccessor levelRenderer, Frustum frustum, MultiBufferSource.BufferSource bufferSource, PoseStack modelView, double cameraX, double cameraY, double cameraZ, float tickDelta) {
EntityRenderDispatcher dispatcher = levelRenderer.getEntityRenderDispatcher();
int shadowEntities = 0;
profiler.push("cull");
List<Entity> renderedEntities = new ArrayList<>(32);
// TODO: I'm sure that this can be improved / optimized.
for (Entity entity : getLevel().entitiesForRendering()) {
if (!dispatcher.shouldRender(entity, frustum, cameraX, cameraY, cameraZ) || entity.isSpectator()) {
continue;
}
renderedEntities.add(entity);
}
profiler.popPush("sort");
// Sort the entities by type first in order to allow vanilla's entity batching system to work better.
renderedEntities.sort(Comparator.comparingInt(entity -> entity.getType().hashCode()));
profiler.popPush("build geometry");
for (Entity entity : renderedEntities) {
levelRenderer.invokeRenderEntity(entity, cameraX, cameraY, cameraZ, tickDelta, modelView, bufferSource);
shadowEntities++;
}
renderedShadowEntities = shadowEntities;
}
Aggregations