浏览代码

Fixed spot shadows. Updated template scenes to account for the new shadow filtering.

/main
Felipe Lira 7 年前
当前提交
44b0d028
共有 5 个文件被更改,包括 734 次插入1301 次删除
  1. 999
      ImageTemplates/LightweightPipeline/Scenes/016_Lighting_Scene_Directional.unity.png
  2. 14
      ImageTemplates/LightweightPipeline/Scenes/016_Lighting_Scene_Directional.unity.png.meta
  3. 999
      ImageTemplates/LightweightPipeline/Scenes/018_Lighting_Scene_DirectionalBakedIndirect.unity.png
  4. 14
      ImageTemplates/LightweightPipeline/Scenes/018_Lighting_Scene_DirectionalBakedIndirect.unity.png.meta
  5. 9
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightShadows.cginc

999
ImageTemplates/LightweightPipeline/Scenes/016_Lighting_Scene_Directional.unity.png
文件差异内容过多而无法显示
查看文件

14
ImageTemplates/LightweightPipeline/Scenes/016_Lighting_Scene_Directional.unity.png.meta


fileFormatVersion: 2
guid: 9f96732e1ef8b493db200e6342576203
timeCreated: 1504695587
licenseType: Pro
serializedVersion: 4
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1

spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
- buildTarget: DefaultTexturePlatform
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1

sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:

999
ImageTemplates/LightweightPipeline/Scenes/018_Lighting_Scene_DirectionalBakedIndirect.unity.png
文件差异内容过多而无法显示
查看文件

14
ImageTemplates/LightweightPipeline/Scenes/018_Lighting_Scene_DirectionalBakedIndirect.unity.png.meta


fileFormatVersion: 2
guid: 89ed8247fbdb545f58bf8e0c6cf53d00
timeCreated: 1509372551
licenseType: Pro
serializedVersion: 4
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1

spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
- buildTarget: DefaultTexturePlatform
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1

sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:

9
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightShadows.cginc


inline half SampleShadowmap(float4 shadowCoord)
{
if (shadowCoord.x <= 0 || shadowCoord.x >= 1 || shadowCoord.y <= 0 || shadowCoord.y >= 1)
float3 coord = shadowCoord.xyz /= shadowCoord.w;
coord.z = saturate(ApplyDepthBias(coord.z));
if (coord.x <= 0 || coord.x >= 1 || coord.y <= 0 || coord.y >= 1)
float3 coord = shadowCoord.xyz /= shadowCoord.w;
coord.z = ApplyDepthBias(coord.z);
half4 attenuation;
attenuation.x = UNITY_SAMPLE_SHADOW(_ShadowMap, coord + _ShadowOffset0.xyz);
attenuation.y = UNITY_SAMPLE_SHADOW(_ShadowMap, coord + _ShadowOffset1.xyz);

return dot(attenuation, 0.25);
#else
// 1-tap hardware comparison
shadowCoord.z = ApplyDepthBias(shadowCoord.z);
half attenuation = UNITY_SAMPLE_SHADOW_PROJ(_ShadowMap, shadowCoord);
half attenuation = UNITY_SAMPLE_SHADOW(_ShadowMap, coord);
return lerp(attenuation, 1.0, _ShadowData.x);
#endif
}

正在加载...
取消
保存