WiseHDR: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 5: Line 5:
''(Porter's note: About half of the original tutorial by wisemx was left out of this port because it was basically an exact copy of the [[HDR Lighting Basics]] page.)''
''(Porter's note: About half of the original tutorial by wisemx was left out of this port because it was basically an exact copy of the [[HDR Lighting Basics]] page.)''


==DOD:S Example==
=={{dods|4}} Example==
Let’s examine the Source SDK HDR example map from Day of Defeat: Source, step by step. Even if you don't have DOD:S this file is part of the updated Source SDK, you can open it in Hammer with the CS:S parameters. The map is <code>common\sourcesdk_content\dod\mapsrc\sdk_example_hdr.vmf</code>.
Let’s examine the Source SDK HDR example map from {{dods|3.1}} step by step. Even if you don't have DOD:S this file is part of the updated Source SDK, you can open it in Hammer with the CS:S parameters. The map is {{path|common\sourcesdk_content\dod\mapsrc\sdk_example_hdr.vmf}}.


<code>[[light_environment]]</code>:
{{ent|light_environment}}:
*'''Pitch Yaw Roll''': 0 165 0
*'''Pitch Yaw Roll''': 0 165 0
*'''Pitch''': -40
*'''Pitch''': -40
Line 18: Line 18:
[[Skybox]] Texture Name: <code>sdk_sky_example_hdr</code>
[[Skybox]] Texture Name: <code>sdk_sky_example_hdr</code>


<code>[[env_tonemap_controller]]</code>:
{{ent|env_tonemap_controller}}:
*'''Name''': tonemap
*'''Name''': tonemap
:This entity is give a name so it can be called via [[inputs]]. There are 9 inputs in the example <code>env_tonemap_controller</code>. Three of the inputs set the initial HDR exposures when the map starts via a <code>[[logic_auto]]</code>. The remaining 6 Inputs are 2 groups of 3 Inputs from triggers.
:This entity is give a name so it can be called via [[inputs]]. There are 9 inputs in the example <code>env_tonemap_controller</code>. Three of the inputs set the initial HDR exposures when the map starts via a <code>[[logic_auto]]</code>. The remaining 6 Inputs are 2 groups of 3 Inputs from triggers.


<code>logic_auto</code>:
{{ent|logic_auto}}:
{| {{OutputsTable}}
{| {{OutputsTable}}
| [[File:Io11.png]] || OnMapSpawn || tonemap || SetAutoExposureMax || 2 || 0.00 || No
| [[File:Io11.png]] || OnMapSpawn || tonemap || SetAutoExposureMax || 2 || 0.00 || No
Line 51: Line 51:
|}
|}


Notice the height of the <code>[[env_cubemap]]</code> inside the sample building. This will often be important when you build cubemaps with the <code>[[buildcubemaps]]</code> console command in relation to the height of windows as an example.
Notice the height of the {{ent|env_cubemap}} inside the sample building. This will often be important when you build cubemaps with the {{command|buildcubemaps}} console command in relation to the height of windows for example.


Lastly notice the dev reflectivity materials are used. These are great tools for both testing and achieving lighting effects. You can for example use the material <code>dev/reflectivity_30</code> on a <code>[[func_illusionary]]</code> for a light-at-the-end-of-the-tunnel effect, even without HDR enabled.
Lastly, notice the dev reflectivity materials are used. These are great tools for both testing and achieving lighting effects. You can for example use the material <code>dev/reflectivity_30</code> on a {{ent|func_illusionary}} for a light-at-the-end-of-the-tunnel effect, even without HDR enabled.


==Final Notes==
==Final Notes==
Open the DOD:S sample map <code>sdk_dod_flash</code>. (In the same folder as the HDR sample.) Notice the 15 <code>[[info_lighting]]</code> entities used in this map. These are used to change the lighting origin of a <code>[[prop_static]]</code>. To use these simply place an <code>info_lighting</code> in the spot where you want to change the lighting origin for a <code>prop_static</code>. Then in that <code>prop_static</code> set the name of the <code>info_lighting</code> in the '''Lighting Origin''' property. Also notice there are only 3 inputs in the <code>env_tonemap_controller</code> for this map. The '''Exposure Max''', '''Min''' and '''Bloom Scale''' are all set once when the map spawns.
Open the DOD:S sample map <code>sdk_dod_flash</code>. (In the same folder as the HDR sample.) Notice the 15 {{ent|info_lighting}} entities used in this map. These are used to change the lighting origin of a {{ent|prop_static}}. To use these simply place an <code>info_lighting</code> in the spot where you want to change the lighting origin for a <code>prop_static</code>. Then in that <code>prop_static</code> set the name of the <code>info_lighting</code> in the '''Lighting Origin''' property. Also notice there are only 3 inputs in the <code>env_tonemap_controller</code> for this map. The '''Exposure Max''', '''Min''' and '''Bloom Scale''' are all set once when the map spawns.

Latest revision as of 09:21, 16 April 2024


This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.

(Porter's note: About half of the original tutorial by wisemx was left out of this port because it was basically an exact copy of the HDR Lighting Basics page.)

Day of Defeat: Source Day of Defeat: Source Example

Let’s examine the Source SDK HDR example map from Day of Defeat: Source step by step. Even if you don't have DOD:S this file is part of the updated Source SDK, you can open it in Hammer with the CS:S parameters. The map is 🖿common\sourcesdk_content\dod\mapsrc\sdk_example_hdr.vmf.

light_environment:

  • Pitch Yaw Roll: 0 165 0
  • Pitch: -40
  • Brightness: 250 241 192 600
  • Ambient: 209 227 237 200
  • BrightnessHDR: 250 241 192 500
  • AmbientHDR: 209 227 237 200

Skybox Texture Name: sdk_sky_example_hdr

env_tonemap_controller:

  • Name: tonemap
This entity is give a name so it can be called via inputs. There are 9 inputs in the example env_tonemap_controller. Three of the inputs set the initial HDR exposures when the map starts via a logic_auto. The remaining 6 Inputs are 2 groups of 3 Inputs from triggers.

logic_auto:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn tonemap SetAutoExposureMax 2 0.00 No
Io11.png OnMapSpawn tonemap SetAutoExposureMin .8 0.00 No
Io11.png OnMapSpawn tonemap SetBloomScale 1.2 0.00 No

The trigger_multiple entites are not needed but are used to illustrate how you can control the HDR exposure during the game.

Walking into the sample building will trigger these:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn tonemap SetAutoExposureMax 5 0.00 No
Io11.png OnMapSpawn tonemap SetAutoExposureMin 3 0.00 No
Io11.png OnMapSpawn tonemap SetBloomScale 2 0.00 No

Walking out of the sample building will trigger these:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn tonemap SetAutoExposureMax 2 0.00 No
Io11.png OnMapSpawn tonemap SetAutoExposureMin .8 0.00 No
Io11.png OnMapSpawn tonemap SetBloomScale 1 0.00 No

Notice the height of the env_cubemap inside the sample building. This will often be important when you build cubemaps with the buildcubemaps console command in relation to the height of windows for example.

Lastly, notice the dev reflectivity materials are used. These are great tools for both testing and achieving lighting effects. You can for example use the material dev/reflectivity_30 on a func_illusionary for a light-at-the-end-of-the-tunnel effect, even without HDR enabled.

Final Notes

Open the DOD:S sample map sdk_dod_flash. (In the same folder as the HDR sample.) Notice the 15 info_lighting entities used in this map. These are used to change the lighting origin of a prop_static. To use these simply place an info_lighting in the spot where you want to change the lighting origin for a prop_static. Then in that prop_static set the name of the info_lighting in the Lighting Origin property. Also notice there are only 3 inputs in the env_tonemap_controller for this map. The Exposure Max, Min and Bloom Scale are all set once when the map spawns.