|
|
@ -1,6 +1,7 @@ |
|
|
|
#extension GL_ARB_texture_multisample : enable |
|
|
|
#extension GL_ARB_texture_multisample : enable |
|
|
|
uniform int m_NumSamples; |
|
|
|
uniform int m_NumSamples; |
|
|
|
uniform int m_NumSamplesDepth; |
|
|
|
uniform int m_NumSamplesDepth; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef RESOLVE_MS |
|
|
|
#ifdef RESOLVE_MS |
|
|
|
#define COLORTEXTURE sampler2DMS |
|
|
|
#define COLORTEXTURE sampler2DMS |
|
|
|
#else |
|
|
|
#else |
|
|
@ -9,7 +10,6 @@ uniform int m_NumSamplesDepth; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef RESOLVE_DEPTH_MS |
|
|
|
#ifdef RESOLVE_DEPTH_MS |
|
|
|
#define DEPTHTEXTURE sampler2DMS |
|
|
|
#define DEPTHTEXTURE sampler2DMS |
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
|
#else |
|
|
|
#define DEPTHTEXTURE sampler2D |
|
|
|
#define DEPTHTEXTURE sampler2D |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -17,10 +17,10 @@ uniform int m_NumSamplesDepth; |
|
|
|
vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){ |
|
|
|
vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){ |
|
|
|
ivec2 iTexC = ivec2(texC * textureSize(tex)); |
|
|
|
ivec2 iTexC = ivec2(texC * textureSize(tex)); |
|
|
|
vec4 color = vec4(0.0); |
|
|
|
vec4 color = vec4(0.0); |
|
|
|
for (int i=0;i<numSamples;i++){ |
|
|
|
for (int i = 0; i < numSamples; i++){ |
|
|
|
color += texelFetch(tex, iTexC, i); |
|
|
|
color += texelFetch(tex, iTexC, i); |
|
|
|
} |
|
|
|
} |
|
|
|
return color/numSamples; |
|
|
|
return color / numSamples; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
vec4 fetchTextureSample(in sampler2D tex,in vec2 texC,in int sample){ |
|
|
|
vec4 fetchTextureSample(in sampler2D tex,in vec2 texC,in int sample){ |
|
|
@ -32,11 +32,11 @@ vec4 fetchTextureSample(in sampler2DMS tex,in vec2 texC,in int sample){ |
|
|
|
return texelFetch(tex, iTexC, sample); |
|
|
|
return texelFetch(tex, iTexC, sample); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
vec4 getColor(in sampler2D tex,in vec2 texC){ |
|
|
|
vec4 getColor(in sampler2D tex, in vec2 texC){ |
|
|
|
return texture2D(tex,texC); |
|
|
|
return texture2D(tex,texC); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
vec4 getColor(in sampler2DMS tex,in vec2 texC){ |
|
|
|
vec4 getColor(in sampler2DMS tex, in vec2 texC){ |
|
|
|
return textureFetch(tex,texC,m_NumSamples); |
|
|
|
return textureFetch(tex,texC,m_NumSamples); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|