Im trying to make a Redshift material which checks string user data against a string parameter and outputs R/G/B based on that.
The idea is that i have various geometry in my scene with point name attributes on everything, id like to set up some AOVs for specifically named points / lines / surfaces in different sop nodes.
Based on research ive found, the only way to process string attributes is with an OSL shader? I havent programmed an osl shader before, i tried to build this based on some examples, it compiles, but then it crashes houdini when I hit render.
shader stringCheck [[ string help = "attrib string compare to RGB", string category = "string" ]] ( string inStringA = "" [[ string label="AttribA" ]], string inStringACompare = "" [[ string label="AttribACompare" ]], string inStringB = "" [[ string label="AttribB" ]], string inStringBCompare = "" [[ string label="AttribBCompare" ]], string inStringC = "" [[ string label="AttribB" ]], string inStringCCompare = "" [[ string label="AttribCCompare" ]], output color outColor = 1 [[ string label = "Out Color"]] ) { float R = inStringA==inStringACompare; float G = inStringB==inStringBCompare; float B = inStringC==inStringCCompare; outColor = color(R,G,B); }