Help making backface culling shader when using partially transparent textures
Here's a simple shader I'm trying to use to make it so you can use a texture that has some parts transparent but which doesn't render the polygons on the other side of the model. This way the transparency in the front doesn't show anything on the back.
I think I'm pretty close but it's not quite giving the result I need. The way I have it:
1 - "calculate normal" is dotted with itself
2 - if it's positive, output 1. otherwise output 0. this makes backface polygons have 0 values and forward facing polygons have 1 values
3 - this is multiplied with the opacity of the texture
The attached screenshot shows what I have. The problem is it's not culling anything in the render. This is confusing because it seems like it should work since if I flip the function of the compare brick from greater than to less than, the preview for that brick turns from white to black, so I'm not sure what the problem is.
Is there something obvious I'm doing wrong? Is 'calculate normal' the right place to start with this?