浏览代码

Fixed compilation errors for no-define version of the LayeredLit shader.

/main
Julien Ignace 8 年前
当前提交
b27e925d
共有 2 个文件被更改,包括 6 次插入14 次删除
  1. 10
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitDefault.shader
  2. 10
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitData.hlsl

10
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitDefault.shader


// Set of users variables
PROP_DECL(float4, _BaseColor);
//PROP_DECL_TEX2D(_BaseColorMap);
TEXTURE2D(_BaseColorMap0);
TEXTURE2D(_BaseColorMap1);
TEXTURE2D(_BaseColorMap2);
TEXTURE2D(_BaseColorMap3);
SAMPLER2D(sampler_BaseColorMap0);
PROP_DECL_TEX2D(_BaseColorMap);
PROP_DECL(float, _Metallic);
PROP_DECL(float, _Smoothness);
PROP_DECL_TEX2D(_MaskMap);

10
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitData.hlsl


{
float3 result = float3(0.0, 0.0, 0.0);
result = rgb0 * weight[0] + rgb1 * weight[1];
result = rgb0 * weight[0] + rgb1 * weight[1];
#if _LAYER_COUNT >= 3
result += (rgb2 * weight[2]);
#endif

// calculate weight of each layers
float left = 1.0f;
// ATTRIBUTE_UNROLL
[unroll]
for (int i = _LAYER_COUNT - 1; i > 0; --i)
{
outWeights[i] = masks[i] * left;

void GetSurfaceAndBuiltinData(FragInput input, out SurfaceData surfaceData, out BuiltinData builtinData)
{
float4 maskValues = float4(1.0, 1.0, 1.0, 1.0);// input.vertexColor;
float4 maskValues = float4(1.0, 0.0, 0.0, 0.0);// input.vertexColor;
float4 maskMap = SAMPLE_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, input.texCoord0);
maskValues *= maskMap;
float4 maskMap = SAMPLE_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, input.texCoord0);
maskValues = maskMap;
#endif
float weights[_MAX_LAYER];

正在加载...
取消
保存