• Advertisement
Sign in to follow this  

MAX_DRAW_BUFFERS & glDrawBuffers not same

This topic is 4515 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a nvidia 5300 and it has GL_MAX_DRAW_BUFFERS =4 . However my shader program which uses 4 MRT fails to compile saying that i dont have ATI_Draw_buffers on my card. Can someone plesae explain the difference to me Thanx

Share this post

Link to post
Share on other sites

uniform sampler2DRect tex0;
tex0 = {Fx, Fxx, Fy, Fyy}

Fxximage = {xFxx, yFxx, xxFxx, yyFxx};
Fxyimage = {Fxy, xFxy, yFxy, xxFxy};//, xyFxy,
FyyImage = {xFyy, yFyy, xxFyy, yyFyy};
FxxFyyImage = {xyFxx, xyFyy, xyFxy, yyFxy};

TexCoord0 = current point
TexCoord1 = current point- half_width

void main()
vec4 Fxx, Fxy, Fyy, Fxxyy;
vec4 xy;
vec4 off = vec4(0.5,0.5,0.5,0.5);

xy.x = texture2DRect(tex0,gl_TexCoord[0].st).g - 0.5; //Fxx
xy.z = texture2DRect(tex0,gl_TexCoord[0].st).a - 0.5; //Fyy
xy.w = texture2DRect(tex0,gl_TexCoord[0].st).g*texture2DRect(tex0,gl_TexCoord[0].st).a; //Fxy+0.5f
xy.y = xy.w-0.5f;
Fxx.x = gl_TexCoord[1].s*xy.x; //xFxx
Fxx.y = gl_TexCoord[1].t*xy.x; //yFxx
Fxx.z = gl_TexCoord[1].s*Fxx.x; //xxFxx
Fxx.w = gl_TexCoord[1].s*Fxx.y; //yyFxx

Fxy.x = xy.y; //Fxy
Fxy.y = gl_TexCoord[1].s*Fxy.x; //xFxy
Fxy.z = gl_TexCoord[1].t*Fxy.x; //yFxy
Fxy.w = gl_TexCoord[1].s*Fxy.y; //xxFxy

Fyy.x = gl_TexCoord[1].s*xy.z; //xFyy
Fyy.y = gl_TexCoord[1].t*xy.z; //yFyy
Fyy.z = gl_TexCoord[1].s*Fyy.x; //xxFyy
Fyy.w = gl_TexCoord[1].t*Fyy.y; //yyFyy

Fxxyy.x = gl_TexCoord[1].s*Fxx.y; //xyFxx
Fxxyy.y = gl_TexCoord[1].s*Fyy.y; //xyFyy
Fxxyy.z = gl_TexCoord[1].s*Fxy.z; //xyFxy
Fxxyy.w = gl_TexCoord[1].t*Fxy.z; //yyFxy

gl_FragData[0] = Fxx+off;
gl_FragData[1] = Fxy+off;
gl_FragData[2] = Fyy+off;
gl_FragData[3] = Fxxyy+off;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement