ftpiiu_plugin/source/3ds/vshader.v.pica
Michael Theall 86be27cd31 v3.0.0-rc1
2020-04-28 10:25:54 -05:00

62 lines
1.6 KiB
Plaintext

; ftpd is a server implementation based on the following:
; - RFC 959 (https://tools.ietf.org/html/rfc959)
; - RFC 3659 (https://tools.ietf.org/html/rfc3659)
; - suggested implementation details from https://cr.yp.to/ftp/filesystem.html
;
; Copyright (C) 2020 Michael Theall
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <https://www.gnu.org/licenses/>.
; Example PICA200 vertex shader
; Uniforms
.fvec proj[4]
; Constants
.constf constants(1.0, 0.0, 0.00392156862745, 0.0)
; Outputs
.out outPos position
.out outUv texcoord0
.out outColor color
; Inputs (defined as aliases for convenience)
.alias inPos v0
.alias inUv v1
.alias inColor v2
.proc main
; Force inPos.z = 0.0, inPos.w = 1.0
mov r0.xy, inPos.xy
mov r0.zw, constants.yx
; outPos = proj * inPos
dp4 outPos.x, proj[0], r0
dp4 outPos.y, proj[1], r0
dp4 outPos.z, proj[2], r0
dp4 outPos.w, proj[3], r0
; outUv = inUv
mov outUv, inUv
; normalize inColor
mul r1, constants.zzzz, inColor
; outColor = inColor
mov outColor, r1
; We're finished
end
.end