mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
32 lines
735 B
Plaintext
32 lines
735 B
Plaintext
#include <builtin/uniforms/cc-local-batched>
|
|
|
|
void CCGetWorldMatrix(out mat4 matWorld)
|
|
{
|
|
#if USE_INSTANCING
|
|
matWorld = mat4(
|
|
vec4(a_matWorld0.xyz, 0.0),
|
|
vec4(a_matWorld1.xyz, 0.0),
|
|
vec4(a_matWorld2.xyz, 0.0),
|
|
vec4(a_matWorld0.w, a_matWorld1.w, a_matWorld2.w, 1.0)
|
|
);
|
|
#else
|
|
matWorld = cc_matWorld;
|
|
#endif
|
|
}
|
|
|
|
void CCGetWorldMatrixFull(out mat4 matWorld, out mat4 matWorldIT)
|
|
{
|
|
#if USE_INSTANCING
|
|
matWorld = mat4(
|
|
vec4(a_matWorld0.xyz, 0.0),
|
|
vec4(a_matWorld1.xyz, 0.0),
|
|
vec4(a_matWorld2.xyz, 0.0),
|
|
vec4(a_matWorld0.w, a_matWorld1.w, a_matWorld2.w, 1.0)
|
|
);
|
|
matWorldIT = matWorld;
|
|
#else
|
|
matWorld = cc_matWorld;
|
|
matWorldIT = cc_matWorldIT;
|
|
#endif
|
|
}
|