Which texture did not change? The blurredTextureName? The shadowTextureName will be not changed. If the blurredTextureName did not change, check if there is any OpenGL error reported. Also check that you are correctly drawing the bluring quad.
Looks like I cannot get the original texture colors.
Here is the fragment shader code. If I uncomment the last line I see red quads on the blurred texture, otherwise it is unchanged. I also double checked all the uniforms via GetUnioformiv/fv and everything looks fine. What is the problem in your opinion?
Thanks!!!
Alberto
// maximum size supported by this shader
const int MaxKernelSize = 25;
// size of kernel (width * height) for this execution
uniform int KernelSize;
// array of offsets for accessing the base image
uniform vec2 Offset[MaxKernelSize];
// value for each location in the convolution kernel
uniform vec4 KernelValue[MaxKernelSize];
// image to be convolved
uniform sampler2D BaseImage;
void main()
{
vec4 tmp = texture2D(BaseImage, gl_TexCoord[0].st);
gl_FragColor = tmp;
// gl_FragColor = vec4(0.8, 0.0, 0.0, 1.0);
}
and the OpenGL Code is:
gl.ActiveTexture(GL_TEXTURE0);
gl.BindTexture(GL_TEXTURE_2D, shadowTextureName);
gl.FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, blurredTextureName, 0);
gl.UseProgram(myProgram);
int loc1 = gl.GetUniformLocation(myProgram, "BaseImage");
int loc2 = gl.GetUniformLocation(myProgram, "KernelSize");
int loc3 = gl.GetUniformLocation(myProgram, "Offset");
int loc4 = gl.GetUniformLocation(myProgram, "KernelValue");
gl.Uniform1i(loc1, 0);
DrawShadow(entList, globalMin, modelWidth, modelDepth);
gl.UseProgram(0);
What do you mean by “it is unchanged”? I mean, with the actual shader, you should see in the texture blurredTextureName the same thing as in the texture shadowTextureName.
What do you see exactly in the blurredTextureName texture with the current fragment shader?