mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
feat: Implement color animation in Metal shaders by using diffuse and emissive vertex constants for output color.
This commit is contained in:
parent
8fb51991e0
commit
7cf7127810
@ -321,7 +321,11 @@ namespace {
|
|||||||
" }\n"
|
" }\n"
|
||||||
" float4 pos4 = c.mvp * float4(skinned, 1.0);\n"
|
" float4 pos4 = c.mvp * float4(skinned, 1.0);\n"
|
||||||
" out.position = pos4;\n"
|
" out.position = pos4;\n"
|
||||||
" out.color = float4(1.0, 1.0, 1.0, 1.0);\n"
|
" // Read diffuse (vc[28]) and emissive (vc[29]) for color animation\n"
|
||||||
|
" float4 diffuse = vc[28];\n"
|
||||||
|
" float4 emissive = vc[29];\n"
|
||||||
|
" float4 color = diffuse + emissive;\n"
|
||||||
|
" out.color = (diffuse.x > 1e30) ? float4(1.0, 1.0, 1.0, 1.0) : color;\n"
|
||||||
" out.texcoord = float2(0.0, 0.0);\n"
|
" out.texcoord = float2(0.0, 0.0);\n"
|
||||||
" out.texcoord1 = float2(0.0, 0.0);\n"
|
" out.texcoord1 = float2(0.0, 0.0);\n"
|
||||||
" out.viewZ = pos4.w;\n"
|
" out.viewZ = pos4.w;\n"
|
||||||
@ -347,7 +351,11 @@ namespace {
|
|||||||
" }\n"
|
" }\n"
|
||||||
" float4 pos4 = c.mvp * float4(skinned, 1.0);\n"
|
" float4 pos4 = c.mvp * float4(skinned, 1.0);\n"
|
||||||
" out.position = pos4;\n"
|
" out.position = pos4;\n"
|
||||||
" out.color = float4(1.0, 1.0, 1.0, 1.0);\n"
|
" // Read diffuse (vc[28]) and emissive (vc[29]) for color animation\n"
|
||||||
|
" float4 diffuse = vc[28];\n"
|
||||||
|
" float4 emissive = vc[29];\n"
|
||||||
|
" float4 color = diffuse + emissive;\n"
|
||||||
|
" out.color = (diffuse.x > 1e30) ? float4(1.0, 1.0, 1.0, 1.0) : color;\n"
|
||||||
" out.texcoord = in.texcoord;\n"
|
" out.texcoord = in.texcoord;\n"
|
||||||
" out.texcoord1 = in.texcoord;\n"
|
" out.texcoord1 = in.texcoord;\n"
|
||||||
" out.viewZ = pos4.w;\n"
|
" out.viewZ = pos4.w;\n"
|
||||||
@ -373,7 +381,11 @@ namespace {
|
|||||||
" }\n"
|
" }\n"
|
||||||
" float4 pos4 = c.mvp * float4(skinned, 1.0);\n"
|
" float4 pos4 = c.mvp * float4(skinned, 1.0);\n"
|
||||||
" out.position = pos4;\n"
|
" out.position = pos4;\n"
|
||||||
" out.color = float4(1.0, 1.0, 1.0, 1.0);\n"
|
" // Read diffuse (vc[28]) and emissive (vc[29]) for color animation\n"
|
||||||
|
" float4 diffuse = vc[28];\n"
|
||||||
|
" float4 emissive = vc[29];\n"
|
||||||
|
" float4 color = diffuse + emissive;\n"
|
||||||
|
" out.color = (diffuse.x > 1e30) ? float4(1.0, 1.0, 1.0, 1.0) : color;\n"
|
||||||
" out.texcoord = in.texcoord;\n"
|
" out.texcoord = in.texcoord;\n"
|
||||||
" out.texcoord1 = in.texcoord1;\n"
|
" out.texcoord1 = in.texcoord1;\n"
|
||||||
" out.viewZ = pos4.w;\n"
|
" out.viewZ = pos4.w;\n"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user