EEVEE-NEXT: PCF & soft shadow missing part #119725

Open
opened 2024-03-21 05:47:04 +01:00 by Donovane · 9 comments

System Information
Operating system: WIN 11 23H2
Graphics card: RTX 2060

Blender Version
Broken: DAILY 4.2 ALPHA FROM 21/03/2024
Worked: NONE ALPHA FEATURES

Short description of error
Wheny our using an area light for ligtning a scene when your come close to the mesh a part of shadow doesn't have PCF Shadowing and btw too soft shadow missed ! But if you are distant from the mesh you don't have the error

Exact steps for others to reproduce the error

  • Create a cube
  • Create an area light
  • Switch to Light properties to set custom value (Blend file included in this topic)
  • Switch to eevee next
    and boom you got that :
    https://i.ibb.co/p3PwfBd/untitled.png

Video : https://projects.blender.org/attachments/9d7df738-81aa-40f4-b3d4-e83d5ed2b831

Blend file in attachement

**System Information** Operating system: WIN 11 23H2 Graphics card: RTX 2060 **Blender Version** Broken: DAILY 4.2 ALPHA FROM 21/03/2024 Worked: NONE ALPHA FEATURES **Short description of error** Wheny our using an area light for ligtning a scene when your come close to the mesh a part of shadow doesn't have PCF Shadowing and btw too soft shadow missed ! But if you are distant from the mesh you don't have the error **Exact steps for others to reproduce the error** - Create a cube - Create an area light - Switch to Light properties to set custom value (Blend file included in this topic) - Switch to eevee next and boom you got that : ![https://i.ibb.co/p3PwfBd/untitled.png](https://i.ibb.co/p3PwfBd/untitled.png) Video : https://projects.blender.org/attachments/9d7df738-81aa-40f4-b3d4-e83d5ed2b831 Blend file in attachement
Donovane added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2024-03-21 05:47:05 +01:00
Donovane changed title from EEVEE: PCF SHADOW MISSING PART to EEVEE-NEXT: PCF & SOFT SHADOW SHADOW MISSING PART 2024-03-21 05:59:10 +01:00
Member

Can confirm

Can confirm
Philipp Oeser added
Module
EEVEE & Viewport
Status
Confirmed
Interest
EEVEE
and removed
Status
Needs Triage
labels 2024-03-21 09:30:54 +01:00

If you don't mind I would like to tackle with this.

For me it seems like borderline calculation / condition case.
Not sure yet in engine code or in its shaders, still tracing.

In this particular scene in Shadow Tile debug mode (F3 > Debug Menu > 10) the problematic tile is not marked as "used".
Also the case is sensitive to light "size" parameter.
For example, without moving camera the case disappears if the size is reduced from 100 to 96, and yet another pattern appears if the size is increased to 146 or so.

If you don't mind I would like to tackle with this. For me it seems like borderline calculation / condition case. Not sure yet in engine code or in its shaders, still tracing. In this particular scene in Shadow Tile debug mode (F3 > Debug Menu > 10) the problematic tile is not marked as "used". Also the case is sensitive to light "size" parameter. For example, without moving camera the case disappears if the size is reduced from 100 to 96, and yet another pattern appears if the size is increased to 146 or so.
Author

If you don't mind I would like to tackle with this.

For me it seems like borderline calculation / condition case.
Not sure yet in engine code or in its shaders, still tracing.

In this particular scene in Shadow Tile debug mode (F3 > Debug Menu > 10) the problematic tile is not marked as "used".
Also the case is sensitive to light "size" parameter.
For example, without moving camera the case disappears if the size is reduced from 100 to 96, and yet another pattern appears if the size is increased to 146 or so.

Nah isn't logical because when you are too far of the mesh the shadow is okay and when you come close the changement come here... Need a refactoring

> If you don't mind I would like to tackle with this. > > For me it seems like borderline calculation / condition case. > Not sure yet in engine code or in its shaders, still tracing. > > In this particular scene in Shadow Tile debug mode (F3 > Debug Menu > 10) the problematic tile is not marked as "used". > Also the case is sensitive to light "size" parameter. > For example, without moving camera the case disappears if the size is reduced from 100 to 96, and yet another pattern appears if the size is increased to 146 or so. Nah isn't logical because when you are too far of the mesh the shadow is okay and when you come close the changement come here... Need a refactoring

I got stacked with this one.

The code fragment that causes this case:

vec3 shadow_pcf_offset(...)
{
    ... // various checks

    if (!tile.is_allocated) {        
        return vec3(0.0); // this early return causes "sharp" edges on the problematic tile
    }
    
    ... // actual offset calculations
    return ws_offset;
}

For some reason shadow tile is not marked as is_used and is_allocated. Removing aforementioned early return fixes the shadows, but makes everything slower (which is the point of this check).

As far as I was able to trace/debug the case, the tile data leaving shadow compute shaders is fine (tilemaps_buf). Then it gets converted to tilemaps_img and passed to actual rendering and ray tracing. At this point the tile is not recognized as is_allocated.

Some insights or ideas on how visible shadow tiles are recognized and/or processed during rendering would be valuable.

I got stacked with this one. The code fragment that causes this case: ```glsl vec3 shadow_pcf_offset(...) { ... // various checks if (!tile.is_allocated) { return vec3(0.0); // this early return causes "sharp" edges on the problematic tile } ... // actual offset calculations return ws_offset; } ``` For some reason shadow tile is not marked as `is_used` and `is_allocated`. Removing aforementioned early return fixes the shadows, but makes everything slower (which is the point of this check). As far as I was able to trace/debug the case, the tile data leaving shadow compute shaders is fine (`tilemaps_buf`). Then it gets converted to `tilemaps_img` and passed to actual rendering and ray tracing. At this point the tile is not recognized as `is_allocated`. Some insights or ideas on how visible shadow tiles are recognized and/or processed during rendering would be valuable.
Author

I got stacked with this one.

The code fragment that causes this case:

vec3 shadow_pcf_offset(...)
{
    ... // various checks

    if (!tile.is_allocated) {        
        return vec3(0.0); // this early return causes "sharp" edges on the problematic tile
    }
    
    ... // actual offset calculations
    return ws_offset;
}

For some reason shadow tile is not marked as is_used and is_allocated. Removing aforementioned early return fixes the shadows, but makes everything slower (which is the point of this check).

As far as I was able to trace/debug the case, the tile data leaving shadow compute shaders is fine (tilemaps_buf). Then it gets converted to tilemaps_img and passed to actual rendering and ray tracing. At this point the tile is not recognized as is_allocated.

Some insights or ideas on how visible shadow tiles are recognized and/or processed during rendering would be valuable.

Tell him to @fclem

> I got stacked with this one. > > The code fragment that causes this case: > > ```glsl > vec3 shadow_pcf_offset(...) > { > ... // various checks > > if (!tile.is_allocated) { > return vec3(0.0); // this early return causes "sharp" edges on the problematic tile > } > > ... // actual offset calculations > return ws_offset; > } > ``` > > For some reason shadow tile is not marked as `is_used` and `is_allocated`. Removing aforementioned early return fixes the shadows, but makes everything slower (which is the point of this check). > > As far as I was able to trace/debug the case, the tile data leaving shadow compute shaders is fine (`tilemaps_buf`). Then it gets converted to `tilemaps_img` and passed to actual rendering and ray tracing. At this point the tile is not recognized as `is_allocated`. > > Some insights or ideas on how visible shadow tiles are recognized and/or processed during rendering would be valuable. Tell him to @fclem
Thomas Dinges changed title from EEVEE-NEXT: PCF & SOFT SHADOW SHADOW MISSING PART to EEVEE-NEXT: PCF & soft shadow missing part 2024-03-27 11:51:42 +01:00
Member

@Vitalijs-Komasilovs Good catch!

For some reason shadow tile is not marked as is_used and is_allocated. Removing aforementioned early return fixes the shadows, but makes everything slower (which is the point of this check).

While that may workaround the issue, having actually valid tiles tagged as invalid seems like a pretty bad problem that could cause other issues.

@Vitalijs-Komasilovs Good catch! > For some reason shadow tile is not marked as `is_used` and `is_allocated`. Removing aforementioned early return fixes the shadows, but makes everything slower (which is the point of this check). While that may workaround the issue, having actually valid tiles tagged as invalid seems like a pretty bad problem that could cause other issues.
Miguel Pozo added
Priority
High
and removed
Priority
Normal
labels 2024-04-11 17:19:54 +02:00

Definitely removing is_allocated check is not a way to resolve this bug.

This is how the "problematic" tile looks like from the distance. In this case shadows are fine.
image

And here is the same tile close up with wrong shadows. It kind of extends "outside" the viewport. This might be the root cause.
Also there are other similar not valid tiles along borders of the viewport, but their shadow edges are not visible, thought.
image

Similar effect kicks in if you zoom out. All these marked tiles extend way beyond the viewport. But again, no visible artifacts in this case.
image

Maybe this will help to find the right clue.

Definitely removing `is_allocated` check is not a way to resolve this bug. This is how the "problematic" tile looks like from the distance. In this case shadows are fine. ![image](/attachments/b51b0c92-2fd4-414d-a6e2-ae60887a406d) And here is the same tile close up with wrong shadows. It kind of extends "outside" the viewport. This might be the root cause. Also there are other similar not valid tiles along borders of the viewport, but their shadow edges are not visible, thought. ![image](/attachments/5838bb0c-ad3b-49f0-bbf0-d7a4b4d99cb1) Similar effect kicks in if you zoom out. All these marked tiles extend way beyond the viewport. But again, no visible artifacts in this case. ![image](/attachments/6217cdfd-b683-4b70-a974-e95da8c05f0d) Maybe this will help to find the right clue.
284 KiB
331 KiB
560 KiB

Can you test if this is linked to the Normal Bias? Seems like some tagging is missing because of this bias.

Can you test if this is linked to the `Normal Bias`? Seems like some tagging is missing because of this bias.

Can you test if this is linked to the Normal Bias? Seems like some tagging is missing because of this bias.

Did testing. Seems unrelated to the Normal Bias, it visually slightly changes shadow distance from the object, but the tile is still not tagged.

Meanwhile I found that light Size significantly affects number of untagged tiles (see attached screenshots). And in case of shadows it is almost exclusively used for shadow_projection_shift calculations. Maybe due to this shift tagging routine (shadow_tag_usage_tilemap_punctual) is not able to map point coordinates to tile coordinates?

> Can you test if this is linked to the `Normal Bias`? Seems like some tagging is missing because of this bias. Did testing. Seems unrelated to the `Normal Bias`, it visually slightly changes shadow distance from the object, but the tile is still not tagged. Meanwhile I found that light `Size` significantly affects number of untagged tiles (see attached screenshots). And in case of shadows it is almost exclusively used for `shadow_projection_shift` calculations. Maybe due to this shift tagging routine (`shadow_tag_usage_tilemap_punctual`) is not able to map point coordinates to tile coordinates?
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#119725
No description provided.