Improved atmosphere shader performance

This commit is contained in:
Anuken 2020-03-30 11:35:22 -04:00
parent 115e3a737b
commit 084c90ba9f
4 changed files with 19 additions and 11 deletions

View File

@ -128,7 +128,7 @@ mod.author = [LIGHT_GRAY]Author:[] {0}
mod.missing = This save contains mods that you have recently updated or no longer have installed. Save corruption may occur. Are you sure you want to load it?\n[lightgray]Mods:\n{0}
mod.preview.missing = Before publishing this mod in the workshop, you must add an image preview.\nPlace an image named[accent] preview.png[] into the mod's folder and try again.
mod.folder.missing = Only mods in folder form can be published on the workshop.\nTo convert any mod into a folder, simply unzip its file into a folder and delete the old zip, then restart your game or reload your mods.
mod.scripts.unsupported = Your device does not support mod scripts. Some mods will not function correctly.
mod.scripts.disable = Your device does not support mods with scripts. You must disable these mods to play the game.
about.button = About
name = Name:

View File

@ -1,3 +1,8 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
const float PI = 3.14159265359;
const float MAX = 10000.0;
@ -6,10 +11,13 @@ const float FLARE = 0.0025;
const float INTENSITY = 14.3;
const float G_M = -0.85;
const int numOutScatter = 10;
const float fNumOutScatter = 10.0;
const int numInScatter = 10;
const float fNumInScatter = 10.0;
#define SCATTER_OUT 3
#define SCATTER_IN 3
const int numOutScatter = SCATTER_OUT;
const float fNumOutScatter = float(SCATTER_OUT);
const int numInScatter = SCATTER_IN;
const float fNumInScatter = float(SCATTER_IN);
varying vec4 v_position;
varying mat4 v_model;
@ -106,10 +114,6 @@ void main(){
vec3 l = u_light;
vec2 e = rayIntersection(eye, dir, u_outerRadius);
if (e.x > e.y){
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
return;
}
vec2 f = rayIntersection(eye, dir, u_innerRadius);
e.y = min(e.y, f.x);

View File

@ -1,3 +1,7 @@
#ifdef GL_ES
precision mediump float;
#endif
varying vec3 v_texCoords;
uniform samplerCube u_cubemap;

View File

@ -369,7 +369,7 @@ public class Mods implements Loadable{
private void checkWarnings(){
//show 'scripts have errored' info
if(scripts != null && scripts.hasErrored()){
Core.settings.getBoolOnce("scripts-errored2", () -> ui.showErrorMessage("$mod.scripts.unsupported"));
ui.showErrorMessage("$mod.scripts.unsupported");
}
//show list of errored content
@ -417,7 +417,7 @@ public class Mods implements Loadable{
}
public boolean hasContentErrors(){
return mods.contains(LoadedMod::hasContentErrors);
return mods.contains(LoadedMod::hasContentErrors) || (scripts != null && scripts.hasErrored());
}
/** Reloads all mod content. How does this even work? I refuse to believe that it functions correctly.*/