浏览代码

Addressed PR's comments.

/main
Felipe Lira 7 年前
当前提交
5bdadbbe
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 5
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl
  2. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Shadows.hlsl

5
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl


half4 GetLightDirectionAndAttenuation(LightInput lightInput, float3 positionWS)
{
half4 directionAndAttenuation;
float3 posToLightVec = lightInput.position.xyz - positionWS.xyz * lightInput.position.w;
float3 posToLightVec = lightInput.position.xyz - positionWS * lightInput.position.w;
float distanceSqr = max(dot(posToLightVec, posToLightVec), FLT_MIN);
directionAndAttenuation.xyz = half3(posToLightVec * rsqrt(distanceSqr));

Light GetMainLight()
{
Light light = (Light)0;
Light light;
light.index = 0;
light.direction = _MainLightPosition.xyz;
light.attenuation = 1.0;
light.subtractiveModeAttenuation = _MainLightPosition.w;

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Shadows.hlsl


half4 shadowOffset1;
half4 shadowOffset2;
half4 shadowOffset3;
half4 shadowmapSize;
float4 shadowmapSize;
};
ShadowSamplingData GetMainLightShadowSamplingData()

正在加载...
取消
保存