image based lighting - reflection

来源:互联网 发布:刘邦打仗知乎 编辑:程序博客网 时间:2024/04/30 06:21

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


  • unity_SpecCube0 contains data for the active reflection probe.
  • UNITY_SAMPLE_TEXCUBE is a built-in macro to sample a cubemap. Most regular cubemaps are declared and used using standard HLSL syntax (samplerCUBE andtexCUBE), however the reflection probe cubemaps in Unity are declared in a special way to save on sampler slots. If you don’t know what that is, don’t worry, just know that in order to useunity_SpecCube0 cubemap you have to useUNITY_SAMPLE_TEXCUBE macro.

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






0 0
原创粉丝点击