浏览代码

Remove redundant operations

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

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


float lightPdf = 0.0; // Pdf of the light sample
float2 u = Hammersley2d(i, sampleCount);
u = frac(u + randNum + 0.5);
u = frac(u + randNum);
float4x4 localToWorld = float4x4(float4(lightData.right, 0.0), float4(lightData.up, 0.0), float4(lightData.forward, 0.0), float4(lightData.positionWS, 1.0));

for (uint i = 0; i < sampleCount; ++i)
{
float2 u = Hammersley2d(i, sampleCount);
u = frac(u + randNum + 0.5);
u = frac(u + randNum);
float3 L;
float NdotL;

for (uint i = 0; i < sampleCount; ++i)
{
float2 u = Hammersley2d(i, sampleCount);
u = frac(u + randNum + 0.5);
u = frac(u + randNum);
float3 L;
float NdotL;

float NdotV = GetShiftedNdotV(N, V, false);
float3 acc = float3(0.0, 0.0, 0.0);
// Add some jittering on Hammersley2d
float2 randNum = InitRandom(V.xy * 0.5 + 0.5);

u = frac(u + randNum + 0.5);
u = frac(u + randNum);
float VdotH;
float NdotL;

2
Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl


out float NdotL)
{
// Cosine sampling - ref: http://www.rorydriscoll.com/2009/01/07/better-sampling/
float cosTheta = sqrt(saturate(1.0 - u.x));
float cosTheta = sqrt(1.0 - u.x);
float sinTheta = sqrt(u.x);
float phi = TWO_PI * u.y;

正在加载...
取消
保存