libctru/examples/graphics/hello_triangle/data/shader.vsh

32 lines
666 B
V Shell
Raw Normal View History

2015-03-22 15:48:25 +01:00
; Really simple & stupid PICA200 shader
; Taken from picasso example
; Uniforms
.fvec projection[4]
; Constants
.constf myconst(0.0, 1.0, -1.0, 0.0)
.alias ones myconst.yyyy ; (1.0,1.0,1.0,1.0)
; Outputs : here only position and color
.out outpos position
.out outclr color
; Inputs : here we have only vertices
.alias inpos v0
.proc main
; r0 = (inpos.x, inpos.y, inpos.z, 1.0)
mov r0.xyz, inpos
mov r0.w, ones
; outpos = projection * r1
dp4 outpos.x, projection[0], r0
dp4 outpos.y, projection[1], r0
dp4 outpos.z, projection[2], r0
dp4 outpos.w, projection[3], r0
; Set vertex color to white rgba => (1.0,1.0,1.0,1.0)
mov outclr, ones
end
.end