Skip to content

Fix ImGuiMC, Light Buffer Startup, NVIDIA Shader Issues, and Sodium 0.8.13 Issues#142

Merged
Ocelot5836 merged 3 commits into
FoundryMC:1.21from
DarkFoxYT:Fix-ImGuiMC-Light-Buffer-Startup-and-NVIDIA-Shader-Issues
May 21, 2026
Merged

Fix ImGuiMC, Light Buffer Startup, NVIDIA Shader Issues, and Sodium 0.8.13 Issues#142
Ocelot5836 merged 3 commits into
FoundryMC:1.21from
DarkFoxYT:Fix-ImGuiMC-Light-Buffer-Startup-and-NVIDIA-Shader-Issues

Conversation

@DarkFoxYT
Copy link
Copy Markdown
Contributor

This branch keeps the light changes focused on buffer correctness and instance upload cost. It does not change the voxel shadow grid or the point/area light fragment shaders.

ImGuiMC Renderer Fix

  • Updated ImGuiMC to 1.2.4.
  • Added Fabric and NeoForge compatibility mixins for foundry.imgui.impl.renderer.v0.ImGuiRendererGL33.
  • Fixed ImGuiMC 1.2.x shader compilation on NVIDIA/OpenGL 3.3 by replacing the invalid GLSL 130 version line that included the core profile suffix.
  • This prevents ImGui from failing to compile its vertex/fragment shaders during startup.

Sodium 0.8.12 Compatibility

  • Updated the Sodium dependency to 0.8.12-alpha.3+mc1.21.1.
  • Adjusted Fabric and NeoForge Sodium compat to use Sodium's current RenderSectionManager rebuild scheduling path.

Light Instance Buffer Optimization

  • Added a lightweight revision counter to LightData.
  • Point and area light setters now mark their light data dirty when position, color, brightness, size, radius, angle, distance, orientation, or occlusion changes.
  • InstancedLightRenderer now tracks the previous visible-light order and each light's uploaded revision.
  • If the visible light order changes, or the GL instance buffer is resized, Veil still uploads the full visible light buffer.
  • If the visible light order is unchanged, only lights whose data revision changed are uploaded with glBufferSubData.
  • This keeps the current rendering model intact while avoiding full instance-buffer uploads for static lights.

Indirect Sphere Compute Shader Fix

  • Fixed NVIDIA GLSL compile errors in veil:light/indirect_sphere.
  • gl_GlobalInvocationID is unsigned, while Veil's light buffer offsets and command buffer indexes are signed integers.
  • The shader now converts the invocation ID math once and uses int for buffer indexing, avoiding implicit int to uint casts that NVIDIA rejects.

DarkFox added 2 commits May 21, 2026 01:37
This branch keeps the light changes focused on buffer correctness and instance upload cost. It does not change the voxel shadow grid or the point/area light fragment shaders.

## ImGuiMC Renderer Fix

- Updated ImGuiMC to `1.2.4`.
- Added Fabric and NeoForge compatibility mixins for `foundry.imgui.impl.renderer.v0.ImGuiRendererGL33`.
- Fixed ImGuiMC 1.2.x shader compilation on NVIDIA/OpenGL 3.3 by replacing the invalid GLSL 130 version line that included the `core` profile suffix.
- This prevents ImGui from failing to compile its vertex/fragment shaders during startup.

## Sodium 0.8.12 Compatibility

- Updated the Sodium dependency to `0.8.12-alpha.3+mc1.21.1`.
- Adjusted Fabric and NeoForge Sodium compat to use Sodium's current `RenderSectionManager` rebuild scheduling path.

## Light Instance Buffer Optimization

- Added a lightweight revision counter to `LightData`.
- Point and area light setters now mark their light data dirty when position, color, brightness, size, radius, angle, distance, orientation, or occlusion changes.
- `InstancedLightRenderer` now tracks the previous visible-light order and each light's uploaded revision.
- If the visible light order changes, or the GL instance buffer is resized, Veil still uploads the full visible light buffer.
- If the visible light order is unchanged, only lights whose data revision changed are uploaded with `glBufferSubData`.
- This keeps the current rendering model intact while avoiding full instance-buffer uploads for static lights.

## Indirect Sphere Compute Shader Fix

- Fixed NVIDIA GLSL compile errors in `veil:light/indirect_sphere`.
- `gl_GlobalInvocationID` is unsigned, while Veil's light buffer offsets and command buffer indexes are signed integers.
- The shader now converts the invocation ID math once and uses `int` for buffer indexing, avoiding implicit `int` to `uint` casts that NVIDIA rejects.
Comment thread neoforge/src/main/resources/veil.neoforge.mixins.json
Comment thread fabric/src/main/resources/veil.fabric.mixins.json
Comment thread fabric/src/main/resources/fabric.mod.json
Comment thread common/src/main/java/foundry/veil/api/client/render/light/data/LightData.java Outdated
Comment thread common/src/main/java/foundry/veil/api/client/render/light/data/LightData.java Outdated
@Ocelot5836 Ocelot5836 changed the title Fix ImGuiMC, Light Buffer Startup, and NVIDIA Shader Issues and sodium stuff XD Fix ImGuiMC, Light Buffer Startup, NVIDIA Shader Issues, and Sodium 0.8.13 Issues May 21, 2026
@Ocelot5836 Ocelot5836 merged commit a8d61ef into FoundryMC:1.21 May 21, 2026
1 check passed
@DarkFoxYT DarkFoxYT deleted the Fix-ImGuiMC-Light-Buffer-Startup-and-NVIDIA-Shader-Issues branch May 24, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants