Doing fun stuff strictly in a fragment shader: how to do perspective and draw meaningful scenes?

Started by
3 comments, last by Infinisearch 6 years, 6 months ago

This question isn't as much about how to do stuff as it is about how to find existing tutorials on doing this stuff. I just can't seem to find the right search terms.

I want to understand and do stuff like this: https://www.shadertoy.com/view/4ldGz4

Or this: https://www.shadertoy.com/view/4lsczM

Is there a name for that? What techniques will I need? I understand that a fragment shader takes pixel coordinates and returns the color of that pixel. Basically, if I need to draw a 3D scene, I need to implement a basic 3D engine and a rasterizer - all in the fragment shader?

 

Advertisement

I think those are SDF (signed distance field) based.

edit - its more akin to ray tracing or ray marching.

edit2 - http://iquilezles.org/www/articles/distfunctions/distfunctions.htm

-potential energy is easily made kinetic-

20 hours ago, Infinisearch said:

I think those are SDF (signed distance field) based.

edit - its more akin to ray tracing or ray marching.

edit2 - http://iquilezles.org/www/articles/distfunctions/distfunctions.htm

Thanks, exactly what I was looking for!

Make sure you follow the link "raymarching distance fields" in the link I posted, it should explain what you need to do.

-potential energy is easily made kinetic-

This topic is closed to new replies.

Advertisement