0
Fixed

'vert' Program errors with math nodes

Spooky 10 years ago updated by Freya Holmér (Developer) 10 years ago 6
While trying to create a refraction shader based on the example Refraction, whenever Comp. Mask is run through a multiply (as in example), or its input is run through a Lerp (as in example) the preview turns pink and Unity displays an error "Shader error in 'Shader Forge/StainedGlass/': Program 'vert', invalid initialization. This also happens if the normal through a Lerp.

Unity version 4.3.2f1 and Shader Forge version 0.23

Answer

Answer
Fixed
This has now been fixed in Beta 0.24 :)

(Texture2D nodes marked as normal maps will no longer have an alpha output, due to how Unity decodes their normal maps)
For some reason having a Texture 2D connected to the Specular input on Main fixed this, but only sometimes.
I can't seem to reproduce this. Could you do a step-by step guide on how you are able to reproduce the error? :)
Weirdly, I can't seem to reproduce this. I started a new Shader and used all the same components but it is working as expected. I don't have a lot of time to test right now, but I'll try it again when I do and let you know if I figure out how to reproduce it. Thanks for checking it out anyway!
Alright, I'll close this for now then! Reopen it if you bump into it :) It might be because of some completely unrelated issue
It looks like I've found a reproducible version of this bug. Using the alpha channel of a map marked Normal Map causes a Vert program error even in a clean install.
Ah, good catch. That's because normal maps doesn't have an alpha channel when unpacked. I should hide the A channel when it's marked as a normal map!
Answer
Fixed
This has now been fixed in Beta 0.24 :)

(Texture2D nodes marked as normal maps will no longer have an alpha output, due to how Unity decodes their normal maps)