The Open Shading Language spec says
Color variables may also have their components referenced using “named components” that look like accessing structure fields named
r,g, andb, as synonyms for [0], [1], and [2], respectively:float green = C.g; // get the green component C.r = 0.5; // set the red component
It says the same thing about points and x, y, z components. This is not working for me in Blender 2.8. I get errors like:
error: type 'point' does not have a member 'x'
Is this not implemented in Blender?
p[0],p[1], etc. I just findp.x,p.yto be clearer to read. Maybe I should just report it in the Blender bug tracker and see what they say. – Rob N May 10 '20 at 16:57