Shaders feitos com blocos: tinyblocks-shader e o compilador da 3d
"compile o shader [nome] com [pilha]" tem um encaixe de pilha: a pilha nao roda, a 3d le o codigo dela e o compila (d3_shader.c) em nos com tipo (numero, cor, condicao), de onde saem o GLSL da funcao tb_shade e um interpretador para o renderizador em software (ponto e normal com perspectiva, pixel a pixel). "use o shader [nome] no objeto" e "GLSL do shader" completam. tinyblocks-shader: o vocabulario (cor do pixel =, cor do pixel, cor do objeto, luz, tempo, x/y/z do ponto e da normal, cor r g b, cor [nome], misture, canais, brilho). Valem tambem as contas, comparacoes, o se/senao e as variaveis comuns (viram locais do shader). Contrato v2: Tb3dDraw.shader, Tb3dFrame.time, Tb3dRenderer.shaders. GL: um programa por shader. Vulkan: o fragment compilado em execucao pela libshaderc (dlopen) e push constants de 160 bytes; sem ela, a 3d usa o OpenGL ou o software nesses quadros. test-3d: xadrez e degrade iguais nos tres renderizadores (diferenca media 0,002), sem avisos da camada de validacao na NVIDIA, Intel e llvmpipe; erros claros para bloco que nao cabe e para comparar cores. examples/jogo-3d/shaders: ondas no chao e listras na bola. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a3bae660fb
commit
16009eca8e
27 files changed
+4376
-88
No files matched your search
@@ -91,4 +91,57 @@ static const uint32_t s_frag_spv[121] = {
|
||||
0x00010038,
|
||||
};
|
||||
|
||||
static const uint32_t s_vert_shd_spv[397] = {
|
||||
0x07230203, 0x00010000, 0x000d000b, 0x00000051, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
|
||||
0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
|
||||
0x000a000f, 0x00000000, 0x00000004, 0x6e69616d, 0x00000000, 0x00000015, 0x0000002d, 0x00000032,
|
||||
0x0000003d, 0x0000004a, 0x00040048, 0x0000000b, 0x00000000, 0x00000005, 0x00050048, 0x0000000b,
|
||||
0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x0000000b, 0x00000000, 0x00000007, 0x00000010,
|
||||
0x00040048, 0x0000000b, 0x00000001, 0x00000005, 0x00050048, 0x0000000b, 0x00000001, 0x00000023,
|
||||
0x00000040, 0x00050048, 0x0000000b, 0x00000001, 0x00000007, 0x00000010, 0x00050048, 0x0000000b,
|
||||
0x00000002, 0x00000023, 0x00000080, 0x00050048, 0x0000000b, 0x00000003, 0x00000023, 0x00000090,
|
||||
0x00030047, 0x0000000b, 0x00000002, 0x00040047, 0x00000015, 0x0000001e, 0x00000000, 0x00050048,
|
||||
0x0000002b, 0x00000000, 0x0000000b, 0x00000000, 0x00050048, 0x0000002b, 0x00000001, 0x0000000b,
|
||||
0x00000001, 0x00050048, 0x0000002b, 0x00000002, 0x0000000b, 0x00000003, 0x00050048, 0x0000002b,
|
||||
0x00000003, 0x0000000b, 0x00000004, 0x00030047, 0x0000002b, 0x00000002, 0x00040047, 0x00000032,
|
||||
0x0000001e, 0x00000000, 0x00040047, 0x0000003d, 0x0000001e, 0x00000001, 0x00040047, 0x0000004a,
|
||||
0x0000001e, 0x00000001, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00030016,
|
||||
0x00000006, 0x00000020, 0x00040017, 0x00000007, 0x00000006, 0x00000004, 0x00040018, 0x0000000a,
|
||||
0x00000007, 0x00000004, 0x0006001e, 0x0000000b, 0x0000000a, 0x0000000a, 0x00000007, 0x00000007,
|
||||
0x00040020, 0x0000000c, 0x00000009, 0x0000000b, 0x0004003b, 0x0000000c, 0x0000000d, 0x00000009,
|
||||
0x00040015, 0x0000000e, 0x00000020, 0x00000001, 0x0004002b, 0x0000000e, 0x0000000f, 0x00000000,
|
||||
0x00040020, 0x00000010, 0x00000009, 0x0000000a, 0x00040017, 0x00000013, 0x00000006, 0x00000003,
|
||||
0x00040020, 0x00000014, 0x00000001, 0x00000013, 0x0004003b, 0x00000014, 0x00000015, 0x00000001,
|
||||
0x0004002b, 0x00000006, 0x00000017, 0x3f800000, 0x00040015, 0x0000001d, 0x00000020, 0x00000000,
|
||||
0x0004002b, 0x00000006, 0x00000026, 0x3f000000, 0x0004002b, 0x0000001d, 0x00000029, 0x00000001,
|
||||
0x0004001c, 0x0000002a, 0x00000006, 0x00000029, 0x0006001e, 0x0000002b, 0x00000007, 0x00000006,
|
||||
0x0000002a, 0x0000002a, 0x00040020, 0x0000002c, 0x00000003, 0x0000002b, 0x0004003b, 0x0000002c,
|
||||
0x0000002d, 0x00000003, 0x00040020, 0x0000002f, 0x00000003, 0x00000007, 0x00040020, 0x00000031,
|
||||
0x00000003, 0x00000013, 0x0004003b, 0x00000031, 0x00000032, 0x00000003, 0x0004002b, 0x0000000e,
|
||||
0x00000033, 0x00000001, 0x0004003b, 0x00000031, 0x0000003d, 0x00000003, 0x00040018, 0x00000040,
|
||||
0x00000013, 0x00000003, 0x0004003b, 0x00000014, 0x0000004a, 0x00000001, 0x00050036, 0x00000002,
|
||||
0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x00050041, 0x00000010, 0x00000011,
|
||||
0x0000000d, 0x0000000f, 0x0004003d, 0x0000000a, 0x00000012, 0x00000011, 0x0004003d, 0x00000013,
|
||||
0x00000016, 0x00000015, 0x00050051, 0x00000006, 0x00000018, 0x00000016, 0x00000000, 0x00050051,
|
||||
0x00000006, 0x00000019, 0x00000016, 0x00000001, 0x00050051, 0x00000006, 0x0000001a, 0x00000016,
|
||||
0x00000002, 0x00070050, 0x00000007, 0x0000001b, 0x00000018, 0x00000019, 0x0000001a, 0x00000017,
|
||||
0x00050091, 0x00000007, 0x0000001c, 0x00000012, 0x0000001b, 0x00050051, 0x00000006, 0x00000021,
|
||||
0x0000001c, 0x00000002, 0x00050051, 0x00000006, 0x00000024, 0x0000001c, 0x00000003, 0x00050081,
|
||||
0x00000006, 0x00000025, 0x00000021, 0x00000024, 0x00050085, 0x00000006, 0x00000027, 0x00000025,
|
||||
0x00000026, 0x00060052, 0x00000007, 0x00000050, 0x00000027, 0x0000001c, 0x00000002, 0x00050041,
|
||||
0x0000002f, 0x00000030, 0x0000002d, 0x0000000f, 0x0003003e, 0x00000030, 0x00000050, 0x00050041,
|
||||
0x00000010, 0x00000034, 0x0000000d, 0x00000033, 0x0004003d, 0x0000000a, 0x00000035, 0x00000034,
|
||||
0x00050091, 0x00000007, 0x0000003b, 0x00000035, 0x0000001b, 0x0008004f, 0x00000013, 0x0000003c,
|
||||
0x0000003b, 0x0000003b, 0x00000000, 0x00000001, 0x00000002, 0x0003003e, 0x00000032, 0x0000003c,
|
||||
0x00050051, 0x00000007, 0x00000041, 0x00000035, 0x00000000, 0x0008004f, 0x00000013, 0x00000042,
|
||||
0x00000041, 0x00000041, 0x00000000, 0x00000001, 0x00000002, 0x00050051, 0x00000007, 0x00000043,
|
||||
0x00000035, 0x00000001, 0x0008004f, 0x00000013, 0x00000044, 0x00000043, 0x00000043, 0x00000000,
|
||||
0x00000001, 0x00000002, 0x00050051, 0x00000007, 0x00000045, 0x00000035, 0x00000002, 0x0008004f,
|
||||
0x00000013, 0x00000046, 0x00000045, 0x00000045, 0x00000000, 0x00000001, 0x00000002, 0x00060050,
|
||||
0x00000040, 0x00000047, 0x00000042, 0x00000044, 0x00000046, 0x0006000c, 0x00000040, 0x00000048,
|
||||
0x00000001, 0x00000022, 0x00000047, 0x00040054, 0x00000040, 0x00000049, 0x00000048, 0x0004003d,
|
||||
0x00000013, 0x0000004b, 0x0000004a, 0x00050091, 0x00000013, 0x0000004c, 0x00000049, 0x0000004b,
|
||||
0x0003003e, 0x0000003d, 0x0000004c, 0x000100fd, 0x00010038,
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user