-
-
Notifications
You must be signed in to change notification settings - Fork 198
Added AOV output support to the Raymarching engine #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added AOV output support to the Raymarching engine #188
Conversation
Omg! brillant! this open the door for SO many fun stuff! |
st.x = 1.0 - st.x; | ||
|
||
#if defined(RAYMARCH_MULTISAMPLE) | ||
vec4 color = vec4(0.0); | ||
eyeDepth = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to 0.0
older versions of GLSL don't do implicit casting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh, sorry. Keep forgetting about this, as I'm testing under OpenGL 4.5 and Unity, but not WebGL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good! I'm sorry to bring it up later. I will do my part better and watch for those running against OpenGL ES 2.0 (you can't get older than that : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! Just PRed a fix.
vec2 pixel = 1.0/RESOLUTION; | ||
vec2 offset = rotate( vec2(0.5, 0.0), HALF_PI/4.); | ||
|
||
for (int i = 0; i < RAYMARCH_MULTISAMPLE; i++) { | ||
vec3 rd = ca * normalize(vec3((st + offset * pixel)*2.0-1.0, fov)); | ||
color += RAYMARCH_RENDER_FNC( camera, rd); | ||
float sampleDepth = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.0
Added AOV (Arbitrary Output Variables) output support to the Raymarching engine.
These additional buffers are very useful for post-processing passes. And the good news: they come almost for free, as raymarching already provides us with this data!
We now have:
Color

Alpha

Eye Depth

World Position

World Normals

And finally, to illustrate, some DOF fun using the Eye Depth AOV and Lygia's sample/dof