浏览代码

Correct angle attenuation

/main
sebastienlagarde 8 年前
当前提交
bb7bf965
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 10
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 2
      Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl

10
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


PunctualLightData l = new PunctualLightData();
l.positionWS = lightToWorld.GetColumn(3);
l.positionWS = light.light.transform.position;
l.forward = lightToWorld.GetColumn(0);
l.up = lightToWorld.GetColumn(1);
l.right = lightToWorld.GetColumn(2);
// Light direction is opposite to the forward direction...
l.forward = -light.light.transform.forward;
// CAUTION: For IES as we inverse forward maybe this will need rotation.
l.up = light.light.transform.up;
l.right = light.light.transform.right;
l.diffuseScale = 1.0f;
l.specularScale = 1.0f;

2
Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl


// These structures need to be align on float4 to respectect various packing rules from sahder language.
// This mean that these structure need to be padded.
// Do not use "in", only "out" or "inout" as califier, not "inline" keyword either, useless.
// Include language header
#if defined(SHADER_API_D3D11)

正在加载...
取消
保存