ShaderToRGB Node plugged to alpha does not work with Alpha Clip or Alpha Hashed mode in 2.90 #80919

Open
opened 2020-09-18 09:03:36 +02:00 by takaaki takeda · 7 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash: 0330d1af29
Worked: 2.83

Short description of error
If ShaderToRGB Node is plugged to alpha socket of another princepled BSDF, it does not work if blend mode is alpha clip or alpha hashed in blender 2.90.
This combination worked in 2.83

I attached a snapshot image in both cases 2.90 and 2.83.

ShaderToRGB_AlphaClip.png

Left image is 2.90, and Right image is 2.83.4.
The object becomes fully transparent in 2.90 case.
(Though, It works if blend mode is alpha blend.
The problem is only in alpha clip or alpha hashed mode.)

Exact steps for others to reproduce the error

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86 **Blender Version** Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash: `0330d1af29` Worked: 2.83 **Short description of error** If ShaderToRGB Node is plugged to alpha socket of another princepled BSDF, it does not work if blend mode is alpha clip or alpha hashed in blender 2.90. This combination worked in 2.83 I attached a snapshot image in both cases 2.90 and 2.83. ![ShaderToRGB_AlphaClip.png](https://archive.blender.org/developer/F8894689/ShaderToRGB_AlphaClip.png) Left image is 2.90, and Right image is 2.83.4. The object becomes fully transparent in 2.90 case. (Though, It works if blend mode is alpha blend. The problem is only in alpha clip or alpha hashed mode.) **Exact steps for others to reproduce the error** - Open the attached file in blender 2.83 and 2.90 - Compare the viewport of both [ShaderToRGB_Problem.blend](https://archive.blender.org/developer/F8906878/ShaderToRGB_Problem.blend)
Author

Added subscriber: @popqjp

Added subscriber: @popqjp
takaaki takeda changed title from ShaderToRGB Node plugged to to ShaderToRGB Node plugged to alpha does not work with Alpha Clip or Alpha Hashed mode in 2.90 2020-09-18 09:18:18 +02:00

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Can you provide a simple .blend file showing the problem?

Can you provide a simple .blend file showing the problem?
Author

I atached a blend file (ShaderToRGB_Problem.blend) here.

ShaderToRGB_Problem.blend

This file was saved by blender 2.83. (I checked that it can be read by 2.90 and the problem occurs there with my PC.)
When viewport render is turned to "Rendered", the suzanne becomes fully transparent in 2.90, while it is shown in 2.83.

I atached a blend file (ShaderToRGB_Problem.blend) here. [ShaderToRGB_Problem.blend](https://archive.blender.org/developer/F8906878/ShaderToRGB_Problem.blend) This file was saved by blender 2.83. (I checked that it can be read by 2.90 and the problem occurs there with my PC.) When viewport render is turned to "Rendered", the suzanne becomes fully transparent in 2.90, while it is shown in 2.83.

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

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

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

During depth prepass the BSDF evaluation is skipped as at this point not all material resources are available. [See closure_lit_lib.glsl].

#if defined(DEPTH_SHADER) || defined(WORLD_BACKGROUND)
  /* This makes shader resources become unused and avoid issues with samplers. (see T59747) */
  return;
#else

This will output black color, what is converted and put in the alpha socket. An alpha of 0 is not visible, making the depth shader always discard the pixel.
As a work-around you could use the alpha blend mode, what does not rely on the depth shader.

There isn't a good solution for this as the depth shader must run first before anything as other effects (AO, shadowing) rely on the depth buffers. Surface shading happens later in the pipeline as they rely on AO and shadowing. For now I set it to known issue and add this as a limitation in the manual.

During depth prepass the BSDF evaluation is skipped as at this point not all material resources are available. [See `closure_lit_lib.glsl`]. ``` #if defined(DEPTH_SHADER) || defined(WORLD_BACKGROUND) /* This makes shader resources become unused and avoid issues with samplers. (see T59747) */ return; #else ``` This will output black color, what is converted and put in the alpha socket. An alpha of 0 is not visible, making the depth shader always discard the pixel. As a work-around you could use the alpha blend mode, what does not rely on the depth shader. There isn't a good solution for this as the depth shader must run first before anything as other effects (AO, shadowing) rely on the depth buffers. Surface shading happens later in the pipeline as they rely on AO and shadowing. For now I set it to known issue and add this as a limitation in the manual.
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:14:29 +01:00
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
3 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#80919
No description provided.