{"id":476,"date":"2012-01-20T23:28:54","date_gmt":"2012-01-20T20:28:54","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=476"},"modified":"2012-01-21T00:11:24","modified_gmt":"2012-01-20T21:11:24","slug":"wipe-transition-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/01\/20\/wipe-transition-shader\/","title":{"rendered":"Wipe transition (Shader)"},"content":{"rendered":"<p><a href=\"http:\/\/unitycoder.com\/upload\/demos\/mWipeShader\/\" target=\"_blank\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"477\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/01\/20\/wipe-transition-shader\/mwipeshader\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mWipeShader.jpg?fit=680%2C503&amp;ssl=1\" data-orig-size=\"680,503\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"mWipeShader\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mWipeShader.jpg?fit=680%2C503&amp;ssl=1\" class=\"alignnone size-full wp-image-477\" title=\"mWipeShader\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mWipeShader.jpg?resize=680%2C503\" alt=\"\" width=\"680\" height=\"503\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mWipeShader.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mWipeShader.jpg?resize=300%2C221&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Wipe shader test.. Modified unity version from the original glsl shader &#8220;postpro&#8221; by iq (2009)<\/p>\n<p><strong>Webplayer:<\/strong><br \/>\n<a href=\"http:\/\/unitycoder.com\/upload\/demos\/mWipeShader\/\" target=\"_blank\">http:\/\/unitycoder.com\/upload\/demos\/mWipeShader\/<\/a><\/p>\n<p><strong>Source: (shader)<\/strong><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\/\/ Modified Unity version - WipeShader - mgear - http:\/\/unitycoder.com\/blog\/\r\n\/\/ ORIGINAL GLSL SHADER &quot;Postpro&quot; WAS MADE BY: iq (2009)\r\n\r\nShader &quot;mShaders\/mWipe1&quot;\r\n{\r\nProperties\r\n{\r\n_tex0 (&quot;Texture1&quot;, 2D) = &quot;white&quot; {}\r\n_tex1 (&quot;Texture2&quot;, 2D) = &quot;white&quot; {}\r\n}\r\n\r\nSubShader\r\n{\r\nTags {Queue = Geometry}\r\nPass\r\n{\r\nCGPROGRAM\r\n#pragma target 3.0\r\n#pragma vertex vert\r\n#pragma fragment frag\r\n#include &quot;UnityCG.cginc&quot;\r\n\r\nsampler2D _tex0;\r\nsampler2D _tex1;\r\n\r\nstruct v2f {\r\nfloat4 pos : POSITION;\r\nfloat4 color : COLOR0;\r\nfloat4 fragPos : COLOR1;\r\nfloat2\u00a0 uv : TEXCOORD0;\r\n};\r\n\r\nfloat4 _tex0_ST;\r\n\r\nv2f vert (appdata_base v)\r\n{\r\nv2f o;\r\no.pos = mul (UNITY_MATRIX_MVP, v.vertex);\r\no.fragPos = o.pos;\r\no.uv = TRANSFORM_TEX (v.texcoord, _tex0);\r\no.color = float4 (1.0, 1.0, 1.0, 1);\r\nreturn o;\r\n}\r\n\r\n\/\/ I dont really have idea whats happening here..its a bit modified version from the original shader\r\nhalf4 frag (v2f i) : COLOR\r\n{\r\nfloat animtime = _Time*10.0;\r\nfloat2 q = i.uv.xy \/ float2(1,1);\r\nfloat3 oricol = tex2D (_tex0,float2(q.x,q.y)).xyz;\r\nfloat3 col = tex2D (_tex1,float2(i.uv.x,i.uv.y)).xyz;\r\nfloat comp = smoothstep( 0.2, 0.7, sin(animtime) );\r\ncol = lerp(col,oricol,\u00a0 clamp(-2.0+2.0*q.x+3.0*comp,0.0,1.0)); \/\/ ??\r\nreturn float4(col,1);\r\n}\r\nENDCG\r\n}\r\n}\r\nFallBack &quot;VertexLit&quot;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Wipe shader test.. Modified unity version from the original glsl shader &#8220;postpro&#8221; by iq (2009) Webplayer: http:\/\/unitycoder.com\/upload\/demos\/mWipeShader\/ Source: (shader) \/\/ Modified Unity version &#8211; WipeShader &#8211; mgear &#8211; http:\/\/unitycoder.com\/blog\/ \/\/ ORIGINAL GLSL SHADER &quot;Postpro&quot; WAS MADE BY: iq (2009) Shader &quot;mShaders\/mWipe1&quot; { Properties { _tex0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":477,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[13,3],"tags":[125,126,14,124],"class_list":["post-476","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shaders","category-unity3d","tag-crossfade","tag-fading","tag-shader","tag-wipe"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/01\/mWipeShader.jpg?fit=680%2C503&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-7G","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=476"}],"version-history":[{"count":6,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/476\/revisions"}],"predecessor-version":[{"id":483,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/476\/revisions\/483"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/477"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}