You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

Raymarch Shaders

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

0
b/PC, Mac & Vintage Computers publicado por u/Snektron February 10, 2015, 07:56:06 PM
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


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

Spoiler


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

Spoiler


A simple one, made with my standard raymarch set.

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


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

Spoiler


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

Last Edit: July 25, 2015, 05:43:22 PM by Cumred_Snektron
Inicia sesión o crea una cuenta para dejar un comentario
u/Dream of Omnimaga February 11, 2015, 01:49:37 AM
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?
u/Duke "Tape" Eiyeron February 11, 2015, 08:52:53 AM
I saw you liked playing with raymarchers, you could have a lot of inspiration on glslsandbox.com and shadertoy.com .
u/Snektron February 11, 2015, 09:00:50 AM
@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
u/Duke "Tape" Eiyeron February 11, 2015, 09:18:55 AM
That'd be a good idea, please goron.
u/Snektron February 11, 2015, 10:37:14 AM
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
u/Dream of Omnimaga February 11, 2015, 12:16:49 PM
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?
u/Snektron February 11, 2015, 01:26:06 PM
It doesnt reset, it just doesnt have any smooth mouse interpolation :P
u/Dream of Omnimaga February 11, 2015, 05:19:41 PM
Oh ok, I thought it might have been a cross-browser compatibility problem.
Start a Discussion

b/PC, Mac & Vintage Computers

Computer programming discussion and project showcase

132
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal