Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- varying vec4 Color;
- varying vec2 TexCoord0;
- #ifdef VSHADER
- void main()
- {
- gl_Position = ProjectionMatrix * ViewMatrix * GLVertex;
- TexCoord0 = GLTexCoord0.xy;
- Color = GLColor;
- }
- #elif defined PSHADER
- #define TEX2DLOD textureLod
- uniform sampler2D Tex0;
- void main()
- {
- vec4 color = vec4( 0, 0, 0, 0 );
- vec2 hrange = ( abs( dFdx( TexCoord0 ) ) + abs( dFdy( TexCoord0 ) ) ) * 0.75;
- // LINE 1
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x, -hrange.y ), 0 ) * ( 0.1 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x * 0.5, -hrange.y ), 0 ) * ( 0.2 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( 0, -hrange.y ), 0 ) * ( 0.4 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x * 0.5, -hrange.y ), 0 ) * ( 0.2 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x, -hrange.y ), 0 ) * ( 0.1 * 0.1 );
- // LINE 2
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x, -hrange.y * 0.5 ), 0 ) * ( 0.1 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x * 0.5, -hrange.y * 0.5 ), 0 ) * ( 0.2 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( 0, -hrange.y * 0.5 ), 0 ) * ( 0.4 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x * 0.5, -hrange.y * 0.5 ), 0 ) * ( 0.2 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x, -hrange.y * 0.5 ), 0 ) * ( 0.1 * 0.2 );
- // LINE 3
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x, 0 ), 0 ) * ( 0.1 * 0.4 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x * 0.5, 0 ), 0 ) * ( 0.2 * 0.4 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( 0, 0 ), 0 ) * ( 0.4 * 0.4 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x * 0.5, 0 ), 0 ) * ( 0.2 * 0.4 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x, 0 ), 0 ) * ( 0.1 * 0.4 );
- // LINE 4
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x, hrange.y * 0.5 ), 0 ) * ( 0.1 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x * 0.5, hrange.y * 0.5 ), 0 ) * ( 0.2 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( 0, hrange.y * 0.5 ), 0 ) * ( 0.4 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x * 0.5, hrange.y * 0.5 ), 0 ) * ( 0.2 * 0.2 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x, hrange.y * 0.5 ), 0 ) * ( 0.1 * 0.2 );
- // LINE 5
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x, hrange.y ), 0 ) * ( 0.1 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( -hrange.x * 0.5, hrange.y ), 0 ) * ( 0.2 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( 0, hrange.y ), 0 ) * ( 0.4 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x * 0.5, hrange.y ), 0 ) * ( 0.2 * 0.1 );
- color += TEX2DLOD( Tex0, TexCoord0 + vec2( hrange.x, hrange.y ), 0 ) * ( 0.1 * 0.1 );
- gl_FragColor = color * Color;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement