To implement reflections based on cubemaps we just need to evaluate the reflected vectorR and use it to fetch the texel from the cubemapCubeMapusing the available texture lookup functiontexCUBE:
float4 col = texCUBE(CubeMap, R); |
Expression 1. |
Figure 3: Reflections based on infinite cubemaps. |
With this approach we can only reproduce reflections correctly from a distant environment where the cubemap position is not relevant. This simple and effective technique is mainly used in outdoor lighting, for example, to add reflections of the sky. If we try to use this technique in a local environment we get inaccurate reflections.
local cubemap & infinite cubemap
https://www.youtube.com/watch?v=Oq0dKSHzfAU
http://www.gamasutra.com/blogs/RobertoLopezMendez/20160115/263574/Reflections_Based_on_Local_Cubemaps_in_Unity.php
http://malideveloper.arm.com/downloads/ImplementingReflectionsinUnityUsingLocalCubemaps.pdf
https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
https://seblagarde.wordpress.com/2012/11/28/siggraph-2012-talk/
https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/
https://docs.unity3d.com/540/Documentation/Manual/SL-VertexFragmentShaderExamples.html
http://catlikecoding.com/unity/tutorials/rendering/part-8/Rendering-8.pdf
http://catlikecoding.com/unity/tutorials/rendering/part-8/
http://catlikecoding.com/unity/tutorials/
Having a lot of cubemaps require a lot of storage. Unlike irradiance cubemap which can be very low resolution (16x16x6 or 8x8x6) a specular cubemap is rather middle resolution (64x64x6 or 128x128x6). Higher resolution (256x256x6 or 512x512x6) may even be required for mirror objects. This section will discuss some methods to help with the memory footprint of cubemaps.
https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/
https://docs.unity3d.com/Manual/UsingReflectionProbes.html
http://catlikecoding.com/unity/tutorials/rendering/part-8/
https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/PlanarReflections/
http://malideveloper.arm.com/downloads/ImplementingReflectionsinUnityUsingLocalCubemaps.pdf
https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity