Skip to main content
Tweeted twitter.com/StackBlender/status/925299637006864384
Remove extra ‘,’ from code sample.
Source Link
Rich Sedman
  • 45.2k
  • 2
  • 109
  • 233

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.

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.

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.

Source Link
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.