Files
cocos4/editor/assets/chunks/builtin/internal-functions/world-transform.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

37 lines
917 B
Plaintext

// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
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)
);
#elif USE_BATCHING
matWorld = cc_matWorlds[int(a_dyn_batch_id)];
#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;
#elif USE_BATCHING
matWorld = cc_matWorlds[int(a_dyn_batch_id)];
matWorldIT = matWorld;
#else
matWorld = cc_matWorld;
matWorldIT = cc_matWorldIT;
#endif
}