Discard fragment

Hello,

I’d like to simply discard fragments of a material.

I have two cubes with two different materials. The cube material on the left is Translucent and the cube material on the right is Opaque. Otherwise, the materials are the same.
I have a custom node with code discard;

The left cube is properly discarded while the cube on the right is only showing black (Base color is red)

Why can’t I discard Opaque fragment? How can I do it? Diving into the code is not a problem but I have no clue where to start.

1 Like