summary refs log tree commit diff
path: root/misc/3ds/coloured.v.pica
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2024-06-16 10:35:45 +0300
committerWlodekM <[email protected]>2024-06-16 10:35:45 +0300
commitabef6da56913f1c55528103e60a50451a39628b1 (patch)
treeb3c8092471ecbb73e568cd0d336efa0e7871ee8d /misc/3ds/coloured.v.pica
initial commit
Diffstat (limited to 'misc/3ds/coloured.v.pica')
-rw-r--r--misc/3ds/coloured.v.pica33
1 files changed, 33 insertions, 0 deletions
diff --git a/misc/3ds/coloured.v.pica b/misc/3ds/coloured.v.pica
new file mode 100644
index 0000000..7954ed9
--- /dev/null
+++ b/misc/3ds/coloured.v.pica
@@ -0,0 +1,33 @@
+; Vertex shader for rendering coloured vertices for PICA200 GPU on the Nintendo 3DS
+; ==================================================================================
+
+; Uniforms
+.fvec MVP[4];
+
+; Constants
+.constf ONE_DIV_255(0.003921568627, 0.003921568627, 0.003921568627, 0.003921568627)
+
+; Outputs
+.out out_pos position
+.out out_col color
+
+; Inputs (defined as aliases for convenience)
+.alias in_pos v0
+.alias in_col v1
+
+.proc main
+	; r0 = in_pos
+	mov r0, in_pos
+
+	; out_pos = MVP * r0
+	dp4 out_pos.x, MVP[0], r0
+	dp4 out_pos.y, MVP[1], r0
+	dp4 out_pos.z, MVP[2], r0
+	dp4 out_pos.w, MVP[3], r0
+
+	; out_col = in_col * ONE_DIV_255
+	mul out_col, ONE_DIV_255, in_col
+	
+	end
+.end
+