Page MenuHome

ShaderToRGB Node plugged to alpha does not work with Alpha Clip or Alpha Hashed mode in 2.90
Confirmed, NormalPublicKNOWN ISSUE

Description

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: rB0330d1af29c0
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.

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

Event Timeline

takaaki takeda (popqjp) renamed this task from ShaderToRGB Node plugged to to ShaderToRGB Node plugged to alpha does not work with Alpha Clip or Alpha Hashed mode in 2.90.Sep 18 2020, 9:18 AM
takaaki takeda (popqjp) updated the task description. (Show Details)

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

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

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.

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Sep 21 2020, 8:02 PM
Germano Cavalcante (mano-wii) updated the task description. (Show Details)
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".
Jeroen Bakker (jbakker) changed the subtype of this task from "Bug" to "Known Issue".Sep 25 2020, 3:48 PM

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.