Hello,
I am not sure how to dump the shader code, but the fragment shader is as follows ( i susbtituted the import line). I marked the line 84:
#extension GL_ARB_texture_multisample : enable
uniform int m_NumSamples;
uniform int m_NumSamplesDepth;
#ifdef RESOLVE_MS
#define COLORTEXTURE sampler2DMS
#else
#define COLORTEXTURE sampler2D
#endif
#ifdef RESOLVE_DEPTH_MS
#define DEPTHTEXTURE sampler2DMS
#else
#define DEPTHTEXTURE sampler2D
#endif
// NOTE: Only define multisample functions if multisample is available and is being used!
#if defined(GL_ARB_texture_multisample) && (defined(RESOLVE_MS) || defined(RESOLVE_DEPTH_MS))
vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){
ivec2 iTexC = ivec2(texC * vec2(textureSize(tex)));
vec4 color = vec4(0.0);
for (int i = 0; i < numSamples; i++){
color += texelFetch(tex, iTexC, i);
}
return color / float(numSamples);
}
vec4 fetchTextureSample(in sampler2DMS tex,in vec2 texC,in int sample){
ivec2 iTexC = ivec2(texC * vec2(textureSize(tex)));
return texelFetch(tex, iTexC, sample);
}
vec4 getColor(in sampler2DMS tex, in vec2 texC){
return textureFetch(tex, texC, m_NumSamples);
}
vec4 getColorSingle(in sampler2DMS tex, in vec2 texC){
ivec2 iTexC = ivec2(texC * vec2(textureSize(tex)));
return texelFetch(tex, iTexC, 0);
}
vec4 getDepth(in sampler2DMS tex,in vec2 texC){
return textureFetch(tex,texC,m_NumSamplesDepth);
}
#endif
vec4 fetchTextureSample(in sampler2D tex,in vec2 texC,in int sample){
return texture(tex,texC);
}
vec4 getColor(in sampler2D tex, in vec2 texC){
return texture(tex,texC);
}
vec4 getColorSingle(in sampler2D tex, in vec2 texC){
return texture(tex, texC);
}
vec4 getDepth(in sampler2D tex,in vec2 texC){
return texture(tex,texC);
}
uniform COLORTEXTURE m_Texture;
uniform DEPTHTEXTURE m_DepthTexture;
uniform int m_NbSamples;
uniform float m_BlurStart;
uniform float m_BlurWidth;
uniform float m_LightDensity;
uniform bool m_Display;
uniform vec3 m_LightPosition;
in vec2 texCoord;
out vec4 fragColor;
void main(void)
{
if(m_Display){
// THIS SEEMS TO BE LINE 84
vec4 colorRes= getColor(m_Texture,texCoord);
float factor=(m_BlurWidth/float(m_NbSamples-1.0));
float scale;
vec2 texCoo=texCoord - m_LightPosition.xy;
vec2 scaledCoord;
vec4 res = vec4(0.0);
for(int i=0; i<m_NbSamples; i++) {
scale = i * factor + m_BlurStart ;
scaledCoord=texCoo*scale + m_LightPosition.xy;
if(fetchTextureSample(m_DepthTexture, scaledCoord,0).r==1.0){
res += fetchTextureSample(m_Texture,scaledCoord,0);
}
}
res /= m_NbSamples;
//Blend the original color with the averaged pixels
float mean = (res.r + res.g + res.b)/3;
fragColor =mix(colorRes ,mix( colorRes, res, m_LightDensity),mean);
}else{
fragColor = getColor(m_Texture,texCoord);
}
}