Skip to content

Fix specular cutoff on lights with radius overlapping with mesh#19157

Merged
superdump merged 2 commits intobevyengine:mainfrom
atlv24:fix-area-light
May 12, 2025
Merged

Fix specular cutoff on lights with radius overlapping with mesh#19157
superdump merged 2 commits intobevyengine:mainfrom
atlv24:fix-area-light

Conversation

@atlv24
Copy link
Copy Markdown
Contributor

@atlv24 atlv24 commented May 10, 2025

Objective

Solution

  • Clamp a dot product to be positive to avoid choosing a centerToRay which is not on the ray but behind it.

Testing

Main:
{DA2A2B99-27C7-4A76-83B6-CCB70FB57CAD}

This PR:
{2C4BC3E7-C6A6-4736-A916-0366FBB618DA}

Eevee reference:
329697008-ff28a5f3-27f3-4e98-9cee-d836a6c76aee

@atlv24 atlv24 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered labels May 10, 2025
@superdump superdump added this pull request to the merge queue May 12, 2025
Merged via the queue into bevyengine:main with commit 673e70c May 12, 2025
32 checks passed
@superdump superdump added this to the 0.16.1 milestone May 12, 2025
mockersf pushed a commit that referenced this pull request May 30, 2025
# Objective

- Fixes #13318

## Solution

- Clamp a dot product to be positive to avoid choosing a `centerToRay`
which is not on the ray but behind it.

## Testing

- Repro in #13318

Main:
<img width="963" alt="{DA2A2B99-27C7-4A76-83B6-CCB70FB57CAD}"
src="https://github.com/user-attachments/assets/afae8001-48ee-4762-9522-e247bbe3577a"
/>

This PR:
<img width="963" alt="{2C4BC3E7-C6A6-4736-A916-0366FBB618DA}"
src="https://github.com/user-attachments/assets/5bea4162-0b58-4df0-bf22-09fcb27dc167"
/>

Eevee reference:

![329697008-ff28a5f3-27f3-4e98-9cee-d836a6c76aee](https://github.com/user-attachments/assets/a1b566ab-16ee-40d3-a0b6-ad179ca0fe3a)
@atlv24 atlv24 deleted the fix-area-light branch July 23, 2025 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Lights with radius overlapping with mesh result in sharp specular cutoff

3 participants