Alternatively, join us on Discord.

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

February 10, 2015, 07:56:06 pm Last Edit: July 25, 2015, 05:43:22 pm by Cumred_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: ShowHide



This one i made just today, and is probably one of my best.

Spoiler: ShowHide



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

Spoiler: ShowHide



A simple one, made with my standard raymarch set.

Spoiler: ShowHide



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: ShowHide



It's also very easy to plot a 3d function :)

Spoiler: ShowHide



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

Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DJ 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?

Duke "Tape" Eiyeron

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

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

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
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DJ 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?

Snektron

It doesnt reset, it just doesnt have any smooth mouse interpolation :P
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DJ Omnimaga

Oh ok, I thought it might have been a cross-browser compatibility problem.

Powered by EzPortal