Cleanup material shaders code

This commit is contained in:
Wojtek Figat
2021-02-08 15:45:22 +01:00
parent da784e98e5
commit 8e87c98644
10 changed files with 16 additions and 51 deletions

View File

@@ -679,11 +679,7 @@ VertexOutput VS_Ribbon(uint vertexIndex : SV_VertexID)
// Pixel Shader function for Depth Pass
META_PS(true, FEATURE_LEVEL_ES2)
void PS_Depth(PixelInput input
#if GLSL
, out float4 OutColor : SV_Target0
#endif
)
void PS_Depth(PixelInput input)
{
// Get material parameters
MaterialInput materialInput = GetMaterialInput(input);
@@ -696,10 +692,6 @@ void PS_Depth(PixelInput input
#if MATERIAL_BLEND == MATERIAL_BLEND_TRANSPARENT
clip(material.Opacity - MATERIAL_OPACITY_THRESHOLD);
#endif
#if GLSL
OutColor = 0;
#endif
}
@9

View File

@@ -43,9 +43,9 @@ struct GeometryData
#endif
float3 WorldNormal : TEXCOORD3;
float4 WorldTangent : TEXCOORD4;
float3 InstanceOrigin : TEXCOORD6;
float2 InstanceParams : TEXCOORD7; // x-PerInstanceRandom, y-LODDitherFactor
float3 PrevWorldPosition : TEXCOORD8;
float3 InstanceOrigin : TEXCOORD5;
float2 InstanceParams : TEXCOORD6; // x-PerInstanceRandom, y-LODDitherFactor
float3 PrevWorldPosition : TEXCOORD7;
};
// Interpolants passed from the vertex shader
@@ -475,8 +475,7 @@ float3x4 GetBoneMatrix(ModelInput_Skinned input)
// Transforms the vertex position by weighted sum of the skinning matrices
float3 SkinPosition(ModelInput_Skinned input, SkinningData data)
{
float4 position = float4(input.Position.xyz, 1);
return mul(data.BlendMatrix, position);
return mul(data.BlendMatrix, float4(input.Position.xyz, 1));
}
// Transforms the vertex position by weighted sum of the skinning matrices
@@ -596,11 +595,7 @@ void ClipLODTransition(PixelInput input)
// Pixel Shader function for Depth Pass
META_PS(true, FEATURE_LEVEL_ES2)
void PS_Depth(PixelInput input
#if GLSL
, out float4 OutColor : SV_Target0
#endif
)
void PS_Depth(PixelInput input)
{
#if USE_DITHERED_LOD_TRANSITION
// LOD masking
@@ -620,10 +615,6 @@ void PS_Depth(PixelInput input
clip(material.Opacity - MATERIAL_OPACITY_THRESHOLD);
#endif
#endif
#if GLSL
OutColor = 0;
#endif
}
@9

View File

@@ -448,11 +448,7 @@ VertexOutput VS(TerrainVertexInput input)
// Pixel Shader function for Depth Pass
META_PS(true, FEATURE_LEVEL_ES2)
void PS_Depth(PixelInput input
#if GLSL
, out float4 OutColor : SV_Target0
#endif
)
void PS_Depth(PixelInput input)
{
#if MATERIAL_MASKED
// Perform per pixel clipping if material requries it
@@ -460,10 +456,6 @@ void PS_Depth(PixelInput input
Material material = GetMaterialPS(materialInput);
clip(material.Mask - MATERIAL_MASK_THRESHOLD);
#endif
#if GLSL
OutColor = 0;
#endif
}
@9