Commit 86c76978 authored by Gargaj's avatar Gargaj
Browse files

replace default shader with something textureless

(thanks to glslsandbox for inspiration)
parent e1a2ca90
......@@ -120,9 +120,14 @@ namespace Renderer
"\n"
"layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything\n"
"\n"
"vec4 plas( vec2 v, float time )\n"
"{\n"
" float c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 );\n"
" return vec4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 );\n"
"}\n"
"void main(void)\n"
"{\n"
" vec2 uv = gl_TexCoord[0].xy;\n";
" vec2 uv = gl_TexCoord[0].xy;\n"
" uv -= 0.5;\n"
" uv /= vec2(v2Resolution.y / v2Resolution.x, 1);\n"
"\n"
......@@ -135,8 +140,9 @@ namespace Renderer
" m.x += sin( fGlobalTime ) * 0.1;\n"
" m.y += fGlobalTime * 0.25;\n"
"\n"
" vec4 t = texture( texTex2, m.xy ) * d; // or /d\n"
" out_color = f + t;// + uv.xyxy * 0.5 * (sin( fGlobalTime ) + 1.5);\n"
" vec4 t = plas( m * 3.14, fGlobalTime ) / d;\n"
" t = clamp( t, 0.0, 1.0 );\n"
" out_color = f + t;\n"
"}";
SDL_Surface * mScreen = NULL;
......
......@@ -77,6 +77,11 @@ namespace Renderer
"{%midi:end%}"
"}\n"
"\n"
"float4 plas( float2 v, float time )\n"
"{\n"
" float c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 );\n"
" return float4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 );\n"
"}\n"
"float4 main( float4 position : SV_POSITION, float2 TexCoord : TEXCOORD ) : SV_TARGET\n"
"{\n"
" float2 uv = TexCoord;\n"
......@@ -92,8 +97,9 @@ namespace Renderer
" m.x += sin( fGlobalTime ) * 0.1;\n"
" m.y += fGlobalTime * 0.25;\n"
"\n"
" float4 t = texTex2.Sample( smp, m.xy ) * d; // or /d\n"
" return f + t;// + uv.xyxy * 0.5 * (sin( fGlobalTime ) + 1.5);\n"
" float4 t = plas( m * 3.14, fGlobalTime ) / d;\n"
" t = saturate( t );\n"
" return f + t;\n"
"}";
char defaultVertexShader[65536] =
......
......@@ -72,6 +72,11 @@ namespace Renderer
"float fGlobalTime; // in seconds\n"
"float2 v2Resolution; // viewport resolution (in pixels)\n"
"\n"
"float4 plas( float2 v, float time )\n"
"{\n"
" float c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 );\n"
" return float4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 );\n"
"}\n"
"float4 main( float2 TexCoord : TEXCOORD0 ) : COLOR0\n"
"{\n"
" float2 uv = TexCoord;\n"
......@@ -87,8 +92,9 @@ namespace Renderer
" m.x += sin( fGlobalTime ) * 0.1;\n"
" m.y += fGlobalTime * 0.25;\n"
"\n"
" float4 t = tex2D( texTex2, m.xy ) * d; // or /d\n"
" return f + t;// + uv.xyxy * 0.5 * (sin( fGlobalTime ) + 1.5);\n"
" float4 t = plas( m * 3.14, fGlobalTime ) / d;\n"
" t = saturate( t );\n"
" return f + t;\n"
"}";
char defaultVertexShader[65536] =
"struct VS_INPUT_PP { float3 Pos : POSITION0; float2 TexCoord : TEXCOORD0; };\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment