Fix FogUniforms

This commit is contained in:
PepperCode1 2024-04-11 12:19:18 -07:00
parent 2365687950
commit 4cb2cabec8
4 changed files with 11 additions and 11 deletions

View File

@ -12,12 +12,12 @@ public final class FogUniforms extends UniformWriter {
var color = RenderSystem.getShaderFogColor();
ptr = writeFloat(ptr, color[0]);
ptr = writeFloat(ptr + 4, color[1]);
ptr = writeFloat(ptr + 8, color[2]);
ptr = writeFloat(ptr + 12, color[3]);
ptr = writeFloat(ptr + 16, RenderSystem.getShaderFogStart());
ptr = writeFloat(ptr + 20, RenderSystem.getShaderFogEnd());
ptr = writeInt(ptr + 24, RenderSystem.getShaderFogShape()
ptr = writeFloat(ptr, color[1]);
ptr = writeFloat(ptr, color[2]);
ptr = writeFloat(ptr, color[3]);
ptr = writeFloat(ptr, RenderSystem.getShaderFogStart());
ptr = writeFloat(ptr, RenderSystem.getShaderFogEnd());
ptr = writeInt(ptr, RenderSystem.getShaderFogShape()
.getIndex());
BUFFER.markDirty();

View File

@ -47,7 +47,7 @@ class UniformWriter {
}
static long writeMat4(long ptr, Matrix4f mat) {
MatrixMath.writeUnsafe(mat, ptr);
MatrixMath.writeUnsafe(ptr, mat);
return ptr + 64;
}

View File

@ -28,8 +28,8 @@ public final class InstanceTypes {
MemoryUtil.memPutShort(ptr + 6, (short) (instance.overlay >> 16 & 0xFFFF));
MemoryUtil.memPutShort(ptr + 8, (short) (instance.packedLight & 0xFFFF));
MemoryUtil.memPutShort(ptr + 10, (short) (instance.packedLight >> 16 & 0xFFFF));
MatrixMath.writeUnsafe(instance.model, ptr + 12);
MatrixMath.writeUnsafe(instance.normal, ptr + 76);
MatrixMath.writeUnsafe(ptr + 12, instance.model);
MatrixMath.writeUnsafe(ptr + 76, instance.normal);
})
.vertexShader(Flywheel.rl("instance/transformed.vert"))
.cullShader(Flywheel.rl("instance/cull/transformed.glsl"))

View File

@ -50,7 +50,7 @@ public final class MatrixMath {
return fma(matrix.m02(), x, fma(matrix.m12(), y, matrix.m22() * z));
}
public static void writeUnsafe(Matrix4f matrix, long ptr) {
public static void writeUnsafe(long ptr, Matrix4f matrix) {
MemoryUtil.memPutFloat(ptr, matrix.m00());
MemoryUtil.memPutFloat(ptr + 4, matrix.m01());
MemoryUtil.memPutFloat(ptr + 8, matrix.m02());
@ -69,7 +69,7 @@ public final class MatrixMath {
MemoryUtil.memPutFloat(ptr + 60, matrix.m33());
}
public static void writeUnsafe(Matrix3f matrix, long ptr) {
public static void writeUnsafe(long ptr, Matrix3f matrix) {
MemoryUtil.memPutFloat(ptr, matrix.m00());
MemoryUtil.memPutFloat(ptr + 4, matrix.m01());
MemoryUtil.memPutFloat(ptr + 8, matrix.m02());