Search in sources :

Example 6 with ClientChunk

use of io.xol.chunkstories.world.chunk.ClientChunk in project chunkstories by Hugobros3.

the class ChunkMeshesRenderer method renderChunksExtras.

@Override
public void renderChunksExtras(RenderingInterface renderingInterface) {
    RenderPass currentPass = renderingInterface.getCurrentPass();
    List<ChunkRenderCommand> culledChunks = currentPass.name.startsWith("shadow") ? culledChunksShadow : culledChunksNormal;
    for (ChunkRenderCommand command : culledChunks) {
        ChunkRenderDataHolder holder = ((ClientChunk) command.chunk).getChunkRenderData();
        holder.renderExtras(renderingInterface);
    }
}
Also used : RenderPass(io.xol.chunkstories.api.rendering.pass.RenderPass) ClientChunk(io.xol.chunkstories.world.chunk.ClientChunk)

Example 7 with ClientChunk

use of io.xol.chunkstories.world.chunk.ClientChunk in project chunkstories by Hugobros3.

the class ChunkRenderDataHolder method requestMeshUpdate.

@Override
public Fence requestMeshUpdate() {
    unbakedUpdates.incrementAndGet();
    // System.out.println("who did dis");
    // Thread.dumpStack();
    Task fence;
    taskLock.lock();
    if (task == null || task.isDone() || task.isCancelled()) {
        task = new TaskBakeChunk((ClientChunk) chunk);
        chunk.getWorld().getGameContext().tasks().scheduleTask(task);
    }
    fence = task;
    taskLock.unlock();
    return fence;
}
Also used : Task(io.xol.chunkstories.api.workers.Task) ClientChunk(io.xol.chunkstories.world.chunk.ClientChunk)

Aggregations

ClientChunk (io.xol.chunkstories.world.chunk.ClientChunk)7 ChunkRenderable (io.xol.chunkstories.api.rendering.world.chunk.ChunkRenderable)2 Chunk (io.xol.chunkstories.api.world.chunk.Chunk)2 ChunkRenderDataHolder (io.xol.chunkstories.renderer.chunks.ChunkRenderDataHolder)2 Location (io.xol.chunkstories.api.Location)1 Entity (io.xol.chunkstories.api.entity.Entity)1 EntityLiving (io.xol.chunkstories.api.entity.EntityLiving)1 EntityControllable (io.xol.chunkstories.api.entity.interfaces.EntityControllable)1 CameraInterface (io.xol.chunkstories.api.rendering.CameraInterface)1 RenderPass (io.xol.chunkstories.api.rendering.pass.RenderPass)1 Font (io.xol.chunkstories.api.rendering.text.FontRenderer.Font)1 VoxelSide (io.xol.chunkstories.api.voxel.VoxelSide)1 Task (io.xol.chunkstories.api.workers.Task)1 CellData (io.xol.chunkstories.api.world.cell.CellData)1 ChunksIterator (io.xol.chunkstories.api.world.chunk.ChunksIterator)1 ClientParticlesRenderer (io.xol.chunkstories.renderer.particles.ClientParticlesRenderer)1 Vector3f (org.joml.Vector3f)1 Vector3fc (org.joml.Vector3fc)1 Vector4f (org.joml.Vector4f)1