OptiX render engine on an RTX 3060TI producing erroneous shadows in full transparency. #84954

Closed
opened 2021-01-22 08:02:21 +01:00 by Dylan Bailey · 14 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862
Worked: (newest version of Blender that worked as expected)

Short description of error
When rendering using OptiX on a RTX3060TI graphics card, placing 64 or more fully transparent (Alpha = 0) layers results in a shadow. This is irrespective of the transparent bounces setting in the render menu. When the renderer is set to OptiX CPU or to CUDA, this issue does not occur.

It is also noted that, under the visibility setting in the object menu, setting and unsetting the 'shadow' ray visibility option does not reliably enable or disable this option. Sometimes, when unsetting the shadow ray visibility option, the shadow is still rendered.

I have searched the forums and the bug tracker for this issue but have been unable to find it being reported. Since the issue occurs when 64 or more transparent layers are used, I strongly suspect a bug, or perhaps intentional limitation, in the OptiX renderer or driver. Or perhaps this is a little known limitation in the RTX ray tracing cores?Optix_Shadow_Bug.blend

Exact steps for others to reproduce the error
Create 64 planes with full transparent material (either Principled BSDF Alpha=0 or Transparent BSDF) and place any light source directly above it. Ensure Alpha Blend and Shadow modes are set accordingly (Hashed or Blend). Ensure that transparency bounces are set to more than 64. Render using OptiX in GPU mode on an RTX 3060TI (Uncertain whether this issue is hardware related.). Do the same experiment with only 63 layers, and the shadow disappears. See the attached .blend file.

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89 **Blender Version** Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862` Worked: (newest version of Blender that worked as expected) **Short description of error** When rendering using OptiX on a RTX3060TI graphics card, placing 64 or more fully transparent (Alpha = 0) layers results in a shadow. This is irrespective of the transparent bounces setting in the render menu. When the renderer is set to OptiX CPU or to CUDA, this issue does not occur. It is also noted that, under the visibility setting in the object menu, setting and unsetting the 'shadow' ray visibility option does not reliably enable or disable this option. Sometimes, when unsetting the shadow ray visibility option, the shadow is still rendered. I have searched the forums and the bug tracker for this issue but have been unable to find it being reported. Since the issue occurs when 64 or more transparent layers are used, I strongly suspect a bug, or perhaps intentional limitation, in the OptiX renderer or driver. Or perhaps this is a little known limitation in the RTX ray tracing cores?[Optix_Shadow_Bug.blend](https://archive.blender.org/developer/F9591953/Optix_Shadow_Bug.blend) **Exact steps for others to reproduce the error** Create 64 planes with full transparent material (either Principled BSDF Alpha=0 or Transparent BSDF) and place any light source directly above it. Ensure Alpha Blend and Shadow modes are set accordingly (Hashed or Blend). Ensure that transparency bounces are set to more than 64. Render using OptiX in GPU mode on an RTX 3060TI (Uncertain whether this issue is hardware related.). Do the same experiment with only 63 layers, and the shadow disappears. See the attached .blend file.
Author

Added subscriber: @wavestorm

Added subscriber: @wavestorm
Member

Added subscriber: @Alaska

Added subscriber: @Alaska
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I am able to reproduce the bug. System specifications below.

Operating system: Linux-5.10.0-1-amd64-x86_64-with-debian-bullseye 64 Bits
Graphics card: RTX 3070 460.32.03

Blender Version
2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862
2.93.0 Alpha, branch: master, commit date: 2021-01-22 06:12, hash: 2469ddc1a9

I am able to reproduce the bug. System specifications below. Operating system: Linux-5.10.0-1-amd64-x86_64-with-debian-bullseye 64 Bits Graphics card: RTX 3070 460.32.03 **Blender Version** 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862` 2.93.0 Alpha, branch: master, commit date: 2021-01-22 06:12, hash: `2469ddc1a9`
Member

Added subscriber: @pmoursnv

Added subscriber: @pmoursnv
Member

This is expected behavior: There is a limit of 64 transparent hits supported for a single ray until it hits a light source (see SHADOW_STACK_MAX_HITS in Cycles source code) on the GPU. On the CPU it can dynamically allocate more memory to extend that range, and with CUDA there is a slow fallback implementation using a loop. In OptiX that fallback implementation is disabled for better general performance, so you can't do more than 64. We could enable the fallback there as well, but that would come at a performance hit even if no more than 64 hits are encountered, so decided against it for now.

This is expected behavior: There is a limit of 64 transparent hits supported for a single ray until it hits a light source (see `SHADOW_STACK_MAX_HITS` in Cycles source code) on the GPU. On the CPU it can dynamically allocate more memory to extend that range, and with CUDA there is a slow fallback implementation using a loop. In OptiX that fallback implementation is disabled for better general performance, so you can't do more than 64. We could enable the fallback there as well, but that would come at a performance hit even if no more than 64 hits are encountered, so decided against it for now.

Added subscribers: @brecht, @YAFU

Added subscribers: @brecht, @YAFU

Hi.
If this is a limitation, then something would have to be done to make the Optix GPU + CPU Hybrid render give similar/compatible results in tiles? Limit CPU to the same GPU OptiX capabilities when OptiX hybrid render is used? I think @brecht has done something like that for volumetrics for CPU and GPU.

Hi. If this is a limitation, then something would have to be done to make the Optix GPU + CPU Hybrid render give similar/compatible results in tiles? Limit CPU to the same GPU OptiX capabilities when OptiX hybrid render is used? I think @brecht has done something like that for volumetrics for CPU and GPU.
Author

Hello

I had a suspicion this was the case, but then it needs to be made very clear in the documentation (I searched pretty thoroughly but found no mention of it), especially if blender is to be more widely adopted for commercial projects. Would it not be possible to add an option in a future build that would allow us to bypass this limitation? Perhaps an additional feature set option?

In any case, many thanks for clarifying this. I might look into cloning the cycles driver and experimenting with the SHADOW_STACK_MAX_HITS setting, if I can get the tool-sets set up on my system.

Hello I had a suspicion this was the case, but then it needs to be made very clear in the documentation (I searched pretty thoroughly but found no mention of it), especially if blender is to be more widely adopted for commercial projects. Would it not be possible to add an option in a future build that would allow us to bypass this limitation? Perhaps an additional feature set option? In any case, many thanks for clarifying this. I might look into cloning the cycles driver and experimenting with the SHADOW_STACK_MAX_HITS setting, if I can get the tool-sets set up on my system.
Member

In #84954#1099100, @wavestorm wrote:
In any case, many thanks for clarifying this. I might look into cloning the cycles driver and experimenting with the SHADOW_STACK_MAX_HITS setting, if I can get the tool-sets set up on my system.

For reference, here's a patch to increase the SHADOW_STACK_MAX_HITS to 128.

Increase SHADOW_STACK_MAX_HITS.diff

As Patrick Mours has pointed out, this may have an impact on performance and potentially memory usage. So use at your own risk.

> In #84954#1099100, @wavestorm wrote: > In any case, many thanks for clarifying this. I might look into cloning the cycles driver and experimenting with the SHADOW_STACK_MAX_HITS setting, if I can get the tool-sets set up on my system. For reference, here's a patch to increase the `SHADOW_STACK_MAX_HITS` to 128. [Increase SHADOW_STACK_MAX_HITS.diff](https://archive.blender.org/developer/F9594561/Increase_SHADOW_STACK_MAX_HITS.diff) As Patrick Mours has pointed out, this may have an impact on performance and potentially memory usage. So use at your own risk.

Added subscriber: @david_black

Added subscriber: @david_black

Hi only just seen this,

While can't currently use OptiX, wonder if it would help others adding a UI 'Transparency' setting soft limit of 64 while OptiX is enabled in prefs?

Hi only just seen this, While can't currently use OptiX, wonder if it would help others adding a UI 'Transparency' setting soft limit of 64 while OptiX is enabled in prefs?

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2021-11-05 23:01:18 +01:00

This is solved in Blender 3.0, where shadow transparency is now computed in multiple iterations for GPU rendering.

This is solved in Blender 3.0, where shadow transparency is now computed in multiple iterations for GPU rendering.
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
6 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#84954
No description provided.