Теперь 3д текстура обновляется корректно
This commit is contained in:
@@ -163,15 +163,6 @@ public final class FogChunkStreamer {
|
|||||||
FogWorldVolume.CHUNKS_Z
|
FogWorldVolume.CHUNKS_Z
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
System.out.println(
|
|
||||||
worldChunkX + " " +
|
|
||||||
worldChunkZ + " -> " +
|
|
||||||
physicalChunkX + " " +
|
|
||||||
physicalChunkZ
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
FogWorldVolume.uploadChunk(
|
FogWorldVolume.uploadChunk(
|
||||||
physicalChunkX,
|
physicalChunkX,
|
||||||
physicalChunkZ,
|
physicalChunkZ,
|
||||||
|
|||||||
@@ -114,13 +114,6 @@ public final class FogSystem {
|
|||||||
originChunkX = newOriginChunkX;
|
originChunkX = newOriginChunkX;
|
||||||
originChunkZ = newOriginChunkZ;
|
originChunkZ = newOriginChunkZ;
|
||||||
|
|
||||||
FogChunkStreamer.update(
|
|
||||||
oldOriginChunkX,
|
|
||||||
oldOriginChunkZ,
|
|
||||||
originChunkX,
|
|
||||||
originChunkZ
|
|
||||||
);
|
|
||||||
|
|
||||||
ringChunkOffsetX =
|
ringChunkOffsetX =
|
||||||
Math.floorMod(originChunkX,
|
Math.floorMod(originChunkX,
|
||||||
FogWorldVolume.CHUNKS_X);
|
FogWorldVolume.CHUNKS_X);
|
||||||
@@ -128,6 +121,13 @@ public final class FogSystem {
|
|||||||
ringChunkOffsetZ =
|
ringChunkOffsetZ =
|
||||||
Math.floorMod(originChunkZ,
|
Math.floorMod(originChunkZ,
|
||||||
FogWorldVolume.CHUNKS_Z);
|
FogWorldVolume.CHUNKS_Z);
|
||||||
|
|
||||||
|
FogChunkStreamer.update(
|
||||||
|
oldOriginChunkX,
|
||||||
|
oldOriginChunkZ,
|
||||||
|
originChunkX,
|
||||||
|
originChunkZ
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int originChunkX() {
|
public static int originChunkX() {
|
||||||
|
|||||||
@@ -160,22 +160,13 @@ public final class FogWorldVolume {
|
|||||||
int textureChunkZ,
|
int textureChunkZ,
|
||||||
FloatBuffer data
|
FloatBuffer data
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
GL13.glActiveTexture(GL13.GL_TEXTURE0);
|
|
||||||
GL11.glBindTexture(GL12.GL_TEXTURE_3D, texture);
|
GL11.glBindTexture(GL12.GL_TEXTURE_3D, texture);
|
||||||
|
|
||||||
|
// Сбрасываем ВСЕ pixel store параметры, которые мог оставить Minecraft
|
||||||
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
|
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0);
|
||||||
System.out.println(
|
GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0);
|
||||||
data.remaining()
|
GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0);
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
int error = GL11.glGetError();
|
|
||||||
|
|
||||||
if (error != GL11.GL_NO_ERROR) {
|
|
||||||
System.out.println("GL BEFORE = " + error);
|
|
||||||
}
|
|
||||||
|
|
||||||
GL30.glTexSubImage3D(
|
GL30.glTexSubImage3D(
|
||||||
GL12.GL_TEXTURE_3D,
|
GL12.GL_TEXTURE_3D,
|
||||||
@@ -194,12 +185,6 @@ public final class FogWorldVolume {
|
|||||||
data
|
data
|
||||||
);
|
);
|
||||||
|
|
||||||
error = GL11.glGetError();
|
|
||||||
|
|
||||||
if (error != GL11.GL_NO_ERROR) {
|
|
||||||
System.out.println("GL AFTER = " + error);
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glBindTexture(GL12.GL_TEXTURE_3D, 0);
|
GL11.glBindTexture(GL12.GL_TEXTURE_3D, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user