Page 1 of 1
Finally nailed how to capture and render the depth buffer
Posted: Mon Oct 13, 2014 5:20 pm
by revelator
Took quite some work but we have it down now
With some help from SteveL at the darkmod forums we finally nailed how to access and render to the depthbuffer in vanilla,
as a result a whole slew of new options turned up, not only related to SSAO but also soft particles, and fixing corruption on water reflections.
The thread covering this over at the darkmods forum are literally buzzing with activity
and SteveL has allready made several demos to show of the new effects.
For a walkthrough on how to get the depthbuffer code in vanilla look at my revelation test thread in the general forums (somewhere close to the end of the thread).
Ill post a cleaned up tutorial soon when i get some free time
Re: Finally nailed how to capture and render the depth buffe
Posted: Mon Oct 13, 2014 5:27 pm
by Baker
Now that is some interesting stuff
Re: Finally nailed how to capture and render the depth buffe
Posted: Tue Oct 14, 2014 2:06 am
by revelator
many sleepless but productive nights.
Next step FBO's and getting rid of the old opengl 1.4 calls.
Re: Finally nailed how to capture and render the depth buffe
Posted: Fri Oct 17, 2014 2:03 am
by revelator
Still at it though steve is not home atm, he still posts new ideas on how to use the new functionality
Also looking at other options atm. Parralax occlusion mapping / splitting up the interactions / programmable ambient lighting.
Problem with splitting up the interactions might break compatibility with vanilla though so we have to supply new shaders in case we want to keep compatibility
vanilla will look very much improved as a result though.
We kinda stepped back from GLSL atm as ARB2 works just fine with the current options, its still planned sometime though.
Might have to learn how to write material shaders so i can test out stuff
damn i hope im not to old to learn new stuff heh.
Re: Finally nailed how to capture and render the depth buffe
Posted: Fri Oct 17, 2014 2:50 am
by Baker
Code: Select all
!!ARBvp1.0
OPTION ARB_position_invariant;
MOV result.texcoord, vertex.texcoord;
END
!!ARBfp1.0
PARAM clipPlanes = { 0.4, 350.0 };
TEMP dpth, col, rng;
TEX dpth, fragment.texcoord, texture[0], 2D;
ADD rng.x, clipPlanes.y, -clipPlanes.x;
MUL col.x, dpth.x, rng.x;
ADD col.x, -col.x, clipPlanes.x;
ADD col.x, col.x, clipPlanes.y;
RCP rng.x, col.x;
MUL col.x, rng.x, clipPlanes.x;
MUL col.x, col.x, 2.0;
MOV result.color.r, col.x;
MOV result.color.g, col.x;
MOV result.color.b, col.x;
MOV result.color.a, 1.0;
END
Any screenshots of what this looks like, say in gray-scale?
Re: Finally nailed how to capture and render the depth buffe
Posted: Fri Oct 17, 2014 9:08 am
by revelator
Re: Finally nailed how to capture and render the depth buffe
Posted: Thu Mar 05, 2015 2:11 am
by jitspoe
Re: Finally nailed how to capture and render the depth buffe
Posted: Sat Mar 07, 2015 2:37 pm
by Tr3B
Couldn't you just rip the _currentDepth code from the BFG renderer?
Re: Finally nailed how to capture and render the depth buffe
Posted: Fri Sep 11, 2015 7:55 am
by revelator
i actually based parts of my code on the bfg version allthough i had to hunt down where things would fit in the old vanilla render, some parts are rather different in BFG.
Latest code seems to work quite nicely allthough i really need someone who can rewrite sikkpins SSAO shader to make use of the new functionality.
But atleast my work is now part of the darkmod engine
so i might get lucky.