comparison examples/E04_input.nim @ 163:25d97fa0ad5c

fix: API change for shader attributes
author Sam <sam@basx.dev>
date Sat, 29 Apr 2023 18:29:19 +0700
parents 253dd797e719
children 84fd522fdf3f
comparison
equal deleted inserted replaced
162:68947a8ee127 163:25d97fa0ad5c
148 scene.add newEntity("cursor", cursormesh) 148 scene.add newEntity("cursor", cursormesh)
149 149
150 # shaders 150 # shaders
151 const 151 const
152 vertexInput = @[ 152 vertexInput = @[
153 attr[Vec3f]("position", memoryLocation=VRAM), 153 attr[Vec3f]("position"),
154 attr[Vec3f]("color", memoryLocation=VRAMVisible), 154 attr[Vec3f]("color", memoryPerformanceHint=PreferFastWrite),
155 attr[Mat4]("transform", memoryLocation=VRAMVisible, perInstance=true), 155 attr[Mat4]("transform", memoryPerformanceHint=PreferFastWrite, perInstance=true),
156 ] 156 ]
157 vertexOutput = @[attr[Vec3f]("outcolor")] 157 vertexOutput = @[attr[Vec3f]("outcolor")]
158 uniforms = @[attr[Mat4]("projection")] 158 uniforms = @[attr[Mat4]("projection")]
159 fragOutput = @[attr[Vec4f]("color")] 159 fragOutput = @[attr[Vec4f]("color")]
160 vertexCode = compileGlslShader( 160 vertexCode = compileGlslShader(