Skip to content

GSOC 26: specular, ambient, and shininess texture maps - #9066

Open
Nixxx19 wants to merge 4 commits into
processing:mainfrom
Nixxx19:material-texture-maps
Open

GSOC 26: specular, ambient, and shininess texture maps#9066
Nixxx19 wants to merge 4 commits into
processing:mainfrom
Nixxx19:material-texture-maps

Conversation

@Nixxx19

@Nixxx19 Nixxx19 commented Aug 9, 2026

Copy link
Copy Markdown
Member

what

extends multi-material rendering to three more mtl texture maps, following the same per-part pattern map_Kd already uses: specular (map_Ks), ambient (map_Ka), and shininess (map_Ns). each is parsed, loaded, carried on the part state in p5's vocabulary, and bound in the phong shader, gated so untextured draws are unaffected.

the pattern (same for all three)

  1. parser stores the path (map_Ks/map_Ka already parsed; added map_Ns)
  2. loadMaterialTextures loads it onto the material (now driven by a small map table)
  3. mtlToPartState copies it to the part state, defaulting the base colour to white (or shininess to 1) so a map with no matching Ks/Ka/Ns still shows
  4. _applyPartState binds it into renderer state
  5. _setFillUniforms always binds the sampler, with a bool that gates its use
  6. phong.frag samples it and modulates the matching term

per map

  • map_Ks modulates the specular colour (inputs.specularMaterial)
  • map_Ka modulates the ambient colour (inputs.ambientMaterial)
  • map_Ns scales the shininess by the map's red channel (inputs.shininess)

zero regression

each new sampler is always bound (to an empty texture when absent) and gated by a uHas*Tex bool that defaults false, so existing 3D draws render exactly as before. confirmed by the full visual + unit suite staying green.

testing

  • parser + mtlToPartState unit tests for each map (path parsed, lands on part state, sensible base defaults)
  • full unit + visual suite green (no regression from the shader changes)

part of the gsoc multi-material .mtl work, follows #8879, #8955, and #9063.

@p5-bot

p5-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

Continuous Release

CDN link

Published Packages

Commit hash: ba4f224

Previous deployments

8a868d3


This is an automated message.

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.

1 participant