浏览代码

ShaderLibrary: Move Sampling and sequence file into a Sampling folder (to clean a bit the directory)

/feature-ReflectionProbeFit
sebastienlagarde 7 年前
当前提交
33ecd2ca
共有 22 个文件被更改,包括 15 次插入97 次删除
  1. 4
      ScriptableRenderPipeline/Core/Resources/EncodeBC6H.compute
  2. 2
      ScriptableRenderPipeline/Core/ShaderLibrary/ImageBasedLighting.hlsl
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
  4. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  5. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute
  6. 2
      ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMapping.hlsl
  7. 8
      ScriptableRenderPipeline/Core/ShaderLibrary/Sampling.meta
  8. 82
      ScriptableRenderPipeline/Core/ShaderLibrary/Filtering.hlsl
  9. 8
      ScriptableRenderPipeline/Core/ShaderLibrary/Filtering.hlsl.meta
  10. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Sampling.hlsl.meta
  11. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Fibonacci.hlsl.meta
  12. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Hammersley.hlsl.meta
  13. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Fibonacci.hlsl
  14. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Hammersley.hlsl
  15. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingNormalInternal.hlsl.meta
  16. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingInternal.hlsl.meta
  17. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMapping.hlsl.meta
  18. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMapping.hlsl
  19. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingInternal.hlsl
  20. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingNormalInternal.hlsl
  21. 0
      /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Sampling.hlsl

4
ScriptableRenderPipeline/Core/Resources/EncodeBC6H.compute


#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Sampling.hlsl"
#include "ShaderLibrary/Sampling/Sampling.hlsl"
TextureCube<float4> _Source;
RWTexture2DArray<uint4> _Target;

2
ScriptableRenderPipeline/Core/ShaderLibrary/ImageBasedLighting.hlsl


#include "CommonLighting.hlsl"
#include "CommonMaterial.hlsl"
#include "BSDF.hlsl"
#include "Sampling.hlsl"
#include "Sampling/Sampling.hlsl"
#ifndef UNITY_SPECCUBE_LOD_STEPS
#define UNITY_SPECCUBE_LOD_STEPS 6

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl


#include "ShaderLibrary/CommonLighting.hlsl"
#include "ShaderLibrary/CommonShadow.hlsl"
#include "ShaderLibrary/Sampling.hlsl"
#include "ShaderLibrary/Sampling/Sampling.hlsl"
#include "ShaderLibrary/AreaLighting.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


//-------------------------------------------------------------------------------------
// Fill SurfaceData/Builtin data function
//-------------------------------------------------------------------------------------
#include "ShaderLibrary/SampleUVMapping.hlsl"
#include "ShaderLibrary/Sampling/SampleUVMapping.hlsl"
#include "../MaterialUtilities.hlsl"
#include "../Decal/DecalUtilities.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute


#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Packing.hlsl"
#include "ShaderLibrary\Fibonacci.hlsl"
#include "ShaderLibrary/Sampling/Fibonacci.hlsl"
#include "ShaderLibrary/SpaceFillingCurves.hlsl"
#include "../../../ShaderVariables.hlsl"
#include "../../../Lighting/LightDefinition.cs.hlsl"

2
ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMapping.hlsl


// This structure abstract uv mapping inside one struct.
// It represent a mapping of any uv (with its associated tangent space for derivative if SurfaceGradient mode) - UVSet0 to 4, planar, triplanar
#include "NormalSurfaceGradient.hlsl"
#include "../NormalSurfaceGradient.hlsl"
#define UV_MAPPING_UVSET 0
#define UV_MAPPING_PLANAR 1

8
ScriptableRenderPipeline/Core/ShaderLibrary/Sampling.meta


fileFormatVersion: 2
guid: 14115a7568c4882499f59039a0585e3b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

82
ScriptableRenderPipeline/Core/ShaderLibrary/Filtering.hlsl


// Ref: https://gist.github.com/TheRealMJP/c83b8c0f46b63f3a88a5986f4fa982b1 from MJP
// Samples a texture with Catmull-Rom filtering, using 9 texture fetches instead of 16.
// See http://vec3.ca/bicubic-filtering-in-fewer-taps/ for more details
float4 SampleTextureCatmullRom(TEXTURE2D_ARGS(tex, linearSampler), float2 uv, float2 texSize)
{
// We're going to sample a a 4x4 grid of texels surrounding the target UV coordinate. We'll do this by rounding
// down the sample location to get the exact center of our "starting" texel. The starting texel will be at
// location [1, 1] in the grid, where [0, 0] is the top left corner.
float2 samplePos = uv * texSize;
float2 texPos1 = floor(samplePos - 0.5f) + 0.5f;
// Compute the fractional offset from our starting texel to our original sample location, which we'll
// feed into the Catmull-Rom spline function to get our filter weights.
float2 f = samplePos - texPos1;
float2 f2 = f * f;
float2 f3 = f2 * f;
// Compute the Catmull-Rom weights using the fractional offset that we calculated earlier.
// These equations are pre-expanded based on our knowledge of where the texels will be located,
// which lets us avoid having to evaluate a piece-wise function.
float2 w0 = (1.0f / 6.0) * (-3.0 * f3 + 6.0 * f2 - 3.0 * f);
float2 w1 = (1.0f / 6.0) * (9.0 * f3 - 15.0 * f2 + 6.0);
float2 w2 = (1.0f / 6.0) * (-9.0 * f3 + 12.0 * f2 + 3.0 * f);
float2 w3 = (1.0f / 6.0) * (3.0 * f3 - 3.0 * f2);
// Otim by Vlad, to test
// float2 w0 = (1.0 / 2.0) * f * (-1.0 + f * (2.0 - f));
// float2 w1 = (1.0 / 6.0) * f2 * (-15.0 + 9.0 * f)) + 1.0;
// float2 w2 = (1.0 / 6.0) * f * (3.0 + f * (12.0 - f * 9.0));
// float2 w3 = (1.0 / 2.0) * f2 * (f - 1.0);
// Work out weighting factors and sampling offsets that will let us use bilinear filtering to
// simultaneously evaluate the middle 2 samples from the 4x4 grid.
float2 w12 = w1 + w2;
float2 offset12 = w2 / (w1 + w2);
// Compute the final UV coordinates we'll use for sampling the texture
float2 texPos0 = texPos1 - 1;
float2 texPos3 = texPos1 + 2;
float2 texPos12 = texPos1 + offset12;
texPos0 /= texSize;
texPos3 /= texSize;
texPos12 /= texSize;
float4 result = 0.0;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos0.x, texPos0.y), 0.0) * w0.x * w0.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos12.x, texPos0.y), 0.0) * w12.x * w0.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos3.x, texPos0.y), 0.0) * w3.x * w0.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos0.x, texPos12.y), 0.0) * w0.x * w12.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos12.x, texPos12.y), 0.0) * w12.x * w12.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos3.x, texPos12.y), 0.0) * w3.x * w12.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos0.x, texPos3.y), 0.0) * w0.x * w3.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos12.x, texPos3.y), 0.0) * w12.x * w3.y;
result += TEXTURE2D_SAMPLE_LOD(tex, linearSampler, float2(texPos3.x, texPos3.y), 0.0) * w3.x * w3.y;
return result;
}
/*
// manual tri-linearly interpolated texture fetch
// not really needed: used hard-wired texture interpolation
vec4 manualTexture3D( sampler3D samp, vec3 p ){
vec3 qa = p*uvMapSize + vec3(0.5);
vec3 qi = floor(qa);
qa -= qi;
qi -= vec3(0.5);
return
mix( mix( mix( texture3D( samp, (qi+vec3(0.0,0.0,0.0))*oneOverUvMapSize ),
texture3D( samp, (qi+vec3(1.0,0.0,0.0))*oneOverUvMapSize ), qa.x ),
mix( texture3D( samp, (qi+vec3(0.0,1.0,0.0))*oneOverUvMapSize ),
texture3D( samp, (qi+vec3(1.0,1.0,0.0))*oneOverUvMapSize ), qa.x ), qa.y ),
mix( mix( texture3D( samp, (qi+vec3(0.0,0.0,1.0))*oneOverUvMapSize ),
texture3D( samp, (qi+vec3(1.0,0.0,1.0))*oneOverUvMapSize ), qa.x ),
mix( texture3D( samp, (qi+vec3(0.0,1.0,1.0))*oneOverUvMapSize ),
texture3D( samp, (qi+vec3(1.0,1.0,1.0))*oneOverUvMapSize ), qa.x ), qa.y ), qa.z );
}
*/

8
ScriptableRenderPipeline/Core/ShaderLibrary/Filtering.hlsl.meta


fileFormatVersion: 2
guid: dac42c6a533d53b41b931e02431564fa
timeCreated: 1474355143
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/Core/ShaderLibrary/Sampling.hlsl.meta → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Sampling.hlsl.meta

/ScriptableRenderPipeline/Core/ShaderLibrary/Fibonacci.hlsl.meta → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Fibonacci.hlsl.meta

/ScriptableRenderPipeline/Core/ShaderLibrary/Hammersley.hlsl.meta → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Hammersley.hlsl.meta

/ScriptableRenderPipeline/Core/ShaderLibrary/Fibonacci.hlsl → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Fibonacci.hlsl

/ScriptableRenderPipeline/Core/ShaderLibrary/Hammersley.hlsl → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Hammersley.hlsl

/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMappingNormalInternal.hlsl.meta → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingNormalInternal.hlsl.meta

/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMappingInternal.hlsl.meta → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingInternal.hlsl.meta

/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMapping.hlsl.meta → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMapping.hlsl.meta

/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMapping.hlsl → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMapping.hlsl

/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMappingInternal.hlsl → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingInternal.hlsl

/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMappingNormalInternal.hlsl → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/SampleUVMappingNormalInternal.hlsl

/ScriptableRenderPipeline/Core/ShaderLibrary/Sampling.hlsl → /ScriptableRenderPipeline/Core/ShaderLibrary/Sampling/Sampling.hlsl

正在加载...
取消
保存