Help please - Is there a Depth Map (shader/texture) accessible from cockpit view - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 02-19-2016, 08:51 AM   #1
tacca
Member
 
tacca's Avatar
 
Join Date: Apr 2014
Location: Australia
Posts: 129
Default Help please - Is there a Depth Map (shader/texture) accessible from cockpit view

Hey Everyone

So I've come back to my NVG mod after a month or so break to try and access the Depth Map (used for the DOF effect in F2 view etc) to enable a Depth of field within the NVG.

The break has been good since after only an hour or 2 of playing with the post effect codes I isolated the Depth Map within the DOF.fx shader and also came close to linearising it without have any of the world or camera view matrix's usually needed (see pics).




Now my big issue is no matter what I try I cant access the same depth map while in the cockpit view. I tried copying the DOF code straight into the nvd.fx shader while changing the technique name to the appropriate NVG one (FinalPass, which I also tested with some basic coloured shader code to make sure the basics were right) and for the life of me I cant get any depth Data

So, as my title asks, does anyone if a depth map exists for within the cockpit view that can be accessed from the NVG shader?

A gentleman on this thread http://steamcommunity.com/app/223750...74088392509651 is adamant that there is one but I'm not entirely sure.

Lots of thanks in advance
Frenchy
tacca is offline   Reply With Quote
Old 02-25-2016, 09:57 PM   #2
Weltensegler
Member
 
Weltensegler's Avatar
 
Join Date: Nov 2009
Location: Santa Monica/Venice Beach
Posts: 639
Default

I don't know the answer but I assume there is currently no Z-buffer for in cockpit. According to performance increase and decrease between cockpit and external views (and simple visual judgment) there is no such effect coded for cockpit view unless ED did so but disabled it because it adds too much of a performance hit within the cockpit. Which of course I hope is the case

Maybe you can look into the DoF lua and figure out how its done to apply it to cockpit view. Possible though its calculation could still hit fps badly.
__________________
4790K@4,6Ghz | EVGA Z97 Classified | 32GB @ 2400Mhz | Titan X hydro copper| SSD 850 PRO
____________________________________
Moments in DCS:
--> https://www.youtube.com/user/weltensegLA
--> https://www.twitch.tv/weltensegler

WELD's cockpit: --> http://forums.eagle.ru/showthread.php?t=92274
Weltensegler is offline   Reply With Quote
Old 02-26-2016, 11:52 PM   #3
tacca
Member
 
tacca's Avatar
 
Join Date: Apr 2014
Location: Australia
Posts: 129
Default

Quote:
Originally Posted by Weltensegler View Post
I don't know the answer but I assume there is currently no Z-buffer for in cockpit. According to performance increase and decrease between cockpit and external views (and simple visual judgment) there is no such effect coded for cockpit view unless ED did so but disabled it because it adds too much of a performance hit within the cockpit. Which of course I hope is the case
Hey Weltensegler.

First off thanks for the response. Depth buffers and view matrix conversions/calculations etc are the bread and butter of graphics cards and MUST be preformed when rendering the scene. Performance wise they have very minimal impact (zero in perceptible terms) but the be data may be dropped from memory at different points in the render pipeline.

Quote:
Originally Posted by Weltensegler View Post
Maybe you can look into the DoF lua and figure out how its done to apply it to cockpit view. Possible though its calculation could still hit fps badly.
As i wrote in my first post this is exactly what I've done (see screen shots). I have extracted the depth buffer when in external view but cant access it in cockpit view. The fact that its there for the external view (and the page i linked) made me hope its there for the cockpit render pipeline but maybe called something else

Again, the performance impact you see when the DOF effect is applied is because of the DOF shader, not the depth buffer itself. The DOF effect depending on parameters can run up to 150 samples of nearby pixels for each and every pixel rendered to your screen hence the noticeable impact on fps (its coded well for realism but not for performance).
Many games have a very efficient and effective DOF code that journal papers etc have been written on.
See here https://developer.nvidia.com/gpugems...ems3_ch28.html for a great example.

Last edited by tacca; 02-27-2016 at 12:01 AM.
tacca is offline   Reply With Quote
Reply

Tags
buffer, depth, map, z buffer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 11:26 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.