Forum

Finally nailed how to capture and render the depth buffer

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Finally nailed how to capture and render the depth buffer

Postby revelator » Mon Oct 13, 2014 5:20 pm

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 :)
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2518
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Finally nailed how to capture and render the depth buffe

Postby Baker » Mon Oct 13, 2014 5:27 pm

Now that is some interesting stuff :D
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3660
Joined: Tue Mar 14, 2006 5:15 am

Re: Finally nailed how to capture and render the depth buffe

Postby revelator » Tue Oct 14, 2014 2:06 am

:) many sleepless but productive nights.
Next step FBO's and getting rid of the old opengl 1.4 calls.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2518
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Finally nailed how to capture and render the depth buffe

Postby revelator » Fri Oct 17, 2014 2:03 am

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 :S damn i hope im not to old to learn new stuff heh.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2518
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Finally nailed how to capture and render the depth buffe

Postby Baker » Fri Oct 17, 2014 2:50 am

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?
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3660
Joined: Tue Mar 14, 2006 5:15 am

Re: Finally nailed how to capture and render the depth buffe

Postby revelator » Fri Oct 17, 2014 9:08 am

Productivity is a state of mind.
User avatar
revelator
 
Posts: 2518
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Finally nailed how to capture and render the depth buffe

Postby jitspoe » Thu Mar 05, 2015 2:11 am

revelator wrote:http://www.youtube.com/watch?feature=player_embedded&v=kvdzFWCGpKA

steves demo :) look at the tablet ;)

That's pretty awesome!
jitspoe
 
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Re: Finally nailed how to capture and render the depth buffe

Postby Tr3B » Sat Mar 07, 2015 2:37 pm

Couldn't you just rip the _currentDepth code from the BFG renderer?
Tr3B
 
Posts: 15
Joined: Tue May 13, 2014 2:24 pm

Re: Finally nailed how to capture and render the depth buffe

Postby revelator » Fri Sep 11, 2015 7:55 am

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.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2518
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest