Skip to content

[Bug] LightingPass never enables blending — later lights overwrite earlier ones #52

Description

@Winteradio

Summary

LightingPass draws one full-screen quad per light (separate Directional/Point/Spot shaders), but the blend field of RHIPipeLineCreateDesc is never set, so each light's draw simply overwrites the framebuffer instead of accumulating.

Root Cause

LightingPass::GetPipeLine() fills clear/vertex/pixel shader on the desc but never touches desc.blend. A local RHIBlendState blendState; blendState.enable = false; is declared but never assigned into the desc or passed anywhere — dead code.

Why it hasn't been noticed

All current demo/screenshot scenes use a single light, so only the last-drawn light's shader output happens to be the only one visible either way.

Suggested Fix

Wire an additive blend state (ONE, ONE) into desc.blend in GetPipeLine() so light contributions accumulate across draws.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions