浏览代码

Remove redundant operations

/main
Evgenii Golubev 8 年前
当前提交
f00d20dd
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 4
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 3
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl

4
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


var directionalLightData = new DirectionalLightData();
// Light direction for directional and is opposite to the forward direction
directionalLightData.direction = -light.light.transform.forward;
directionalLightData.up = -light.light.transform.up;
directionalLightData.right = -light.light.transform.right;
directionalLightData.up = light.light.transform.up;
directionalLightData.right = light.light.transform.right;
directionalLightData.positionWS = light.light.transform.position;
directionalLightData.color = new Vector3(lightColorR, lightColorG, lightColorB);
directionalLightData.diffuseScale = additionalData.affectDiffuse ? 1.0f : 0.0f;

3
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl


float3 unL = positionWS - lightData.positionWS;
// Project 'unL' onto the light's axes.
float3 right = cross(lightData.up, lightData.direction);
float2 coord = float2(dot(unL, right), dot(unL, lightData.up));
float2 coord = float2(dot(unL, lightData.right), dot(unL, lightData.up));
// Rescale the texture.
coord.x *= lightData.invScaleX;

正在加载...
取消
保存