mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
47 lines
1.0 KiB
Plaintext
47 lines
1.0 KiB
Plaintext
|
|
precision highp float;
|
|
#include <input-standard>
|
|
#include <cc-global>
|
|
#include <cc-local-batch>
|
|
#include <input-standard>
|
|
#include <cc-fog>
|
|
#include <cc-shadow-map-vs>
|
|
|
|
in vec3 a_color;
|
|
#if HAS_SECOND_UV
|
|
in vec2 a_texCoord1;
|
|
#endif
|
|
|
|
out vec3 v_position;
|
|
out vec3 v_normal;
|
|
out vec3 v_tangent;
|
|
out vec3 v_bitangent;
|
|
out vec2 v_uv;
|
|
out vec2 v_uv1;
|
|
out vec3 v_color;
|
|
out float factor_fog;
|
|
|
|
vec4 vert () {
|
|
StandardVertInput In;
|
|
CCVertInput(In);
|
|
|
|
mat4 matWorld, matWorldIT;
|
|
CCGetWorldMatrixFull(matWorld, matWorldIT);
|
|
|
|
v_position = (matWorld * In.position).xyz;
|
|
v_normal = normalize((matWorldIT * vec4(In.normal, 0.0)).xyz);
|
|
v_tangent = normalize((matWorld * vec4(In.tangent.xyz, 0.0)).xyz);
|
|
v_bitangent = cross(v_normal, v_tangent) * In.tangent.w; // note the cross order
|
|
|
|
v_uv = a_texCoord;
|
|
#if HAS_SECOND_UV
|
|
v_uv1 = a_texCoord1;
|
|
#endif
|
|
v_color = a_color;
|
|
factor_fog = CC_TRANSFER_FOG(matWorld * In.position);
|
|
|
|
CCPassShadowParams(matWorld * In.position);
|
|
|
|
return cc_matProj * (cc_matView * matWorld) * In.position;
|
|
}
|