Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Experimenting with the HDR shader

Featured Replies

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

PC specs: i5-12400F, RTX 3070 Ti and 32 GB of RAM.

Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.

  • Author

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: i5-12400F, RTX 3070 Ti and 32 GB of RAM.

Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.

What is a GLSL background?

Gigabyte x670 Aorus Elite AX MB; AMD 7800X3D CPU; Deepcool LT520 AIO Cooler; 64 Gb G.Skill Trident Z5 NEO DDR5 6000; Win11 Pro; P3D V5.4; 1 Samsung 990 2Tb NVMe SSD: 1 Crucial 4Tb MX500 SATA SSD; 1 Samsung 860 1Tb SSD; Gigabyte Aorus Extreme 1080ti 11Gb VRAM; Toshiba 43" LED TV @ 4k; Honeycomb Bravo.

 

  • Author
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: i5-12400F, RTX 3070 Ti and 32 GB of RAM.

Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.

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

Gigabyte x670 Aorus Elite AX MB; AMD 7800X3D CPU; Deepcool LT520 AIO Cooler; 64 Gb G.Skill Trident Z5 NEO DDR5 6000; Win11 Pro; P3D V5.4; 1 Samsung 990 2Tb NVMe SSD: 1 Crucial 4Tb MX500 SATA SSD; 1 Samsung 860 1Tb SSD; Gigabyte Aorus Extreme 1080ti 11Gb VRAM; Toshiba 43" LED TV @ 4k; Honeycomb Bravo.

 

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

Adrian

  • Author

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: i5-12400F, RTX 3070 Ti and 32 GB of RAM.

Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.

  • Author
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: i5-12400F, RTX 3070 Ti and 32 GB of RAM.

Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.

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 🙂 

Adrian

  • Author
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: i5-12400F, RTX 3070 Ti and 32 GB of RAM.

Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.

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

Adrian

  • Author
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: i5-12400F, RTX 3070 Ti and 32 GB of RAM.

Simulators I'm using: X-Plane 12, Microsoft Flight Simulator (2020) and FlightGear.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.