diff options
| author | skal <pascal.massimino@gmail.com> | 2026-05-21 08:10:47 +0200 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-05-21 08:10:47 +0200 |
| commit | d806027dcaeadcdd8d2febd88bc46b2fd2c465de (patch) | |
| tree | 30bc1ef9f40ccab7c00e31ee20e62bb86755fa26 /src/effects/rotating_cube_effect.cc | |
| parent | 680042a18c11ad5e58757e45b260745c2f52417f (diff) | |
Diffstat (limited to 'src/effects/rotating_cube_effect.cc')
| -rw-r--r-- | src/effects/rotating_cube_effect.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 000d177..ec587b5 100644 --- a/src/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -44,7 +44,8 @@ RotatingCube::RotatingCube(const GpuContext& ctx, wgpuDeviceCreatePipelineLayout(ctx_.device, &pl_desc); // Load shader - const std::string composed = ShaderComposer::Get().Compose({}, rotating_cube_wgsl); + const std::string composed = + ShaderComposer::Get().Compose({}, rotating_cube_wgsl); WGPUShaderSourceWGSL wgsl_src = {}; wgsl_src.chain.sType = WGPUSType_ShaderSourceWGSL; wgsl_src.code = str_view(composed.c_str()); @@ -78,7 +79,7 @@ RotatingCube::RotatingCube(const GpuContext& ctx, pipeline_desc.vertex.entryPoint = str_view("vs_main"); pipeline_desc.primitive.topology = WGPUPrimitiveTopology_TriangleList; pipeline_desc.primitive.cullMode = WGPUCullMode_Back; - pipeline_desc.primitive.frontFace = WGPUFrontFace_CW; // Y-flipped perspective + pipeline_desc.primitive.frontFace = WGPUFrontFace_CW; // Y-flipped perspective pipeline_desc.depthStencil = &depth_stencil; pipeline_desc.multisample.count = 1; pipeline_desc.multisample.mask = 0xFFFFFFFF; @@ -136,8 +137,7 @@ void RotatingCube::render(WGPUCommandEncoder encoder, // Update uniforms const Uniforms uniforms = Uniforms::make( - view_proj, - vec4(camera_pos.x, camera_pos.y, camera_pos.z, params.time), + view_proj, vec4(camera_pos.x, camera_pos.y, camera_pos.z, params.time), vec4(1.0f, 0.0f, 0.0f, 0.0f), params.resolution, params.aspect_ratio); const ObjectData obj_data = { |
