From abef6da56913f1c55528103e60a50451a39628b1 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Sun, 16 Jun 2024 10:35:45 +0300 Subject: initial commit --- misc/3ds/offset.v.pica | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 misc/3ds/offset.v.pica (limited to 'misc/3ds/offset.v.pica') diff --git a/misc/3ds/offset.v.pica b/misc/3ds/offset.v.pica new file mode 100644 index 0000000..9a462db --- /dev/null +++ b/misc/3ds/offset.v.pica @@ -0,0 +1,38 @@ +; Vertex shader for rendering textured vertices with an offset for PICA200 GPU on the Nintendo 3DS +; ================================================================================== + +; Uniforms +.fvec MVP[4]; +.fvec tex_offset; + +; Constants +.constf ONE_DIV_255(0.003921568627, 0.003921568627, 0.003921568627, 0.003921568627) + +; Outputs +.out out_pos position +.out out_col color +.out out_tex texcoord0 + +; Inputs (defined as aliases for convenience) +.alias in_pos v0 +.alias in_col v1 +.alias in_tex v2 + +.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 + ; out_tex = in_tex + tex_offset + add out_tex, tex_offset, in_tex + + end +.end + -- cgit 1.4.1-2-gfad0