Skip to content

GSOC 26: keep bump map slopes correct at image edges - #9095

Open
Nixxx19 wants to merge 3 commits into
processing:mainfrom
Nixxx19:bump-edge
Open

GSOC 26: keep bump map slopes correct at image edges#9095
Nixxx19 wants to merge 3 commits into
processing:mainfrom
Nixxx19:bump-edge

Conversation

@Nixxx19

@Nixxx19 Nixxx19 commented Aug 16, 2026

Copy link
Copy Markdown
Member

closes #9091.

two parts, both from the seam discussion on #9068.

bump map slopes at the edge of an image

bumpTexture() works out the surface slope by comparing neighbouring pixels. it only looked one way, so at the far edge of the image that lookup ran past the end and read back the same pixel, which made the slope read as flat exactly there. it now compares both sides, so an edge still gets a real slope.

on a sphere this shows up as a line down the seam. comparing the same sketch before and after, the line goes from obvious to faint. it doesn't disappear entirely without textureWrap(REPEAT), since at the very edge one of the two lookups still stops at the end of the image, but the shader no longer flattens the slope on its own. the same fix is in the webgpu shader.

docs

added a note to normalTexture() and bumpTexture() explaining that a shape like sphere() wraps its texture coordinates all the way around, so the two edges of the image meet and the image has to tile for them to line up. the bumpTexture() note also mentions textureWrap(REPEAT), since the slope comparison needs to carry across the join.

as discussed, this stays a property of the texture rather than something forced on all maps, since on a plane u=0 and u=1 shouldn't be the same.

full webgl and webgpu suites pass, including the existing normal and bump map visual tests.

note: stacked on #9089, so that one goes in first.

@p5-bot

p5-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

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.

document (or smooth over) the tiling requirements for texture maps on wrapped shapes

2 participants