Raymarching Beginners' Thread
category: code [glöplog]
las: By the way, great idea for SSS. I really really like it. I think I am gonna steal it! :D However, here's an addition: Instead of sampling on the ray into the geometry you can sample on the inverse of the normalised direction to the light into the geometry. In the end SSS is an approximation of how much light scatters below the surface, so using the inverse of the normalised direction towards the light source would mean you're exactly doing that. :D
Yeah that also works - I prefer the look of that what happens when just following the (refracted) ray direction :)
Quote:
I'm also curious about the Distance Fields Modeling tool.
my 'tool' looks like that:
- create a mini application which opens a render window, listens to some keyboard events with getasynckeystate and has a render loop which checks each frame if a shader source file has changed.
- that shader source file can be opened in any text editor of your choice (i use notepad++ to have syntax highlighting)
and as soon as ctrl-s is pressed to save the file it will be recompiled and shown in the render window.
- add some keys to switch between several techniques/shaders, some play/pause rewind functionality, maybe some camera movement keys which go into the vertex shader and of course a time parameter and you're pretty much set
that costs about 1 hour to implement and is still more flexible than any kind of building blocks within a real fancy tool
That's exactly what one wants - even better than pressing a reload button :D
essentially you dont even need to leave the text editor at all, just find some key combinations which are good for you to use, listen to them in your mini app and make sure they dont trigger some function in the editor :)
vvvv for the masses! It is really comfortable thing, and very powerful
i can share my "framework" setup btw - simple render window + texteditor + simple shader on 2d quad
vvvv (up to 40beta23) has a very nice codeeditor - hlsl highlighting, error messages, pretty much everything you need, and it even may compile shader right after you stop typing <3
i can share my "framework" setup btw - simple render window + texteditor + simple shader on 2d quad
vvvv (up to 40beta23) has a very nice codeeditor - hlsl highlighting, error messages, pretty much everything you need, and it even may compile shader right after you stop typing <3
I use quartz composer on mac. Exactly what unc said, except glsl. It's part of xcode, which is supplied on the OS dvd :)
Additional super-useful stuff in this kind of setup: Plugging LFOs, audio output or whatever into shader inputs for instant animation. Plugging webcam video into a texture input for instant fun. And doing stuff like feedback with a couple of mouse clicks.
I've been writing a lot of shaders this way for iphone apps, even allowing for a little glsl -> glsles conversion productivity is WAY higher.
I'll do a quick example QC file with a simple shader setup if anyone wants one.
Additional super-useful stuff in this kind of setup: Plugging LFOs, audio output or whatever into shader inputs for instant animation. Plugging webcam video into a texture input for instant fun. And doing stuff like feedback with a couple of mouse clicks.
I've been writing a lot of shaders this way for iphone apps, even allowing for a little glsl -> glsles conversion productivity is WAY higher.
I'll do a quick example QC file with a simple shader setup if anyone wants one.
psonice: I'm sure you mean "glsl -> essl"... There's no such thing as "glsles" ;)
I use my old linux codeblocks framework but will switch to windows sooner or later. Visual Studio ftw.
Quote:
Raymarching through volumes? How does that work, is it a volume of distances based off the data-set?
Traditionally we are not talking about the distance field based raymarching but the constant step raymarching into a volume (a 3d texture usually). Remember, the term raymarching has more meanings and distance field is usually attributed to it but it's not the only.
But if you want to use the distance method to accelerate volumes then maybe it's possible to store additional information for each voxel in the volume data that describes the farthest safe radius to jump from that voxel without the possibility to hit any non empty voxel. Your volume data would need to be static in this case and some heavy precalculation maybe. I was discussing this technique with my supervisor for my volume rendering thesis and he told me about this technique in volume rendering after I was discussing with him about the raymarching distance field techniques in the demoscene :)
Quote:
I was discussing this technique with my supervisor for my volume rendering thesis and he told me about this technique in volume rendering after I was discussing with him about the raymarching distance field techniques in the demoscene :)
Confusing. I mean, I was discussing in an irrelevant chat about distance fields and 4k intros, and he came up with the idea to use it specifically in voxels (or I think there were already scientific literature on this). Anyway, fact is I never tried it in practice (as with a lot of other things we were planning to do) :P
unc, i'd be interested in that "framework" (if only to give it a try, i must admit).
Quote:
psonice: I'm sure you mean "glsl -> essl"... There's no such thing as "glsles" ;)
I'll accept your point purely because 'essl' is easier to say than 'glsles' :)
http://www.sendspace.com/file/sl9m6y here is three simple vvvv patches
2d singlepass shader, twopass shader (render to texture, then postprocessing), and a basic raymarcher
to run those, download vvvv_40beta23 @ vvvv.org
2d singlepass shader, twopass shader (render to texture, then postprocessing), and a basic raymarcher
to run those, download vvvv_40beta23 @ vvvv.org
(in raymarcher patch, RMB+mousemove for camera lookaround)
Since we are talking about editors. The one I currently use
Precomputed shader input values in the 'expression' random/beat/noise/.., shader editor with limited intellisense that compiles the shader at each change. No save/build needed. This of course has it's pros and cons.
Precomputed shader input values in the 'expression' random/beat/noise/.., shader editor with limited intellisense that compiles the shader at each change. No save/build needed. This of course has it's pros and cons.
yes, major con with quartz composer: it's easy to crash it with a dodgy shader (especially with these nasty loops in ray marching). Worst case you can take down the graphics driver, meaning a hard reboot is needed.
Seems that Win7 and Ubuntu 10.* are mostly able to recover from a dying nvidia gfx driver.
Using multisampling on a machine with a not so state of the art graphics card might be not a good idea for untested raymarching scenes.
Using multisampling on a machine with a not so state of the art graphics card might be not a good idea for untested raymarching scenes.
/me goes and codes a modified shader recompiler...
It may not be pretty, but it's progress. Lit raymarched sphere:
I'm starting to 'get it' now. Need to get a texture lookup from the sphere next, then... the difficult part, with the transform of the sphere I have in mind :(
I'm starting to 'get it' now. Need to get a texture lookup from the sphere next, then... the difficult part, with the transform of the sphere I have in mind :(
Playing with SSS & AO and some noise.
The SSS looks cute.
Las : make an intro about it !! :)
Las: nice. Bet it looks much better in motion though. Demo or video please :)
Provide me a 1k win32 framework for GLSL or HLSL I will deliver.
If you have what I need - get in contact with me on IRCnet /query las
If you have what I need - get in contact with me on IRCnet /query las