From fe62302d254c08d4a8d52076d87d49cbc8c822bb Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Tue, 9 Nov 2021 14:59:31 -0800 Subject: [PATCH] Chipping away at light --- .../jozufozu/flywheel/backend/material/MaterialGroupImpl.java | 2 -- src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java index 504b3fcd2..0952c9c21 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java +++ b/src/main/java/com/jozufozu/flywheel/backend/material/MaterialGroupImpl.java @@ -46,8 +46,6 @@ public class MaterialGroupImpl

implements MaterialGroup public void render(Matrix4f viewProjection, double camX, double camY, double camZ) { for (MaterialRenderer

renderer : renderers) { renderer.render(viewProjection, camX, camY, camZ); - - GlError.pollAndThrow(renderer.material.spec.name::toString); } } diff --git a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java index 48ee19f44..620a9428e 100644 --- a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java +++ b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java @@ -36,6 +36,7 @@ public class GPULightVolume extends LightVolume { private final GlTexture glTexture; private final RGPixelFormat pixelFormat; + private final GlTextureUnit textureUnit = GlTextureUnit.T4; protected boolean bufferDirty; public GPULightVolume(ImmutableBox sampleVolume) { @@ -70,7 +71,7 @@ public class GPULightVolume extends LightVolume { // just in case something goes wrong, or we accidentally call this before this volume is properly disposed of. if (lightData == null) return; - GlTextureUnit.T4.makeActive(); + textureUnit.makeActive(); glTexture.bind(); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);