Chipping away at light

This commit is contained in:
Jozufozu 2021-11-09 14:59:31 -08:00
parent 1d4bb972b9
commit fe62302d25
2 changed files with 2 additions and 3 deletions

View file

@ -46,8 +46,6 @@ public class MaterialGroupImpl<P extends WorldProgram> implements MaterialGroup
public void render(Matrix4f viewProjection, double camX, double camY, double camZ) {
for (MaterialRenderer<P> renderer : renderers) {
renderer.render(viewProjection, camX, camY, camZ);
GlError.pollAndThrow(renderer.material.spec.name::toString);
}
}

View file

@ -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);