pouët.net

Raymarching Beginners' Thread

category: code [glöplog]
(looking good tho :)
added on the 2011-02-24 16:48:36 by kb_ kb_
las: nice, but not spiky enough ;)
added on the 2011-02-24 16:58:02 by psonice psonice
nice flab
added on the 2011-02-24 17:01:38 by yumeji yumeji
my latest bit of fiddling about: http://www.youtube.com/watch?v=3myYrQZ0yUY. Nothing too special, just trying to figure out colour (it's easy enough with some objects, not so straight cut when you go beyond the standard min/max).

What I'm figuring out now: what to do in the main shader, and what to do in post process. Ideally, I'd like to output normal, tex coords, material, and depth in the main shader, then texture + light it in the second. Then there's shadows, they have to be done in the main shader. But that's already 8 items to fit into 4 components.

So I reckon I have to do lighting at least in the main shader. And if I want bump mapping or anything like that, texture has to be done here too. Maybe output colour + depth is the best option :/
added on the 2011-02-24 17:08:08 by psonice psonice
why not everything in the main shader?

deferred lighting/texturing/shading is nice for raster engines, where the same pixel might be shaded several times due to depth complexity. in a raytracer/raymarcher, however, every pixel gets shaded once and only once anyway. so i don't see the advantage of doing it in postprocess...? it is gonna be slower and use more code, in fact. or are you trying ssao or something like that?
added on the 2011-02-24 18:34:24 by iq iq
Ssao in a raymarcher? :O No, I was thinking more like DOF, edge detection/fake AA etc. They're hard in the main shader, and I'm not worrying about code size at this point.
added on the 2011-02-24 20:35:41 by psonice psonice
BB Image
256! :)
added on the 2011-02-24 21:38:56 by las las
las: Nice!
added on the 2011-02-24 23:28:34 by Xetick Xetick
Nice indeed, but I still want to know 256 what :)
added on the 2011-02-25 00:02:54 by psonice psonice
post number 256 in this thread ;)
added on the 2011-02-25 00:10:41 by las las
ah. It was appropriately cool :)
added on the 2011-02-25 00:22:01 by psonice psonice
Fantastic shading. Makes me want to eat it!
added on the 2011-02-25 03:35:18 by xernobyl xernobyl
yep. looks yummy. like jelly.

@las can you put a lil sugar on it?
added on the 2011-02-25 05:01:28 by yumeji yumeji
@yumeji: what kind of sugar? :)
+ I have to admit that I instantly wanted to eat that fruit like thing when I saw it first :)
added on the 2011-02-25 10:47:39 by las las
Looks radioactive though. Eating it would probably leave you with superhuman coding abilities, but a slightly lame lime-green costume with lumps in all the wrong places.
added on the 2011-02-25 11:01:05 by psonice psonice
Radiation is BLUE, damn it! :D Stop watching cartoons with yellow colored fat guys.
http://en.wikipedia.org/wiki/Cherenkov_radiation
added on the 2011-02-25 11:22:12 by las las
(hmm btw don't those pictures in the wikipedia article remind one of using the iteration step for glow... seems real-life does raymarching too!)
added on the 2011-02-25 11:24:51 by las las
Cool, didn't know about that :) Nice glow fx in those reactors!
added on the 2011-02-25 11:36:50 by psonice psonice
las: No, they don't. They look like the integral over the distance traveled before a surface was hit, i.e fog.
added on the 2011-02-25 11:48:44 by kusma kusma
iteration glow is for lamaz who cant raytrace properly! =)
added on the 2011-02-25 12:13:47 by unc unc
kusma: except that it's the distance travelled from the object, not the camera.. which is more like iteration glow than fog :)
added on the 2011-02-25 12:24:52 by psonice psonice
psonice: how is that more similar? fog just "assumes" that the radiation is constant, whereas iteration glow "assumes" there's more radiation close to any surface. Which is a bullshit assumption. But raytracing distance fields can be used to calculate this quite closely, but iteration-glow is NOT the solution. And no, it doesn't look the same. At all.
added on the 2011-02-25 12:30:04 by kusma kusma
neither are 'right', but i think iteration glow is closer because the glow is more intense closer to the reactor (which is generating it, and it's spreading out with inverse square..)

Anyway, why the fuck are we discussing glow around reactor cores? :D
added on the 2011-02-25 12:59:08 by psonice psonice
I guess it's my fault ;)
KEEP MARCHING.
added on the 2011-02-25 13:09:13 by las las
You can add a conditinal to the raymarching loop to bail out when the ray is really close to an object. In my case I get changing, but a tad better framerates...
Code: for(i =0.; i<1. && l>.00001; i+=1.0/maxSteps){ l = field(p); p += (l * d * .5); }
added on the 2011-02-25 20:12:41 by raer raer

login