better glsl usage and added default config options
This commit is contained in:
parent
016925f507
commit
505a0427e0
7 changed files with 15 additions and 11 deletions
|
@ -1,8 +1,8 @@
|
|||
#version 150
|
||||
uniform sampler2D depth;
|
||||
varying vec2 texcoord;
|
||||
|
||||
void main() {
|
||||
vec2 coords = vec2(gl_TexCoord[0].x, gl_TexCoord[0].y);
|
||||
gl_FragDepth = texture(depth, coords).r;
|
||||
gl_FragDepth = texture(depth, texcoord).r;
|
||||
gl_FragColor = vec4(0.0);
|
||||
}
|
|
@ -2,15 +2,15 @@
|
|||
uniform sampler2D depth;
|
||||
uniform sampler2D occlusion;
|
||||
uniform sampler2D texture;
|
||||
varying vec2 texcoord;
|
||||
|
||||
void main() {
|
||||
vec2 coords = vec2(gl_TexCoord[0].x, gl_TexCoord[0].y);
|
||||
float depth = texture(depth, coords).r - 0.001;
|
||||
float occlusion = texture(occlusion, coords).r;
|
||||
float depth = texture(depth, texcoord).r - 0.001;
|
||||
float occlusion = texture(occlusion, texcoord).r;
|
||||
vec4 color = vec4(0.0);
|
||||
float writedepth = occlusion;
|
||||
if(depth <= occlusion) {
|
||||
color = texture(texture, coords);
|
||||
color = texture(texture, texcoord);
|
||||
// color = vec4(1.0);
|
||||
writedepth = depth;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
varying vec2 texcoord;
|
||||
|
||||
void main(){
|
||||
gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
texcoord = vec2(gl_MultiTexCoord0.x, gl_MultiTexCoord0.y);
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
#version 150
|
||||
uniform vec2 u_Scale;
|
||||
uniform sampler2D u_Texture0;
|
||||
varying vec2 texcoord;
|
||||
|
||||
const float gaussFilter[50] = float[50](
|
||||
-12.0, 1.0/16777216.0,
|
||||
|
@ -37,7 +38,7 @@ void main() {
|
|||
for( int i = 0; i < 25; i++ )
|
||||
{
|
||||
vec4 pix = texture( u_Texture0,
|
||||
vec2(gl_TexCoord[0].x+gaussFilter[i*2]*u_Scale.x, gl_TexCoord[0].y+gaussFilter[i*2]*u_Scale.y )
|
||||
vec2(texcoord.x+gaussFilter[i*2]*u_Scale.x, texcoord.y+gaussFilter[i*2]*u_Scale.y )
|
||||
);
|
||||
wt = gaussFilter[i*2+1] * pix.w * 1.5;
|
||||
color += wt * pix;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#version 150
|
||||
varying vec2 texcoord;
|
||||
|
||||
void main(){
|
||||
gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
texcoord = vec2(gl_MultiTexCoord0.x, gl_MultiTexCoord0.y);
|
||||
}
|
|
@ -298,7 +298,7 @@ public class Config {
|
|||
}
|
||||
|
||||
public static int glowMultiplier() {
|
||||
return config.get("Graphics", "Bloom Multiplier", 1).getInt(1);
|
||||
return config.get("Graphics", "Bloom Multiplier", 3).getInt(3);
|
||||
}
|
||||
|
||||
public static boolean useShaders() {
|
||||
|
|
|
@ -141,6 +141,8 @@ public class ModularPowersuits {
|
|||
Config.fontAntiAliasing();
|
||||
Config.useCustomFonts();
|
||||
Config.useSounds();
|
||||
Config.glowMultiplier();
|
||||
Config.useShaders();
|
||||
|
||||
EntityRegistry.registerModEntity(EntityPlasmaBolt.class, "entityPlasmaBolt", 2477, this, 64, 20, true);
|
||||
EntityRegistry.registerModEntity(EntitySpinningBlade.class, "entitySpinningBlade", 2478, this, 64, 20, true);
|
||||
|
|
Loading…
Reference in a new issue