User:Flugan

From Bo3b's School for Shaderhackers
Revision as of 09:51, 22 October 2014 by Flugan (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Lesson 0

TheBall02 85 - Copy.jpg

Lesson 1

PS moved bloom downwards

//
// Generated by Microsoft (R) HLSL Shader Compiler 9.27.952.3022
//
// Parameters:
//
//   sampler2D FilterTexture;
//   float4 SampleMaskRect;
//   float4 SampleWeights[16];
//
//
// Registers:
//
//   Name           Reg   Size
//   -------------- ----- ----
//   SampleMaskRect c0       1
//   SampleWeights  c4      16
//   FilterTexture  s0       1
//

    ps_3_0
    def c1, 0, 1, 0, 0
    dcl_texcoord v0
    dcl_texcoord1 v1
    dcl_texcoord2 v2
    dcl_texcoord3 v3
    dcl_texcoord4 v4
    dcl_texcoord5 v5
    dcl_texcoord6 v6
    dcl_texcoord7 v7
    dcl_2d s0
    add r0, -c0.zwzw, v0.xywz
    cmp r0, r0, c1.x, c1.y
    add r1, c0.xyxy, -v0.xywz
    cmp r0, r1, c1.x, r0
    mul r0.xy, r0.ywzw, r0.xzzw
    texld r1, v0.wzzw, s0
    mul r1, r0.y, r1
    mul r1, r1, c5
    texld r2, v0, s0
    mul r0, r0.x, r2
    mad_pp r0, r0, c4, r1
    add r1, -c0.zwzw, v1.xywz
    cmp r1, r1, c1.x, c1.y
    add r2, c0.xyxy, -v1.xywz
    cmp r1, r2, c1.x, r1
    mul r1.xy, r1.ywzw, r1.xzzw
    texld r2, v1, s0
    mul r2, r1.x, r2
    mad_pp r0, r2, c6, r0
    texld r2, v1.wzzw, s0
    mul r1, r1.y, r2
    mad_pp r0, r1, c7, r0
    add r1, -c0.zwzw, v2.xywz
    cmp r1, r1, c1.x, c1.y
    add r2, c0.xyxy, -v2.xywz
    cmp r1, r2, c1.x, r1
    mul r1.xy, r1.ywzw, r1.xzzw
    texld r2, v2, s0
    mul r2, r1.x, r2
    mad_pp r0, r2, c8, r0
    texld r2, v2.wzzw, s0
    mul r1, r1.y, r2
    mad_pp r0, r1, c9, r0
    add r1, -c0.zwzw, v3.xywz
    cmp r1, r1, c1.x, c1.y
    add r2, c0.xyxy, -v3.xywz
    cmp r1, r2, c1.x, r1
    mul r1.xy, r1.ywzw, r1.xzzw
    texld r2, v3, s0
    mul r2, r1.x, r2
    mad_pp r0, r2, c10, r0
    texld r2, v3.wzzw, s0
    mul r1, r1.y, r2
    mad_pp r0, r1, c11, r0
    add r1, -c0.zwzw, v4.xywz
    cmp r1, r1, c1.x, c1.y
    add r2, c0.xyxy, -v4.xywz
    cmp r1, r2, c1.x, r1
    mul r1.xy, r1.ywzw, r1.xzzw
    texld r2, v4, s0
    mul r2, r1.x, r2
    mad_pp r0, r2, c12, r0
    texld r2, v4.wzzw, s0
    mul r1, r1.y, r2
    mad_pp r0, r1, c13, r0
    add r1, -c0.zwzw, v5.xywz
    cmp r1, r1, c1.x, c1.y
    add r2, c0.xyxy, -v5.xywz
    cmp r1, r2, c1.x, r1
    mul r1.xy, r1.ywzw, r1.xzzw
    texld r2, v5, s0
    mul r2, r1.x, r2
    mad_pp r0, r2, c14, r0
    texld r2, v5.wzzw, s0
    mul r1, r1.y, r2
    mad_pp r0, r1, c15, r0
    add r1, -c0.zwzw, v6.xywz
    cmp r1, r1, c1.x, c1.y
    add r2, c0.xyxy, -v6.xywz
    cmp r1, r2, c1.x, r1
    mul r1.xy, r1.ywzw, r1.xzzw
    texld r2, v6, s0
    mul r2, r1.x, r2
    mad_pp r0, r2, c16, r0
    texld r2, v6.wzzw, s0
    mul r1, r1.y, r2
    mad_pp r0, r1, c17, r0
    add r1, -c0.zwzw, v7.xywz
    cmp r1, r1, c1.x, c1.y
    add r2, c0.xyxy, -v7.xywz
    cmp r1, r2, c1.x, r1
    mul r1.xy, r1.ywzw, r1.xzzw
    texld r2, v7, s0
    mul r2, r1.x, r2
    mad_pp r0, r2, c18, r0
    texld r2, v7.wzzw, s0
    mul r1, r1.y, r2
    mad_pp oC0, r1, c19, r0

// approximately 88 instruction slots used (16 texture, 72 arithmetic)


Lesson 2

Before: TheBall05 85 - Copy.jpg After: TheBall06 85 - Copy.jpg

Lesson 3

[KEY1]
Key = 2 // mouse2
Presets = 1;2;
Type = 2

	mov oC0.w, c1.w
	// Change color
	mov oC0.x, c200.x
	// if Const1 = 0 disable effect, else leave it on
	mov r30.x, c220.x
	if_eq r30.x, c200.x
		mov oC0.xyzw, c200.wwww
	endif

TheBall07 85 - Copy.jpg