Mercurial > games > semicongine
comparison tests/test_gltf.nim @ 1281:c09cdff9a97e
merge
author | sam <sam@basx.dev> |
---|---|
date | Mon, 29 Jul 2024 15:53:03 +0700 |
parents | a89a70ea3da2 e0ba4aead324 |
children | 0369fa1ffbd9 |
comparison
equal
deleted
inserted
replaced
1280:a89a70ea3da2 | 1281:c09cdff9a97e |
---|---|
27 # normalTexture: int32 = -1 | 27 # normalTexture: int32 = -1 |
28 # occlusionTexture: int32 = -1 | 28 # occlusionTexture: int32 = -1 |
29 emissive: Vec4f = vec4(0, 0, 0, 0) | 29 emissive: Vec4f = vec4(0, 0, 0, 0) |
30 # emissiveTexture: int32 = -1 | 30 # emissiveTexture: int32 = -1 |
31 MainDescriptors = object | 31 MainDescriptors = object |
32 materials: array[32, GPUValue[Material, UniformBuffer]] | 32 materials: array[50, GPUValue[Material, UniformBuffer]] |
33 camera: GPUValue[Camera, UniformBufferMapped] | 33 camera: GPUValue[Camera, UniformBufferMapped] |
34 Shader = object | 34 Shader = object |
35 objectData {.PushConstantAttribute.}: ObjectData | 35 objectData {.PushConstantAttribute.}: ObjectData |
36 position {.VertexAttribute.}: Vec3f | 36 position {.VertexAttribute.}: Vec3f |
37 color {.VertexAttribute.}: Vec4f | 37 color {.VertexAttribute.}: Vec4f |
127 for primitive in mitems(mesh): | 127 for primitive in mitems(mesh): |
128 primitive[0].color = asGPUArray(newSeqWith(primitive[0].position.data.len, vec4(1, 1, 1, 1)), VertexBuffer) | 128 primitive[0].color = asGPUArray(newSeqWith(primitive[0].position.data.len, vec4(1, 1, 1, 1)), VertexBuffer) |
129 renderdata.AssignBuffers(primitive[0]) | 129 renderdata.AssignBuffers(primitive[0]) |
130 renderdata.AssignBuffers(descriptors) | 130 renderdata.AssignBuffers(descriptors) |
131 | 131 |
132 var pipeline = CreatePipeline[Shader](renderPass = vulkan.swapchain.renderPass) | 132 var pipeline = CreatePipeline[Shader](renderPass = vulkan.swapchain.renderPass, cullMode=[]) |
133 InitDescriptorSet(renderdata, pipeline.descriptorSetLayouts[0], descriptors) | 133 InitDescriptorSet(renderdata, pipeline.descriptorSetLayouts[0], descriptors) |
134 | 134 |
135 renderdata.FlushAllMemory() | 135 renderdata.FlushAllMemory() |
136 | 136 |
137 proc drawNode(commandbuffer: VkCommandBuffer, pipeline: Pipeline, nodeId: int, transform: Mat4) = | 137 proc drawNode(commandbuffer: VkCommandBuffer, pipeline: Pipeline, nodeId: int, transform: Mat4) = |