Jump to content

BiologicalNanobot

Experimenting with the HDR shader

Recommended Posts

Hi,

I find the HDR mode colors extremely oversaturated, and given that EA works best with HDR, I've decided to experiment with the shaders. Looking at the HDR shader (ShadersHLSL/PostProcess/HDR.hlsl inside Prepar3D's main installation directory), it looks like P3D is using ACES tonemapping, which unsurprisingly oversaturates everything.

So, I've replaced the tonemapping function with several others (Uncharted 2, Reinhard and Exponential), which have a more filmic and less saturated look. Sadly, I don't have access to my main PC which has P3D installed right now, and I won't have access for several days.

But I was quite impatient and therefore decided to post the modified shader files - is anyone willing to test them and send comparison screenshots? I would be really appreciated.

Regardless, here is the default HDR shader of v5.0 HF2 (credits to @xTiMm_), please compare it with the one from v5.1 HF1 before using: https://hastebin.com/tenumiyiha.cpp

And here are the modified HDR shaders with new tonemapping functions:

Uncharted 2: https://hastebin.com/helinunaga.cpp (You might need to adjust the white point, see the comment on line 70 for more details)

Reinhard: https://hastebin.com/aqayozasib.cpp

Exponential: https://hastebin.com/udotoqazoq.cpp

Installation instructions:

Backup the default ShadersHLSL/PostProcess/HDR.hlsl inside the main installation directory.

Open the HDR.hlsl with a text editor like Notepad and replace the contents of it with the modified shader you want.

Launch P3D and enable HDR if you haven't.

Edited by BiologicalNanobot
  • Like 1
  • Upvote 1

PC Specs: i7-6700, GTX 1070 and 16 GB of RAM.

Simulators I'm Using: X-Plane 11, Prepar3D v5 and Microsoft Flight Simulator (2020).

Share this post


Link to post

Also, I mostly have a GLSL background instead of HLSL, so I'm not even sure if the modified shaders actually compile. Could a developer like @simbol check the syntax? I'd be really thankful.


PC Specs: i7-6700, GTX 1070 and 16 GB of RAM.

Simulators I'm Using: X-Plane 11, Prepar3D v5 and Microsoft Flight Simulator (2020).

Share this post


Link to post

What is a GLSL background?


Gigabyte Z97X-UD5H-BK, Blk Ed MB; Intel I7-4790K CPU (@4.5 Ghz); Deepcool 240 AIO Cooler; 16 Gb G.Skill RAM (F3-2400); Win10 Pro (P3D V5 HF2); 2 Samsung 1Tb SSDs;Toshiba 3Tb hard drive; Gigabyte Aorus Extreme 1080ti 11Gb VRAM; Toshiba 43" LED TV @ 4k;

 

Share this post


Link to post
13 minutes ago, pgde said:

What is a GLSL background?

OpenGL's shader language, it has slight differences to HLSL. In other words, I mostly code in GLSL and not HLSL. I've almost never coded in HLSL but I'm assuming it's quite close to GLSL.

Edited by BiologicalNanobot

PC Specs: i7-6700, GTX 1070 and 16 GB of RAM.

Simulators I'm Using: X-Plane 11, Prepar3D v5 and Microsoft Flight Simulator (2020).

Share this post


Link to post

Thanks for the info! That was one acronym I couldn't decipher!

  • Like 1

Gigabyte Z97X-UD5H-BK, Blk Ed MB; Intel I7-4790K CPU (@4.5 Ghz); Deepcool 240 AIO Cooler; 16 Gb G.Skill RAM (F3-2400); Win10 Pro (P3D V5 HF2); 2 Samsung 1Tb SSDs;Toshiba 3Tb hard drive; Gigabyte Aorus Extreme 1080ti 11Gb VRAM; Toshiba 43" LED TV @ 4k;

 

Share this post


Link to post
Quote

Uncharted 2: https://hastebin.com/helinunaga.cpp (You might need to adjust the white point, see the comment on line 70 for more details)

Reinhard: https://hastebin.com/aqayozasib.cpp

Exponential: https://hastebin.com/udotoqazoq.cpp

First one: I have black screen only. See nothing but can click buttons in cockpit

Second one: the same black screen

Third one: CTD during loading flight

Edited by AdiR
  • Like 1

Adrian

Share this post


Link to post

Black screen usually means the shader has failed to compile, so I guess I made a mistake. Do you have a log or something that shows the issue?

Edited by BiologicalNanobot

PC Specs: i7-6700, GTX 1070 and 16 GB of RAM.

Simulators I'm Using: X-Plane 11, Prepar3D v5 and Microsoft Flight Simulator (2020).

Share this post


Link to post
8 minutes ago, AdiR said:

First one: I have black screen only. See nothing but can click buttons in cockpit

Second one: the same black screen

Third one: CTD during loading flight

Just to make sure, could you send a screenshot of the modified HDR.glsl opened on Notepad or something else? I suspect you might've copied the line numbers as well.


PC Specs: i7-6700, GTX 1070 and 16 GB of RAM.

Simulators I'm Using: X-Plane 11, Prepar3D v5 and Microsoft Flight Simulator (2020).

Share this post


Link to post
31 minutes ago, BiologicalNanobot said:

Just to make sure, could you send a screenshot of the modified HDR.glsl opened on Notepad or something else? I suspect you might've copied the line numbers as well.

No line numbers for sure (can't check it right now cause I'm already in my bed  but I'm pretty sure as I write php code for web apps and rather don't make such kind of mistakes 😉).

Will try once again tomorrow 🙂 

  • Like 1

Adrian

Share this post


Link to post
14 hours ago, AdiR said:

No line numbers for sure (can't check it right now cause I'm already in my bed  but I'm pretty sure as I write php code for web apps and rather don't make such kind of mistakes 😉).

Will try once again tomorrow 🙂 

Oh, that's sad... Sadly I'm a GLSL guy and not sure what's wrong with the code. Just to make sure, what P3D version do you have? Could you upload your default HDR.hlsl to Hastebin? Thank you.


PC Specs: i7-6700, GTX 1070 and 16 GB of RAM.

Simulators I'm Using: X-Plane 11, Prepar3D v5 and Microsoft Flight Simulator (2020).

Share this post


Link to post
6 hours ago, BiologicalNanobot said:

Oh, that's sad... Sadly I'm a GLSL guy and not sure what's wrong with the code. Just to make sure, what P3D version do you have? Could you upload your default HDR.hlsl to Hastebin? Thank you.

  1. P3Dv5.1HF1
  2. https://pastebin.com/fS8R1MUq
Edited by AdiR
  • Like 1

Adrian

Share this post


Link to post
13 minutes ago, AdiR said:

This explains the issue... I got the shaders from v5.0 HF2 and it looks like v5.1 HF1 HDR shader seems to be different than v5.0 HF2 one.

Edited by BiologicalNanobot

PC Specs: i7-6700, GTX 1070 and 16 GB of RAM.

Simulators I'm Using: X-Plane 11, Prepar3D v5 and Microsoft Flight Simulator (2020).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    34%
    $8,560.00 of $25,000.00 Donate Now
×
×
  • Create New...