Fixed #316 where some post processing effects were not working when using OPENGL_3 renderer due to an error in the fragment shader.
This commit is contained in:
parent
f470637361
commit
109c5e80cf
@ -18,6 +18,8 @@ uniform float m_Luminance5;
|
|||||||
uniform float m_LineDistance;
|
uniform float m_LineDistance;
|
||||||
uniform float m_LineThickness;
|
uniform float m_LineThickness;
|
||||||
|
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 texVal = getColor(m_Texture, texCoord);
|
vec4 texVal = getColor(m_Texture, texCoord);
|
||||||
float linePixel = 0;
|
float linePixel = 0;
|
||||||
@ -49,5 +51,5 @@ void main() {
|
|||||||
// Mix paper color with existing color information
|
// Mix paper color with existing color information
|
||||||
vec4 paperColor = mix(m_PaperColor, texVal, m_ColorInfluencePaper);
|
vec4 paperColor = mix(m_PaperColor, texVal, m_ColorInfluencePaper);
|
||||||
|
|
||||||
gl_FragColor = mix(paperColor, lineColor, linePixel);
|
fragColor = mix(paperColor, lineColor, linePixel);
|
||||||
}
|
}
|
@ -11,6 +11,8 @@ uniform float m_YScale;
|
|||||||
|
|
||||||
vec2 m_NearFar = vec2( 0.1, 1000.0 );
|
vec2 m_NearFar = vec2( 0.1, 1000.0 );
|
||||||
|
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
vec4 texVal = getColor( m_Texture, texCoord );
|
vec4 texVal = getColor( m_Texture, texCoord );
|
||||||
@ -44,7 +46,7 @@ void main() {
|
|||||||
if( unfocus < 0.2 ) {
|
if( unfocus < 0.2 ) {
|
||||||
// If we are mostly in focus then don't bother with the
|
// If we are mostly in focus then don't bother with the
|
||||||
// convolution filter
|
// convolution filter
|
||||||
gl_FragColor = texVal;
|
fragColor = texVal;
|
||||||
} else {
|
} else {
|
||||||
// Perform a wide convolution filter and we scatter it
|
// Perform a wide convolution filter and we scatter it
|
||||||
// a bit to avoid some texture look-ups. Instead of
|
// a bit to avoid some texture look-ups. Instead of
|
||||||
@ -83,7 +85,7 @@ void main() {
|
|||||||
|
|
||||||
sum = sum / 12.0;
|
sum = sum / 12.0;
|
||||||
|
|
||||||
gl_FragColor = mix( texVal, sum, unfocus );
|
fragColor = mix( texVal, sum, unfocus );
|
||||||
|
|
||||||
// I used this for debugging the range
|
// I used this for debugging the range
|
||||||
// gl_FragColor.r = unfocus;
|
// gl_FragColor.r = unfocus;
|
||||||
|
@ -4,8 +4,9 @@ uniform COLORTEXTURE m_Texture;
|
|||||||
uniform float m_Value;
|
uniform float m_Value;
|
||||||
|
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 texVal = getColor(m_Texture, texCoord);
|
vec4 texVal = getColor(m_Texture, texCoord);
|
||||||
gl_FragColor = texVal * m_Value;
|
fragColor = texVal * m_Value;
|
||||||
}
|
}
|
@ -8,6 +8,7 @@ uniform float m_FogDensity;
|
|||||||
uniform float m_FogDistance;
|
uniform float m_FogDistance;
|
||||||
|
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
vec2 m_FrustumNearFar=vec2(1.0,m_FogDistance);
|
vec2 m_FrustumNearFar=vec2(1.0,m_FogDistance);
|
||||||
const float LOG2 = 1.442695;
|
const float LOG2 = 1.442695;
|
||||||
@ -19,6 +20,6 @@ void main() {
|
|||||||
|
|
||||||
float fogFactor = exp2( -m_FogDensity * m_FogDensity * depth * depth * LOG2 );
|
float fogFactor = exp2( -m_FogDensity * m_FogDensity * depth * depth * LOG2 );
|
||||||
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||||
gl_FragColor =mix(m_FogColor,texVal,fogFactor);
|
fragColor =mix(m_FogColor,texVal,fogFactor);
|
||||||
|
|
||||||
}
|
}
|
@ -3,9 +3,10 @@
|
|||||||
uniform COLORTEXTURE m_Texture;
|
uniform COLORTEXTURE m_Texture;
|
||||||
uniform vec4 m_Color;
|
uniform vec4 m_Color;
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 texVal = getColor(m_Texture, texCoord);
|
vec4 texVal = getColor(m_Texture, texCoord);
|
||||||
gl_FragColor = texVal * m_Color;
|
fragColor = texVal * m_Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
uniform COLORTEXTURE m_Texture;
|
uniform COLORTEXTURE m_Texture;
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
uniform int m_NumColors;
|
uniform int m_NumColors;
|
||||||
uniform float m_Gamma;
|
uniform float m_Gamma;
|
||||||
@ -16,5 +17,5 @@ void main() {
|
|||||||
texVal = texVal / m_NumColors;
|
texVal = texVal / m_NumColors;
|
||||||
texVal = pow(texVal, vec4(1.0/m_Gamma));
|
texVal = pow(texVal, vec4(1.0/m_Gamma));
|
||||||
|
|
||||||
gl_FragColor = mix(getColor(m_Texture, texCoord), texVal, m_Strength);
|
fragColor = mix(getColor(m_Texture, texCoord), texVal, m_Strength);
|
||||||
}
|
}
|
@ -6,10 +6,11 @@ uniform sampler2D m_BloomTex;
|
|||||||
uniform float m_BloomIntensity;
|
uniform float m_BloomIntensity;
|
||||||
|
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
void main(){
|
void main(){
|
||||||
vec4 colorRes = getColor(m_Texture,texCoord);
|
vec4 colorRes = getColor(m_Texture,texCoord);
|
||||||
vec4 bloom = texture2D(m_BloomTex, texCoord);
|
vec4 bloom = texture2D(m_BloomTex, texCoord);
|
||||||
gl_FragColor = bloom * m_BloomIntensity + colorRes;
|
fragColor = bloom * m_BloomIntensity + colorRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ uniform float m_YScale;
|
|||||||
uniform vec2 m_FrustumNearFar;
|
uniform vec2 m_FrustumNearFar;
|
||||||
|
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
vec4 getResult(vec4 color){
|
vec4 getResult(vec4 color){
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ float readDepth(in vec2 uv){
|
|||||||
void main(){
|
void main(){
|
||||||
// float depth =texture2D(m_DepthTexture,uv).r;
|
// float depth =texture2D(m_DepthTexture,uv).r;
|
||||||
|
|
||||||
gl_FragColor=getResult(convolutionFilter());
|
fragColor=getResult(convolutionFilter());
|
||||||
// gl_FragColor=getResult(bilateralFilter());
|
// gl_FragColor=getResult(bilateralFilter());
|
||||||
// gl_FragColor=getColor(m_SSAOMap,texCoord);
|
// gl_FragColor=getColor(m_SSAOMap,texCoord);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user