浏览代码

Add a random offset to the ray marching algorithm

/sample_game
Evgenii Golubev 7 年前
当前提交
6e212a8c
共有 6 个文件被更改,包括 17 次插入14 次删除
  1. 2
      Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl
  2. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  3. 7
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Volumetrics/Resources/VolumetricLighting.compute
  4. 10
      Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Random.hlsl.meta
  5. 10
      Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Noise.hlsl.meta
  6. 0
      /Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Random.hlsl

2
Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl


#endif
#include "API/Validate.hlsl"
#include "Noise.hlsl"
#include "Random.hlsl"
// Some shader compiler don't support to do multiple ## for concatenation inside the same macro, it require an indirection.
// This is the purpose of this macro

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


: "VolumetricLightingAllLights");
hdCamera.SetupComputeShader(m_VolumetricLightingCS, cmd);
// TODO: replace strings with nameIDs.
cmd.SetComputeVectorParam( m_VolumetricLightingCS, HDShaderIDs._Time, Shader.GetGlobalVector(HDShaderIDs._Time));
// Pass clustered light data (if present) into the compute shader.
m_LightLoop.PushGlobalParams(hdCamera.camera, cmd, m_VolumetricLightingCS, m_VolumetricLightingKernel, true);

7
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Volumetrics/Resources/VolumetricLighting.compute


float maxDepthVS = posInput.depthVS;
float du = rcp(numSteps); // Compile-time constant
float u0 = 0.5 * du; // Compile-time constant
// Note: we are already using 'unPositionSS' for randomization of LODDitheringTransition().
float zeta = GenerateHashedRandomFloat(posInput.unPositionSS.yx);
float du = rcp(numSteps);
float u0 = 0.25 * du + 0.5 * du * zeta;
float dt = du * ray.maxLength;
float3 radiance = 0;

10
Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Random.hlsl.meta


fileFormatVersion: 2
guid: 11914c30949383848ab39385375eff34
timeCreated: 1504012042
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

10
Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Noise.hlsl.meta


fileFormatVersion: 2
guid: 5918bc8b07f593546974c1961387db77
timeCreated: 1501167559
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

/Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Noise.hlsl → /Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Random.hlsl

正在加载...
取消
保存