Теперь 3д текстура обновляется корректно

This commit is contained in:
2026-07-30 20:40:41 +04:00
parent 15f484a39b
commit 5e3f985025
3 changed files with 12 additions and 36 deletions
@@ -163,15 +163,6 @@ public final class FogChunkStreamer {
FogWorldVolume.CHUNKS_Z
);
System.out.println(
worldChunkX + " " +
worldChunkZ + " -> " +
physicalChunkX + " " +
physicalChunkZ
);
FogWorldVolume.uploadChunk(
physicalChunkX,
physicalChunkZ,
@@ -114,13 +114,6 @@ public final class FogSystem {
originChunkX = newOriginChunkX;
originChunkZ = newOriginChunkZ;
FogChunkStreamer.update(
oldOriginChunkX,
oldOriginChunkZ,
originChunkX,
originChunkZ
);
ringChunkOffsetX =
Math.floorMod(originChunkX,
FogWorldVolume.CHUNKS_X);
@@ -128,6 +121,13 @@ public final class FogSystem {
ringChunkOffsetZ =
Math.floorMod(originChunkZ,
FogWorldVolume.CHUNKS_Z);
FogChunkStreamer.update(
oldOriginChunkX,
oldOriginChunkZ,
originChunkX,
originChunkZ
);
}
public static int originChunkX() {
@@ -160,22 +160,13 @@ public final class FogWorldVolume {
int textureChunkZ,
FloatBuffer data
) {
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL12.GL_TEXTURE_3D, texture);
// Сбрасываем ВСЕ pixel store параметры, которые мог оставить Minecraft
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
System.out.println(
data.remaining()
);
int error = GL11.glGetError();
if (error != GL11.GL_NO_ERROR) {
System.out.println("GL BEFORE = " + error);
}
GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
GL30.glTexSubImage3D(
GL12.GL_TEXTURE_3D,
@@ -194,12 +185,6 @@ public final class FogWorldVolume {
data
);
error = GL11.glGetError();
if (error != GL11.GL_NO_ERROR) {
System.out.println("GL AFTER = " + error);
}
GL11.glBindTexture(GL12.GL_TEXTURE_3D, 0);
}