Files
cocos4/editor/assets/chunks/surfaces/default-functions/common-vs.chunk
T
jk20012001 a83ad12022 fix surface shader runtime macros don't match attribute and uniform define (#11319)
* fix surface shader runtime macro doesn't match
fix surface shader include

* fix compiling error

* fix varying location missing

* fix vk fs shadowbias binding error

* fix vk fs shadowbias binding error

* fix vulkan binding flag not match

* revert binding flags

* fix vulkan error, remove CCLocal from PS
2022-06-06 15:14:32 +08:00

42 lines
988 B
Plaintext

#ifndef CC_SURFACES_VERTEX_MODIFY_LOCAL_POS
vec3 SurfacesVertexModifyLocalPos(in SurfacesStandardVertexIntermediate In)
{
return In.position.xyz;
}
#endif
#ifndef CC_SURFACES_VERTEX_MODIFY_WORLD_POS
vec3 SurfacesVertexModifyWorldPos(in SurfacesStandardVertexIntermediate In)
{
return In.worldPos;
}
#endif
#ifndef CC_SURFACES_VERTEX_MODIFY_CLIP_POS
vec4 SurfacesVertexModifyClipPos(in SurfacesStandardVertexIntermediate In)
{
return In.clipPos;
}
#endif
#ifndef CC_SURFACES_VERTEX_MODIFY_UV
void SurfacesVertexModifyUV(inout SurfacesStandardVertexIntermediate In)
{
In.texCoord = In.texCoord;
#if CC_SURFACES_USE_SECOND_UV && !CC_USE_LIGHTMAP
In.texCoord1 = In.texCoord1;
#endif
}
#endif
#ifndef CC_SURFACES_VERTEX_MODIFY_WORLD_NORMAL
vec3 SurfacesVertexModifyWorldNormal(in SurfacesStandardVertexIntermediate In)
{
vec3 worldNormal = In.worldNormal.xyz;
#if CC_SURFACES_USE_TWO_SIDED
worldNormal.xyz *= In.worldNormal.w;
#endif
return worldNormal;
}
#endif