mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
0ecaa8db51
* add surface shader * remove unused item * arrange main-functions * arrange main-functions * fix compatible lighting mode
55 lines
970 B
Plaintext
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
|