Ue4管线中的灯光信息

http://www.tomlooman.com/disneyfaciliershadow/

看了这篇Blog我有了一个惊喜的发现:

float4 GetPerPixelLightAttenuation(float2 UV)
{
return Square(Texture2DSampleLevel(LightAttenuationTexture, LightAttenuationTextureSampler, UV, 0));
}

这个函数可以获得光照信息,这样很多效果都可以实现了。

测试了一下,这个效果只能在forward redner下使用。

原文地址:https://www.cnblogs.com/blueroses/p/6991696.html