This is an odd one, I’m getting a compiler error with this material even though I know I’m certainly giving it the correct parameters…
The error I’m being given is that Input A must be of Type ‘Float’ - which it definitely is, since I’m masking it right beforehand!
The If Node:
The Ray Intersect Function:
This is part of my ongoing attempt to bring in a seamless Ground > Space Rayleigh and Mie Scattering Shader, but I’m hitting hundreds of brick walls along the way, mainly with loops and suchlike.
I would also use the BreakComponents function instead of the mask.
However I would put it into the function. Maybe as a second output, if you use the whole output value elsewhere.
If not just make the function output only the R channel…
If the output only goes to the mask node, it can be refactord into the function…
A quick thought have you made sure that your Function Inputs in the Material Function are set to use default values? If not that can throw an error on the IF as some vector conversion is not occurring in the function.
My own fault, I’m trying to take the Sqrt of a Vector, then Append onto that and return it via the If. The If doesn’t know if it should be returning a Float2 or a Float4 (It can’t be one or the other at any given time, for obvious reasons). There’s nothing wrong with input A. Long story short, I create the nodes wrong but the error message wasn’t very indicative of where the error was.