Skip to content

ShaderTransformer: Fix integer texture attributes - #140

Merged
Johni0702 merged 1 commit into
masterfrom
feature/shader-transformer-ivec2
Jun 9, 2026
Merged

ShaderTransformer: Fix integer texture attributes#140
Johni0702 merged 1 commit into
masterfrom
feature/shader-transformer-ivec2

Conversation

@Johni0702

Copy link
Copy Markdown
Collaborator

Minecraft uses integer formats (namely 16-bit signed integers) for its secondary (light and overlay) textures in all its VertexFormats.

Previously the ShaderTransformer, used to convert legacy OpenGL shaders to more modern OpenGL, used to use the GLSL type vec2 for all texture attributes. This resulted in broken values being delivered to the shader on modern versions (presumably because they're trying to interpret the bytes representing integer values as floating point values).

This commit fixes the issue by using ivec2 where the provided VertexFormat contains an integer type for the attribute.

Minecraft uses integer formats (namely 16-bit signed integers) for its
secondary (light and overlay) textures in all its `VertexFormat`s.

Previously the ShaderTransformer, used to convert legacy OpenGL shaders
to more modern OpenGL, used to use the GLSL type `vec2` for all texture
attributes. This resulted in broken values being delivered to the shader
on modern versions (presumably because they're trying to interpret the
bytes representing integer values as floating point values).

This commit fixes the issue by using `ivec2` where the provided
VertexFormat contains an integer type for the attribute.

@Traben-0 Traben-0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Johni0702
Johni0702 merged commit 490ede4 into master Jun 9, 2026
1 check passed
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