ED Forums

ED Forums (https://forums.eagle.ru/index.php)
-   Mods and Apps (https://forums.eagle.ru/forumdisplay.php?f=89)
-   -   Help please - Is there a Depth Map (shader/texture) accessible from cockpit view (https://forums.eagle.ru/showthread.php?t=160991)

tacca 02-19-2016 09:51 AM

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).

http://i763.photobucket.com/albums/x...219_180959.jpg http://i763.photobucket.com/albums/x...218_175429.jpg http://i763.photobucket.com/albums/x...219_181012.jpg


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

Weltensegler 02-25-2016 10:57 PM

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.

tacca 02-27-2016 12:52 AM

Quote:

Originally Posted by Weltensegler (Post 2691730)
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 (Post 2691730)
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.


All times are GMT. The time now is 04:30 AM.

Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.