Skip to content

Apply correct coordinate wrapping for REPEAT mode in Image1D/2D/3D#335

Merged
jeffamstutz merged 1 commit intoKhronosGroup:next_releasefrom
sankhesh:texcoord_repeat
Jan 6, 2026
Merged

Apply correct coordinate wrapping for REPEAT mode in Image1D/2D/3D#335
jeffamstutz merged 1 commit intoKhronosGroup:next_releasefrom
sankhesh:texcoord_repeat

Conversation

@sankhesh
Copy link
Contributor

Ensure that texture coordinates are wrapped using fract() when the wrap mode is REPEAT in Image1D, Image2D, and Image3D samplers. This fixes incorrect sampling at texture boundaries for repeating textures. Adds a fract() helper to helium_math.h for this purpose.

The below images were created with VTK and helide with a texture coodinate range of [0,1] along the Y axis and a texture wrapping mode as REPEAT.

Texture Coordinate Range along X axis Before this change After this change
[0, 1] image image
[-1, 0] image image
[-0.5, 0.5] image image
[-1.3, 1.2] image image

@CLAassistant
Copy link

CLAassistant commented Dec 29, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@griffin28 griffin28 left a comment

Choose a reason for hiding this comment

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

fract() should be applied to mirrorRepeat wrap mode also.

Ensure that texture coordinates are wrapped using fract() when the wrap
mode is REPEAT in Image1D, Image2D, and Image3D samplers. This fixes
incorrect sampling at texture boundaries for repeating textures. Adds a
fract() helper to helium_math.h for this purpose.
@jeffamstutz
Copy link
Contributor

LGTM, thanks @sankhesh!

@jeffamstutz jeffamstutz merged commit 41f2ea1 into KhronosGroup:next_release Jan 6, 2026
8 checks 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.

4 participants