comparison examples/E10_pong.nim @ 156:134647ed5b60

did: refactor memory selection
author Sam <sam@basx.dev>
date Sat, 29 Apr 2023 16:50:43 +0700
parents 253dd797e719
children 25d97fa0ad5c
comparison
equal deleted inserted replaced
155:321d3de6c78c 156:134647ed5b60
31 ball.transform = scale3d(ballSize, ballSize, 1'f) * translate3d(10'f, 10'f, 0'f) 31 ball.transform = scale3d(ballSize, ballSize, 1'f) * translate3d(10'f, 10'f, 0'f)
32 level.add ball 32 level.add ball
33 33
34 const 34 const
35 vertexInput = @[ 35 vertexInput = @[
36 attr[Vec3f]("position", memoryLocation=VRAM), 36 attr[Vec3f]("position"),
37 attr[Vec3f]("color", memoryLocation=VRAMVisible), 37 attr[Vec3f]("color", memoryPerformanceHint=PreferFastWrite),
38 attr[Mat4]("transform", memoryLocation=VRAMVisible, perInstance=true), 38 attr[Mat4]("transform", memoryPerformanceHint=PreferFastWrite, perInstance=true),
39 ] 39 ]
40 vertexOutput = @[attr[Vec3f]("outcolor")] 40 vertexOutput = @[attr[Vec3f]("outcolor")]
41 uniforms = @[attr[Mat4]("projection")] 41 uniforms = @[attr[Mat4]("projection")]
42 fragOutput = @[attr[Vec4f]("color")] 42 fragOutput = @[attr[Vec4f]("color")]
43 vertexCode = compileGlslShader( 43 vertexCode = compileGlslShader(