mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 12:34:11 +01:00
Reset off offsets
- Fix frame uniforms reserving too much space - Fix level uniforms reserving too little space - Actually move flw_constantAmbientLight to level uniforms
This commit is contained in:
parent
04e66cad59
commit
2b39b13744
@ -8,21 +8,17 @@ import org.lwjgl.system.MemoryUtil;
|
|||||||
|
|
||||||
import com.jozufozu.flywheel.api.event.RenderContext;
|
import com.jozufozu.flywheel.api.event.RenderContext;
|
||||||
import com.jozufozu.flywheel.api.visualization.VisualizationManager;
|
import com.jozufozu.flywheel.api.visualization.VisualizationManager;
|
||||||
import com.jozufozu.flywheel.backend.mixin.GameRendererAccessor;
|
|
||||||
import com.jozufozu.flywheel.lib.math.MatrixMath;
|
import com.jozufozu.flywheel.lib.math.MatrixMath;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
|
||||||
|
|
||||||
import net.minecraft.client.Camera;
|
import net.minecraft.client.Camera;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Vec3i;
|
import net.minecraft.core.Vec3i;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
public class FrameUniforms implements UniformProvider {
|
public class FrameUniforms implements UniformProvider {
|
||||||
public static final int SIZE = 1188;
|
public static final int SIZE = 800;
|
||||||
public int debugMode;
|
public int debugMode;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -135,7 +131,7 @@ public class FrameUniforms implements UniformProvider {
|
|||||||
MatrixMath.writeUnsafe(viewProjection, ptr + 64 * 6);
|
MatrixMath.writeUnsafe(viewProjection, ptr + 64 * 6);
|
||||||
MatrixMath.writeUnsafe(viewProjection.invert(viewProjectionInverse), ptr + 64 * 7);
|
MatrixMath.writeUnsafe(viewProjection.invert(viewProjectionInverse), ptr + 64 * 7);
|
||||||
MatrixMath.writeUnsafe(viewProjectionPrev, ptr + 64 * 8);
|
MatrixMath.writeUnsafe(viewProjectionPrev, ptr + 64 * 8);
|
||||||
return ptr + 64 * 15;
|
return ptr + 64 * 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long writeCamera(long ptr, float camX, float camY, float camZ) {
|
private long writeCamera(long ptr, float camX, float camY, float camZ) {
|
||||||
|
@ -5,14 +5,13 @@ import org.lwjgl.system.MemoryUtil;
|
|||||||
|
|
||||||
import com.jozufozu.flywheel.api.event.RenderContext;
|
import com.jozufozu.flywheel.api.event.RenderContext;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.world.phys.Vec3;
|
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
public class LevelUniforms implements UniformProvider {
|
public class LevelUniforms implements UniformProvider {
|
||||||
public static final int SIZE = 12 * 4 + 2 * 16;
|
public static final int SIZE = 13 * 4 + 2 * 16;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private RenderContext context;
|
private RenderContext context;
|
||||||
|
@ -34,8 +34,6 @@ layout(std140) uniform _FlwFrameUniforms {
|
|||||||
float flw_aspectRatio;
|
float flw_aspectRatio;
|
||||||
float flw_viewDistance;
|
float flw_viewDistance;
|
||||||
|
|
||||||
uint flw_constantAmbientLight;
|
|
||||||
|
|
||||||
uint flw_ticks;
|
uint flw_ticks;
|
||||||
float flw_partialTick;
|
float flw_partialTick;
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@ layout(std140) uniform _FlwLevelUniforms {
|
|||||||
|
|
||||||
float flw_skyDarken;
|
float flw_skyDarken;
|
||||||
|
|
||||||
|
uint flw_constantAmbientLight;
|
||||||
|
|
||||||
/** Use FLW_DIMENSION_* ids to determine the dimension. May eventually be implemented for custom dimensions. */
|
/** Use FLW_DIMENSION_* ids to determine the dimension. May eventually be implemented for custom dimensions. */
|
||||||
uint flw_dimension;
|
uint flw_dimension;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user