Files
cocos4/editor/assets/chunks/shading-entries/data-structures/vs-intermediate.chunk
T
jk20012001 0ecaa8db51 add surface shader (#11048)
* add surface shader

* remove unused item

* arrange main-functions

* arrange main-functions

* fix compatible lighting mode
2022-05-13 21:18:22 +08:00

55 lines
970 B
Plaintext

struct SurfacesStandardVertexIntermediate
{
//local space
highp vec4 position;
vec3 normal;
#if CC_SURFACES_USE_TANGENT_SPACE
vec4 tangent;
#endif
//other data
#if CC_SURFACES_USE_VERTEX_COLOR
vec4 color;
#endif
vec2 texCoord;
#if CC_SURFACES_USE_SECOND_UV && !CC_SURFACES_USE_LIGHT_MAP
vec2 texCoord1;
#endif
//transformed
highp vec4 clipPos;
highp vec3 worldPos;
vec4 worldNormal; // a: two side sign
#if CC_SURFACES_USE_TANGENT_SPACE
vec3 worldTangent, worldBinormal;
#endif
//transfered
#if CC_RECEIVE_SHADOW
highp vec4 shadowPos;
vec2 shadowBias;
#endif
#if !CC_USE_ACCURATE_FOG
float fogFactor;
#endif
#if CC_SURFACES_USE_LIGHT_MAP && !CC_SURFACES_USE_BATCHING && !CC_FORWARD_ADD
vec3 lightmapUV;
#endif
};
#if CC_USE_MORPH
#if __VERSION__ < 450
int getVertexId() {
return int(a_vertexId);
}
#else
int getVertexId() {
return gl_VertexIndex; // vulkan convension
}
#endif
#endif