Skip to content

[Patch] Composite material emissive in the TBDR light pass - #1121

Open
miogds wants to merge 1 commit into
untoldengine:developfrom
miolabs:bugfix/tbdr_material_emissive
Open

[Patch] Composite material emissive in the TBDR light pass#1121
miogds wants to merge 1 commit into
untoldengine:developfrom
miolabs:bugfix/tbdr_material_emissive

Conversation

@miogds

@miogds miogds commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Split out of #1110 as requested, so the emissive question can be reviewed on its own.

What

The TBDR deferred light pass reads the G-buffer emissive but zeroes it before the final composite:

// set emissive to zero for now - need  to revisit this
emissive = 0.0;
float3 finalRGB = (float3)color.diff + color.spec + indirectLighting + emissive;

This removes the zeroing so material.emissiveValue written by the model pass actually reaches the screen. Kernels regenerated with buildkernels.sh.

Why it should be safe

  • Material.emissiveValue defaults to .zero, the native-format loader defaults emissiveFactor to zero, and the MDL/usdz import path never sets it — so existing assets render identically. Only entities that explicitly call updateMaterialEmmisive (or the scene-builder .emissive() modifier from Scene builder DSL: primitive, light, and camera nodes + TBDR emissive fix #1110) change appearance.
  • The non-TBDR fragmentLightShader path is untouched.

Testing

Verified on macOS with small emissive marker spheres orbiting a PBR-textured cube (dark IBL, no directional light): before, the spheres rendered black on their unlit side; after, they glow with their emissive color. Non-emissive geometry in the same scene (the PBR cube, textured meshes) renders unchanged before/after.

I know emissive was zeroed over a bug you found — if you remember its shape, happy to try to reproduce it against this change; and if you'd rather fix it your own way, feel free to treat this PR as a reference and close it.

The deferred TBDR light shader zeroed the G-buffer emissive before the
final composite, so material emissive values never reached the screen.
Emissive defaults to zero for all materials, so only entities that set
it explicitly are affected. Kernels regenerated via buildkernels.sh.
@miogds
miogds requested a review from untoldengine as a code owner July 30, 2026 15:06
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