cleanup with minor tweaks

This commit is contained in:
Harrison Deng 2018-09-03 21:59:37 -05:00
parent 80d4132510
commit cd551a2bc1
4 changed files with 7 additions and 22 deletions

View File

@ -11,14 +11,15 @@ varying vec2 vTexCoord;
uniform sampler2D u_texture;
uniform sampler2D u_texture1;
uniform sampler2D u_texture2;
void main() {
vec4 origColor = texture2D(u_texture, vTexCoord);
vec4 blurredColor = texture2D(u_texture1, vTexCoord);
vec4 lightFilterColor = texture2D(u_texture2, vTexCoord);
vec4 result;
result = origColor + blurredColor;
gl_FragColor = result*vColor;
result = origColor + blurredColor;
result.a = vColor.a;
result.rgb *= vColor.rgb;
gl_FragColor = result;
}

View File

@ -43,5 +43,5 @@ void main() {
sum += texture2D(u_texture, vec2(tc.x + 4.0*blur*hstep, tc.y + 4.0*blur*vstep)) * 0.035855;
sum += texture2D(u_texture, vec2(tc.x + 5.0*blur*hstep, tc.y + 5.0*blur*vstep)) * 0.014374;
gl_FragColor = vec4(sum.rgb, 1.0);
gl_FragColor = sum;
}

View File

@ -1,15 +0,0 @@
attribute vec4 a_position;
attribute vec4 a_color;
attribute vec2 a_texCoord0;
uniform mat4 u_projTrans;
varying vec4 vColor;
varying vec2 vTexCoord;
void main() {
vColor = a_color;
vTexCoord = a_texCoord0;
gl_Position = u_projTrans * a_position;
}

View File

@ -41,7 +41,7 @@ public class BloomShader implements Disposable {
Gdx.app.error("Shader", brightFilterShader.getLog());
}
gaussianBlurShader = new ShaderProgram(Gdx.files.internal("shaders/gaussian_blur.vsh"), Gdx.files.internal("shaders/gaussian_blur.fsh"));
gaussianBlurShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/gaussian_blur.fsh"));
if (!gaussianBlurShader.isCompiled()) {
Gdx.app.error("Shader failed to compile gaussian blur shader", gaussianBlurShader.getLog());
System.exit(1);
@ -69,7 +69,6 @@ public class BloomShader implements Disposable {
combineShader.begin();
combineShader.setUniformi("u_texture1", 1);
combineShader.setUniformi("u_texture2", 2);
combineShader.end();
gaussianBlurShader.begin();