Join us on Discord!
You can help CodeWalrus stay online by donating here.

Raymarch Shaders

Started by Snektron, February 10, 2015, 07:56:06 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Snektron

Apart from making particle systems i do more with shaders, and that is mainly raymarching.
For those of you who don't know, raymarching is a rendering technique (like rasterizing).
for every pixel a ray is casted from the camera and folowed until it hits an object, mostly
done by having a distance formula (which surprisingly returns the distance to a surface) and
moving forward until the distance is smaller than a certain number (like 0.0001).

I've whipped up a program to load and draw the shader on a quad covering the whole screen, does
some uniform (variables send to the GPU) management, and even some position/direction to make
first person controls possible. And i've ofcourse made a few shaders, and wanted to share a few screens :)

[spoiler]

[/spoiler]
This one i made just today, and is probably one of my best.

[spoiler]

[/spoiler]
An experiment with reflections, and the noise distortion makes it look like water :)

[spoiler]

[/spoiler]
A simple one, made with my standard raymarch set.

[spoiler]

[/spoiler]
This is not really raymarching, and without animation it's hard to see, but it's a galaxy.
One of the drawbacks of raymarching: these kind of objects. it needs to calculate for every
object if a pixel is in range, which causes ridiculous frame drops.

[spoiler]

[/spoiler]
It's also very easy to plot a 3d function :)

[spoiler]

[/spoiler]
And i really like how easy it is to make almost impossible shapes for rasterization.

  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Ooh those looks pretty, especially the first and the third. :D I unfortunately never worked with 3D so I don't really understand much of what you said lol. I would need to look it up or maybe see through an animation how the process is achieved. I am curious about how smooth the frame rate would be with those objects rotating?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Duke "Tape" Eiyeron

I saw you liked playing with raymarchers, you could have a lot of inspiration on glslsandbox.com and shadertoy.com .
  • Calculators owned: A lot.

Snektron

@djo The planet does rotate ;). And animation isn't too hard to program, because i can just upload the time to the shader each frame and use it to make some animations :).

@Eiyeron im not very often on glslsandbox, but shadertoy is in my bookmarks ;) (qi is a genius!)

I will try to upload the planet to shadertoy, so you guys will be able to see it in action :D
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Duke "Tape" Eiyeron

That'd be a good idea, please goron.
  • Calculators owned: A lot.

Snektron

So i did a quick port, but it's not yet done (i wanna add some stars and some more things).
heres the link: https://www.shadertoy.com/view/4tXGzf
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Oh wow I remember that site now. It had some very epic (but sometimes laggy) stuff. I didn't go there much before because back when I found it I used Opera 12.17 and the site didn't work in it. Anyway I tried your program and it looks very cool and smooth. Is clicking it supposed to reset the Earth position every time, though?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

It doesnt reset, it just doesnt have any smooth mouse interpolation :P
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Oh ok, I thought it might have been a cross-browser compatibility problem.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal