Implementing dual paraboloid environment mapping
For this recipe, we extend the geometry shader's instancing approach to create environment maps that were introduced in the previous recipe, Implementing multithreaded cubic environment mapping, and generate a dual paraboloid environment map. A dual paraboloid map (DPM) requires only two render targets instead of the six used in the cube maps, therefore requiring less texture memory. However, there is also no built-in hardware support for sampling a DPM that instead requires a manual implementation of the sampling based on the reflection vector.
Getting ready
We will start with the finished result from the previous recipe, Implementing multithreaded cubic environment mapping.
How to do it…
In order to generate the dual paraboloid map, we will apply geometry instancing and fill two render targets. To sample the environment map for reflections, we will implement a new HLSL function that determines the location and the texture (half of the DPM) to...