[AD] bcb9eb95afc5aa00990627a7c27a954b549ecea7 breaks shader

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


This revision breaks one of my shaders for some unknown reason. If I fudge the glGetUniformLocation back in where the projview matrix is set, it works. By breaking I mean it outputs nothing but black. My vertex shader is the default and pixel shader is below.

Trent

		const char *tinter_pixel_source =
#if defined OPENGLES
		"precision mediump float;\n"
#endif
		"uniform sampler2D " ALLEGRO_SHADER_VAR_TEX ";\n"
		"varying vec4 varying_color;\n"
		"varying vec2 varying_texcoord;\n"
		"uniform float r;\n"
		"uniform float g;\n"
		"uniform float b;\n"
		"uniform float ratio;\n"
		"void main() {\n"
		"   float avg, dr, dg, db;\n"
		"   vec4 color = varying_color;\n"
		"   vec4 coord = vec4(varying_texcoord, 0.0, 1.0);\n"
		"   color *= texture2D(" ALLEGRO_SHADER_VAR_TEX ", coord.st);\n"
		"   avg = (color.r + color.g + color.b) / 3.0;\n"
		"   dr = avg * r;\n"
		"   dg = avg * g;\n"
		"   db = avg * b;\n"
		"   color.r = color.r - (ratio * (color.r - dr));\n"
		"   color.g = color.g - (ratio * (color.g - dg));\n"
		"   color.b = color.b - (ratio * (color.b - db));\n"
		"   gl_FragColor = color;\n"
		"}";





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/