Skip to main content
1 of 2
Artem
  • 373
  • 2
  • 9

OSL distortion effect

I have a simple math function that produce a saw-like pattern. The question is - How to apply a distortion effect to it? enter image description here

Here's an example of the code:

shader basic_function(
point Pos = P,
output float f = 0,)

{float x = Pos[0];
float y = Pos[1];
float z = Pos[2];
   
f = (z + 0.5 - floor(z));}

PS Honestly, Im a new one in osl shader writing so it possible that I dont understand what im doing.

Artem
  • 373
  • 2
  • 9