浏览代码

HDRenderPipeline: More test - Miss domain shader part

/main
sebastienlagarde 8 年前
当前提交
0d5518ce
共有 3 个文件被更改,包括 430 次插入224 次删除
  1. 256
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitDepthPass.hlsl
  2. 353
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitAttributesVarying.hlsl
  3. 45
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitVertexShare.hlsl

256
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/ShaderPass/LitDepthPass.hlsl


#error Undefine_SHADERPASS
#endif
// Attributes
#define ATTRIBUTES_WANT_NORMAL defined(TESSELLATION_ON) || (defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT))
#define ATTRIBUTES_WANT_TANGENT defined(TESSELLATION_ON) || (defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT))
#define ATTRIBUTES_WANT_UV0 ATTRIBUTES_TESSELATION_WANT_UV || defined(_ALPHATEST_ON))
#define ATTRIBUTES_WANT_UV1 (WANT_UV0) && !defined(LAYERED_LIT_SHADER) // Layered shader can use any UV
#define ATTRIBUTES_WANT_UV2 (WANT_UV0 && _REQUIRE_UV2_OR_UV3) && !defined(LAYERED_LIT_SHADER) // Layered shader can use any UV
#define ATTRIBUTES_WANT_UV3 ATTRIBUTES_WANT_UV2
struct Attributes
{
float3 positionOS : POSITION;
#if ATTRIBUTES_WANT_NORMAL
float3 normalOS : NORMAL;
#endif
#if ATTRIBUTES_WANT_UV0
float2 uv0 : TEXCOORD0;
#endif
#if ATTRIBUTES_WANT_UV1
float2 uv1 : TEXCOORD1;
#endif
#if ATTRIBUTES_WANT_UV2
float2 uv2 : TEXCOORD2;
#endif
#if ATTRIBUTES_WANT_UV3
float2 uv3 : TEXCOORD3;
#endif
#if ATTRIBUTES_WANT_TANGENT
float4 tangentOS : TANGENT; // Always present as we require it also in case of anisotropic lighting
#endif
#if ATTRIBUTES_WANT_COLOR
float4 color : COLOR;
#endif
// UNITY_INSTANCE_ID
};
#define VARYINGDS_WANT_TEXCOORD0 ATTRIBUTES_WANT_UV0
struct VaryingsDS
{
float3 positionWS;
#ifdef VARYINGDS_WANT_TEXCOORD0
float2 texCoord0;
#endif
#ifdef VARYINGDS_WANT_TEXCOORD1
float2 texCoord1;
#endif
#ifdef VARYINGDS_WANT_TEXCOORD2
float2 texCoord2;
#endif
#ifdef VARYINGDS_WANT_TEXCOORD3
float2 texCoord2;
#if defined(TESSELLATION_ON) || (defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT))
#define ATTRIBUTES_WANT_NORMAL
#ifdef VARYINGDS_WANT_TANGENT_TO_WORLD
float3 tangentToWorld[3];
#if defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT)
#define ATTRIBUTES_WANT_TANGENT
#ifdef VARYINGDS_WANT_COLOR
float4 color;
// About UV
// If we have a lit shader, only the UV0 is available for opacity or heightmap
// If we have a layered shader, any UV can be use for this. To reduce the number of variant we groupt UV0/UV1 and UV2/UV3 instead of having variant for UV0/UV1/UV2/UV3
// When UVX is present, we assume that UVX - 1 ... UV0 is present
#if ATTRIBUTES_TESSELATION_WANT_UV || (defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT)) || defined(_ALPHATEST_ON)
#define ATTRIBUTES_WANT_UV0
#ifdef LAYERED_LIT_SHADER
#define ATTRIBUTES_WANT_UV1
#ifdef _REQUIRE_UV2_OR_UV3
#define ATTRIBUTES_WANT_UV2
#define ATTRIBUTES_WANT_UV3
#endif
#endif
};
struct PackedVaryingsDS
{
#if VARYING_DS_WANT_TEXCOORD0 || VARYING_DS_WANT_TEXCOORD1
float4 interpolators1 : TEXCOORD1;
#endif
#if VARYING_DS_WANT_TEXCOORD2 || VARYING_DS_WANT_TEXCOORD3
float4 interpolators2 : TEXCOORD2;
#endif
#if VARYING_DS_WANT_TANGENT_TO_WORLD
// if present, pack positionWS
float4 interpolators3 : TEXCOORD3;
float4 interpolators4 : TEXCOORD4;
float4 interpolators5 : TEXCOORD5;
#else
float3 interpolators0 : TEXCOORD0; // positionWS
#endif
#if VARYING_DS_WANT_COLOR
float4 interpolators6 : TEXCOORD6;
// Varying - Use for pixel shader
#if defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT)
#define VARYING_WANT_TANGENT_TO_WORLD
};
#define VARYING_WANT_WORLDPOS
#if defined(_HEIGHTMAP) && defined(_PER_PIXEL_DISPLACEMENT) || defined(_ALPHATEST_ON)
#define VARYING_WANT_TEXCOORD1
#define VARYING_WANT_TEXCOORD2
#define VARYING_WANT_TEXCOORD3
struct Varyings
{
float4 positionCS;
#ifdef VARYING_WANT_WORLDPOS
float3 positionWS;
#endif
#ifdef VARYING_WANT_TEXCOORD0
float2 texCoord0;
#endif
#ifdef VARYING_WANT_TEXCOORD1
float2 texCoord1;
#endif
#ifdef VARYING_WANT_TEXCOORD2
float2 texCoord2;
#endif
#ifdef VARYING_WANT_TEXCOORD3
float2 texCoord2;
#endif
float3 tangentToWorld[3];
float4 color;
};
struct PackedVaryings
{
float4 positionCS : SV_Position;
#if defined(VARYING_WANT_TEXCOORD0) || defined(VARYING_WANT_TEXCOORD1)
float4 interpolators1 : TEXCOORD1;
#endif
#if defined(VARYING_WANT_TEXCOORD2) || defined(VARYING_WANT_TEXCOORD3)
float4 interpolators2 : TEXCOORD2;
#endif
#if defined(VARYING_WANT_TANGENT_TO_WORLD)
#ifdef VARYING_WANT_WORLDPOS
// if present, pack positionWS
float4 interpolators3 : TEXCOORD3;
float4 interpolators4 : TEXCOORD4;
float4 interpolators5 : TEXCOORD5;
#else
float3 interpolators3 : TEXCOORD3;
float3 interpolators4 : TEXCOORD4;
float3 interpolators5 : TEXCOORD5;
#ifdef LAYERED_LIT_SHADER
#define VARYING_WANT_TEXCOORD1
#ifdef _REQUIRE_UV2_OR_UV3
#define VARYING_WANT_TEXCOORD2
#define VARYING_WANT_TEXCOORD3
#endif
#else
#ifdef VARYING_WANT_WORLDPOS
float4 interpolators1 : TEXCOORD0;
#endif
#ifdef VARYING_WANT_COLOR
float4 interpolators6 : TEXCOORD6;
#endif
};
#ifdef TESSELLATION_ON
AttributesTessellation InterpolateWithBaryCoords(AttributesTessellation input0, AttributesTessellation input1, AttributesTessellation input2, float3 baryCoords)
{
AttributesTessellation ouput;
TESSELLATION_INTERPOLATE_BARY(positionOS, baryCoords);
#if NEED_TEXCOORD0
TESSELLATION_INTERPOLATE_BARY(uv0, baryCoords);
#endif
#if NEED_TANGENT_TO_WORLD
TESSELLATION_INTERPOLATE_BARY(normalOS, baryCoords);
TESSELLATION_INTERPOLATE_BARY(tangentOS, baryCoords);
#endif
return ouput;
}
#endif // TESSELLATION_ON
struct PackedVaryings
{
float4 positionCS : SV_Position;
#if NEED_TANGENT_TO_WORLD
float4 interpolators[4] : TEXCOORD0;
#elif NEED_TEXCOORD0
float4 interpolators[1] : TEXCOORD0;
#endif
};
// Function to pack data to use as few interpolator as possible, the ShaderGraph should generate these functions
PackedVaryings PackVaryings(Varyings input)
{
PackedVaryings output;
output.positionCS = input.positionCS;
#if NEED_TANGENT_TO_WORLD
output.interpolators[0].xyz = input.positionWS.xyz;
output.interpolators[1].xyz = input.tangentToWorld[0];
output.interpolators[2].xyz = input.tangentToWorld[1];
output.interpolators[3].xyz = input.tangentToWorld[2];
output.interpolators[0].w = input.texCoord0.x;
output.interpolators[1].w = input.texCoord0.y;
#elif NEED_TEXCOORD0
output.interpolators[0] = float4(input.texCoord0, 0.0, 0.0);
#endif
return output;
}
FragInputs UnpackVaryings(PackedVaryings input)
{
FragInputs output;
ZERO_INITIALIZE(FragInputs, output);
output.unPositionSS = input.positionCS; // input.positionCS is SV_Position
#if NEED_TANGENT_TO_WORLD
output.positionWS.xyz = input.interpolators[0].xyz;
output.tangentToWorld[0] = input.interpolators[1].xyz;
output.tangentToWorld[1] = input.interpolators[2].xyz;
output.tangentToWorld[2] = input.interpolators[3].xyz;
output.texCoord0.xy = float2(input.interpolators[0].w, input.interpolators[1].w);
#elif NEED_TEXCOORD0
output.texCoord0.xy = input.interpolators[0].xy;
#endif
return output;
}
PackedVaryings Vert(Attributes input)
{
Varyings output;
float3 positionWS = TransformObjectToWorld(input.positionOS);
output.positionCS = TransformWorldToHClip(positionWS);
#if NEED_TEXCOORD0
output.texCoord0 = input.uv0;
#endif
#if NEED_TANGENT_TO_WORLD
output.positionWS = positionWS;
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
float4 tangentWS = float4(TransformObjectToWorldDir(input.tangentOS.xyz), input.tangentOS.w);
// Varying DS - Use for domain shader, are deduced from the above
float3x3 tangentToWorld = CreateTangentToWorld(normalWS, tangentWS.xyz, tangentWS.w);
output.tangentToWorld[0] = tangentToWorld[0];
output.tangentToWorld[1] = tangentToWorld[1];
output.tangentToWorld[2] = tangentToWorld[2];
#endif
// Include structure declaration and packing functions
#include "LitAttributesVarying.hlsl"
return PackVaryings(output);
}
#include "LitVertexShare.hlsl"

353
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitAttributesVarying.hlsl


struct Attributes
{
float3 positionOS : POSITION;
#ifdef ATTRIBUTES_WANT_NORMAL
float3 normalOS : NORMAL;
#endif
#ifdef ATTRIBUTES_WANT_TANGENT_TO_WORLD
float4 tangentOS : TANGENT; // Store sign in w
#endif
#ifdef ATTRIBUTES_WANT_UV0
float2 uv0 : TEXCOORD0;
#endif
#ifdef ATTRIBUTES_WANT_UV1
float2 uv1 : TEXCOORD1;
#endif
#ifdef ATTRIBUTES_WANT_UV2
float2 uv2 : TEXCOORD2;
#endif
#ifdef ATTRIBUTES_WANT_UV3
float2 uv3 : TEXCOORD3;
#endif
#ifdef ATTRIBUTES_WANT_COLOR
float4 color : COLOR;
#endif
// UNITY_INSTANCE_ID
};
struct Varyings
{
float4 positionCS;
#ifdef VARYING_WANT_POSITION_WS
float3 positionWS;
#endif
#ifdef VARYING_WANT_TANGENT_TO_WORLD
float3 tangentToWorld[3];
#endif
#ifdef VARYING_WANT_TEXCOORD0
float2 texCoord0;
#endif
#ifdef VARYING_WANT_TEXCOORD1
float2 texCoord1;
#endif
#ifdef VARYING_WANT_TEXCOORD2
float2 texCoord2;
#endif
#ifdef VARYING_WANT_TEXCOORD3
float2 texCoord3;
#endif
#ifdef VARYING_WANT_COLOR
float4 color;
#endif
};
struct PackedVaryings
{
float4 positionCS : SV_Position;
#ifdef VARYING_WANT_TANGENT_TO_WORLD
#ifdef VARYING_WANT_POSITION_WS
// if present, pack positionWS
float4 interpolators1 : TEXCOORD1;
float4 interpolators2 : TEXCOORD2;
float4 interpolators3 : TEXCOORD3;
#else
float3 interpolators1 : TEXCOORD1;
float3 interpolators2 : TEXCOORD2;
float3 interpolators3 : TEXCOORD3;
#endif
#else
#ifdef VARYING_WANT_POSITION_WS
float3 interpolators0 : TEXCOORD0;
#endif
#endif
// Allocate only necessary space if shader compiler in the future are able to automatically pack
#ifdef VARYING_WANT_TEXCOORD1
float4 interpolators4 : TEXCOORD3;
#elif defined(VARYING_WANT_TEXCOORD0)
float2 interpolators4 : TEXCOORD3;
#endif
#ifdef VARYING_WANT_TEXCOORD3
float4 interpolators5 : TEXCOORD4;
#elif defined(VARYING_WANT_TEXCOORD2)
float2 interpolators5 : TEXCOORD4;
#endif
#ifdef VARYING_WANT_COLOR
float4 interpolators6 : TEXCOORD6;
#endif
};
// Functions to pack data to use as few interpolator as possible, the ShaderGraph should generate these functions
PackedVaryings PackVaryings(Varyings input)
{
PackedVaryings output;
output.positionCS = input.positionCS;
#ifdef VARYING_WANT_TANGENT_TO_WORLD
output.interpolators1.xyz = input.tangentToWorld[0];
output.interpolators2.xyz = input.tangentToWorld[1];
output.interpolators3.xyz = input.tangentToWorld[2];
#ifdef VARYING_WANT_POSITION_WS
output.interpolators1.w = input.positionWS.x;
output.interpolators2.w = input.positionWS.y;
output.interpolators3.w = input.positionWS.z;
#else
output.interpolators1.w = 0.0;
output.interpolators2.w = 0.0;
output.interpolators3.w = 0.0;
#endif
#else
#ifdef VARYING_WANT_POSITION_WS
output.interpolators0.xyz = input.positionWS;
output.interpolators0.w = 0.0;
#endif
#endif
#ifdef VARYING_WANT_TEXCOORD0
output.interpolators4.xy = input.texCoord0;
#endif
#ifdef VARYING_WANT_TEXCOORD1
output.interpolators4.zw = input.texCoord1;
#endif
#ifdef VARYING_WANT_TEXCOORD2
output.interpolators5.xy = input.texCoord2;
#endif
#ifdef VARYING_WANT_TEXCOORD3
output.interpolators5.zw = input.texCoord3;
#endif
#ifdef VARYING_WANT_COLOR
output.interpolators6 = input.color;
#endif
return output;
}
FragInputs UnpackVaryings(PackedVaryings input)
{
FragInputs output;
ZERO_INITIALIZE(FragInputs, output);
output.unPositionSS = input.positionCS; // input.positionCS is SV_Position
#ifdef VARYING_WANT_TANGENT_TO_WORLD
output.tangentToWorld[0] = input.interpolators1.xyz;
output.tangentToWorld[1] = input.interpolators2.xyz;
output.tangentToWorld[2] = input.interpolators3.xyz;
#ifdef WANT_PER_PIXEL_WORLDPOS
output.positionWS.xyz = float3(input.interpolators1.w, input.interpolators2.w, input.interpolators3.w);
#endif
#else
#ifdef VARYING_WANT_POSITION_WS
output.positionWS.xyz = input.interpolators0.xyz;
#endif
#endif
#ifdef VARYING_WANT_TEXCOORD0
output.texCoord0 = input.interpolators4.xy;
#endif
#ifdef VARYING_WANT_TEXCOORD1
output.texCoord1 = input.interpolators4.zw;
#endif
#ifdef VARYING_WANT_TEXCOORD2
output.texCoord2 = input.interpolators5.xy;
#endif
#ifdef VARYING_WANT_TEXCOORD3
output.texCoord3 = input.interpolators5.zw;
#endif
#ifdef VARYING_WANT_COLOR
output.color = input.interpolators6;
#endif
return output;
}
#ifdef TESSELLATION_ON
// Varying DS - use for domain shader
// We can deduce these define from the other define
// We need to pass to DS any varying required by pixel shader
// If we have required an attribute it mean we will use it at least for DS
#ifdef VARYING_WANT_TANGENT_TO_WORLD
#define VARYING_DS_WANT_TANGENT_TO_WORLD
#endif
#if defined(VARYING_WANT_TEXCOORD0) || defined(ATTRIBUTES_WANT_UV0)
#define VARYING_DS_WANT_TEXCOORD0
#endif
#if defined(VARYING_WANT_TEXCOORD1) || defined(ATTRIBUTES_WANT_UV1)
#define VARYING_DS_WANT_TEXCOORD1
#endif
#if defined(VARYING_WANT_TEXCOORD2) || defined(ATTRIBUTES_WANT_UV2)
#define VARYING_DS_WANT_TEXCOORD2
#endif
#if defined(VARYING_WANT_TEXCOORD3) || defined(ATTRIBUTES_WANT_UV3)
#define VARYING_DS_WANT_TEXCOORD3
#endif
#if defined(VARYING_WANT_COLOR) || defined(ATTRIBUTES_WANT_COLOR)
float4 VARYING_DS_WANT_COLOR;
#endif
#endif
// Varying for domain shader
// Position and normal are always present (for tessellation) and in world space
struct VaryingsDS
{
float3 positionWS;
float3 normalWS;
#ifdef VARYING_DS_WANT_TANGENT_TO_WORLD
float4 tangentWS;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD0
float2 texCoord0;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD1
float2 texCoord1;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD2
float2 texCoord2;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD3
float2 texCoord3;
#endif
#ifdef VARYING_DS_WANT_COLOR
float4 color;
#endif
};
struct PackedVaryingsDS
{
float3 interpolators0 : TEXCOORD0; // positionWS
float3 interpolators1 : TEXCOORD1; // normalWS
#ifdef VARYING_DS_WANT_TANGENT_TO_WORLD
float4 interpolators2 : TEXCOORD2;
#endif
// Allocate only necessary space if shader compiler in the future are able to automatically pack
#ifdef VARYING_DS_WANT_TEXCOORD1
float4 interpolators3 : TEXCOORD3;
#elif defined(VARYING_DS_WANT_TEXCOORD0)
float2 interpolators3 : TEXCOORD3;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD3
float4 interpolators4 : TEXCOORD4;
#elif defined(VARYING_DS_WANT_TEXCOORD2)
float2 interpolators4 : TEXCOORD4;
#endif
#ifdef VARYING_DS_WANT_COLOR
float4 interpolators5 : TEXCOORD5;
#endif
};
// Functions to pack data to use as few interpolator as possible, the ShaderGraph should generate these functions
PackedVaryingsDS PackVaryingsDS(VaryingsDS input)
{
PackedVaryingsDS output;
output.interpolators0 = input.positionWS;
output.interpolators1 = input.normalWS;
#ifdef VARYING_DS_WANT_TANGENT_TO_WORLD
output.interpolators2 = input.tangentWS;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD0
output.interpolators3.xy = input.texCoord0;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD1
output.interpolators3.zw = input.texCoord1;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD2
output.interpolators4.xy = input.texCoord2;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD3
output.interpolators4.zw = input.texCoord3;
#endif
#ifdef VARYING_DS_WANT_COLOR
output.interpolators5 = input.color;
#endif
return output;
}
VaryingsDS UnpackVaryingsDS(PackedVaryingsDS input)
{
VaryingsDS output;
output.positionWS = input.interpolators0;
output.normalWS = input.interpolators1;
#ifdef VARYING_DS_WANT_TANGENT_TO_WORLD
output.tangentWS = input.interpolators2;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD0
output.texCoord0 = input.interpolators3.xy;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD1
output.texCoord1 = input.interpolators3.zw;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD2
output.texCoord2 = input.interpolators4.xy;
#endif
#ifdef VARYING_DS_WANT_TEXCOORD3
output.texCoord3 = input.interpolators4.zw;
#endif
#ifdef VARYING_DS_WANT_COLOR
output.color = input.interpolators5;
#endif
return output;
}
VaryingsDS InterpolateWithBaryCoords(VaryingsDS input0, VaryingsDS input1, VaryingsDS input2, float3 baryCoords)
{
VaryingsDS ouput;
TESSELLATION_INTERPOLATE_BARY(positionWS, baryCoords);
TESSELLATION_INTERPOLATE_BARY(normalWS, baryCoords);
#ifdef VARYING_DS_WANT_TANGENT_TO_WORLD
TESSELLATION_INTERPOLATE_BARY(tangentWS, baryCoords);
#endif
#ifdef VARYING_DS_WANT_TEXCOORD0
TESSELLATION_INTERPOLATE_BARY(texCoord0, baryCoords);
#endif
#ifdef VARYING_DS_WANT_TEXCOORD1
TESSELLATION_INTERPOLATE_BARY(texCoord1, baryCoords);
#endif
#ifdef VARYING_DS_WANT_TEXCOORD2
TESSELLATION_INTERPOLATE_BARY(texCoord2, baryCoords);
#endif
#ifdef VARYING_DS_WANT_TEXCOORD3
TESSELLATION_INTERPOLATE_BARY(texCoord3, baryCoords);
#endif
#ifdef VARYING_DS_WANT_COLOR
TESSELLATION_INTERPOLATE_BARY(color, baryCoords);
#endif
return ouput;
}
#endif // TESSELLATION_ON
#ifdef TESSELLATION_ON
#define VaryingsType VaryingsDS
#define PackedVaryingsType PackedVaryingsDS
#define PackVaryingsType PackVaryingsDS
#else
#define VaryingsType Varyings
#define PackedVaryingsType PackedVaryings
#define PackVaryingsType PackVaryings
#endif

45
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitVertexShare.hlsl


PackedVaryingsType Vert(Attributes input)
{
VaryingsType output;
#if defined(TESSELLATION_ON)
output.positionWS = TransformObjectToWorld(input.positionOS);
// TODO deal with camera center rendering and instancing (This is the reason why we always perform tow steps transform to clip space + instancing matrix)
output.normalWS = TransformObjectToWorldNormal(input.normalOS);
#if defined(VARYING_DS_WANT_TANGENT_TO_WORLD) || defined(VARYING_WANT_TANGENT_TO_WORLD)
output.tangentWS = float4(TransformObjectToWorldDir(input.tangentOS.xyz), input.tangentOS.w);
#endif
#else
float3 positionWS = TransformObjectToWorld(input.positionOS);
// TODO deal with camera center rendering and instancing (This is the reason why we always perform tow steps transform to clip space + instancing matrix)
output.positionCS = TransformWorldToHClip(positionWS);
#ifdef VARYING_WANT_TANGENT_TO_WORLD
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
float4 tangentWS = float4(TransformObjectToWorldDir(input.tangentOS.xyz), input.tangentOS.w);
float3x3 tangentToWorld = CreateTangentToWorld(normalWS, tangentWS.xyz, tangentWS.w);
output.tangentToWorld[0] = tangentToWorld[0];
output.tangentToWorld[1] = tangentToWorld[1];
output.tangentToWorld[2] = tangentToWorld[2];
#endif
#endif
#if defined(VARYING_WANT_TEXCOORD0) || defined(VARYING_DS_WANT_TEXCOORD0)
output.texCoord0 = input.uv0;
#endif
#if defined(VARYING_WANT_TEXCOORD1) || defined(VARYING_DS_WANT_TEXCOORD1)
output.texCoord1 = input.uv1;
#endif
#if defined(VARYING_WANT_TEXCOORD2) || defined(VARYING_DS_WANT_TEXCOORD2)
output.texCoord2 = input.uv2;
#endif
#if defined(VARYING_WANT_TEXCOORD3) || defined(VARYING_DS_WANT_TEXCOORD3)
output.texCoord3 = input.uv3;
#endif
#if defined(VARYING_WANT_COLOR) || defined(VARYING_DS_WANT_COLOR)
output.color = input.color;
#endif
return PackVaryingsType(output);
}
正在加载...
取消
保存