Permalink
Browse files

Added a missing file

  • Loading branch information...
Firew0lf committed Aug 5, 2016
1 parent 49c87e5 commit 3255f2ad74b14e3a0a9299965dc40c2825786f66
Showing with 44 additions and 0 deletions.
  1. +44 −0 libs/sf2dlib/libsf2d/source/shader.v.pica
@@ -0,0 +1,44 @@
; Outputs
.out outpos position
.out outtc0 texcoord0
.out outclr color

; Inputs
.alias inpos v0
.alias inarg v1

; Uniforms
.fvec projection[4]
.fvec transform
.bool useTransform

; Constants
.constf RGBA8_TO_FLOAT4(0.00392156862, 0, 0, 0)

.proc main
ifu useTransform
; outpos = projection * transform * in.pos
dp4 r15.x, transform[0], inpos
dp4 r15.y, transform[1], inpos
dp4 r15.z, transform[2], inpos
dp4 r15.w, transform[3], inpos
dp4 outpos.x, projection[0], r15
dp4 outpos.y, projection[1], r15
dp4 outpos.z, projection[2], r15
dp4 outpos.w, projection[3], r15
.else
; outpos = projection * in.pos
dp4 outpos.x, projection[0], inpos
dp4 outpos.y, projection[1], inpos
dp4 outpos.z, projection[2], inpos
dp4 outpos.w, projection[3], inpos
.end

; outtc0 = in.texcoord
mov outtc0, inarg

; outclr = RGBA8_TO_FLOAT4(in.color)
mul outclr, RGBA8_TO_FLOAT4.xxxx, inarg

end
.end

0 comments on commit 3255f2a

Please sign in to comment.