Simplify lessons that use textured shaders w/o tinting

This commit is contained in:
2025-06-14 21:39:25 +10:00
parent ac038eecfd
commit 6e08f363ae
24 changed files with 78 additions and 52 deletions

View File

@@ -298,11 +298,8 @@ struct Lesson10: AppDelegate
modelView.translate(-camera.position)
// Push shader uniforms
struct Uniforms { var modelViewProj: simd_float4x4, color: SIMD4<Float> }
var u = Uniforms(
modelViewProj: self.projection * modelView,
color: .init(repeating: 1.0))
SDL_PushGPUVertexUniformData(cmd, 0, &u, UInt32(MemoryLayout<Uniforms>.size))
var modelViewProj = self.projection * modelView
SDL_PushGPUVertexUniformData(cmd, 0, &modelViewProj, UInt32(MemoryLayout<simd_float4x4>.size))
// Draw world
SDL_DrawGPUPrimitives(pass, UInt32(self.world.vertices.count), 1, 0, 0)