Difference between revisions of "User:Flugan"
From Bo3b's School for Shaderhackers
(Created page with "Lesson 0 700px") |
|||
Line 2: | Line 2: | ||
[[File:TheBall02 85 - Copy.jpg|700px]] | [[File:TheBall02 85 - Copy.jpg|700px]] | ||
+ | <br> | ||
+ | == Lesson 1 == | ||
+ | PS moved bloom downwards | ||
+ | <nowiki>// | ||
+ | // 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)</nowiki> |
Revision as of 06:44, 22 October 2014
Lesson 0
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)