I want to create a custom node that can do complex math such as julia sets. I’ve tried using the script node in cycles, but I can’t even get a simple bit of code to work. the script is just a test. I know I can do the same thing with math nodes. this is just a test to make sure I know what I am doing before I move on to more complex things that the math nodes can’t do.
Works fine here. Make sure you activated OSL in Cycles render properties. Also, OSL don’t like non-latin literals in Blender installation directory address (but I guess it’s not your problem).
For that code, you don’t even need OSL… just multiply the vector XYZ by itself using a RGBMix node set to multiply. Using the vector math dot function, if you plug the vector into both inputs will return XX+YY+Z*Z.
There is already some scripts doing julia and mandelbrot fractals… you may want to take a look at them.