Update #6 - Added FXAA Antialiasing

This commit is contained in:
LAX1DUDE 2022-12-28 23:47:37 -08:00
parent 855e61836f
commit 3d6bbb672c
15 changed files with 672 additions and 129 deletions

28
CREDITS
View File

@ -126,6 +126,34 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Project Name: NVIDIA FXAA
Project Author: Timothy Lottes, NVIDIA
Project URL: https://gist.github.com/kosua20/0c506b81b3812ac900048059d2383126
Used For: generating and applying patch files in build system
* ==============================================================================
*
*
* NVIDIA FXAA 3.11 by TIMOTHY LOTTES
*
*
* ------------------------------------------------------------------------------
* COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
* ------------------------------------------------------------------------------
* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
* *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
* OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
* OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
* CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
* LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
* OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
* THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Project Name: java-diff-utils
Project Author: Google, forked by wumpz
Project URL: https://java-diff-utils.github.io/java-diff-utils/

View File

@ -1 +1 @@
u5
u6

View File

@ -9,35 +9,36 @@
~
> CHANGE 16 : 20 @ 21 : 24
> CHANGE 16 : 21 @ 21 : 24
~ GameSettings.Options.PARTICLES, GameSettings.Options.MIPMAP_LEVELS, GameSettings.Options.BLOCK_ALTERNATIVES,
~ GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.FOG, GameSettings.Options.HUD_FPS,
~ GameSettings.Options.HUD_COORDS, GameSettings.Options.HUD_PLAYER, GameSettings.Options.HUD_STATS,
~ GameSettings.Options.HUD_WORLD, GameSettings.Options.HUD_24H, GameSettings.Options.CHUNK_FIX };
~ GameSettings.Options.PARTICLES, GameSettings.Options.FXAA, GameSettings.Options.MIPMAP_LEVELS,
~ GameSettings.Options.BLOCK_ALTERNATIVES, GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.FOG,
~ GameSettings.Options.HUD_FPS, GameSettings.Options.HUD_COORDS, GameSettings.Options.HUD_PLAYER,
~ GameSettings.Options.HUD_STATS, GameSettings.Options.HUD_WORLD, GameSettings.Options.HUD_24H,
~ GameSettings.Options.CHUNK_FIX };
> CHANGE 31 : 33 @ 35 : 38
> CHANGE 32 : 34 @ 35 : 38
~ GameSettings.Options[] agamesettings$options = new GameSettings.Options[videoOptions.length];
~ int i = 0;
> CHANGE 34 : 37 @ 39 : 53
> CHANGE 35 : 38 @ 39 : 53
~ for (GameSettings.Options gamesettings$options : videoOptions) {
~ agamesettings$options[i] = gamesettings$options;
~ ++i;
> INSERT 39 : 42 @ 55
> INSERT 40 : 43 @ 55
+ this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25,
+ agamesettings$options);
+
> CHANGE 49 : 50 @ 62 : 63
> CHANGE 50 : 51 @ 62 : 63
~ protected void actionPerformed(GuiButton parGuiButton) {
> CHANGE 59 : 60 @ 72 : 73
> CHANGE 60 : 61 @ 72 : 73
~ protected void mouseClicked(int parInt1, int parInt2, int parInt3) {

View File

@ -14,7 +14,7 @@
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
~ import net.lax1dude.eaglercraft.v1_8.HString;
> INSERT 7 : 19 @ 10
> INSERT 7 : 20 @ 10
+
+ import com.google.common.base.Predicate;
@ -25,27 +25,28 @@
+ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
+ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
+ import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
+ import net.lax1dude.eaglercraft.v1_8.opengl.EffectPipelineFXAA;
+ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
+ import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
+ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
> DELETE 29 @ 20 : 29
> DELETE 30 @ 20 : 29
> DELETE 36 @ 36 : 38
> DELETE 37 @ 36 : 38
> DELETE 43 @ 45 : 48
> DELETE 44 @ 45 : 48
> DELETE 63 @ 68 : 75
> DELETE 64 @ 68 : 75
> CHANGE 72 : 73 @ 84 : 85
> CHANGE 73 : 74 @ 84 : 85
~ private EaglercraftRandom random = new EaglercraftRandom();
> DELETE 116 @ 128 : 129
> DELETE 117 @ 128 : 129
> DELETE 146 @ 159 : 160
> DELETE 147 @ 159 : 160
> INSERT 147 : 156 @ 161
> INSERT 148 : 157 @ 161
+ GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
+ GlStateManager.matrixMode(5890);
@ -57,51 +58,51 @@
+ GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
+
> CHANGE 169 : 170 @ 174 : 175
> CHANGE 170 : 171 @ 174 : 175
~ return false;
> DELETE 173 @ 178 : 184
> DELETE 174 @ 178 : 184
> DELETE 180 @ 191 : 206
> DELETE 181 @ 191 : 206
> DELETE 183 @ 209 : 224
> DELETE 184 @ 209 : 224
> CHANGE 186 : 187 @ 227 : 242
> CHANGE 187 : 188 @ 227 : 242
~ this.useShader = false;
> DELETE 190 @ 245 : 256
> DELETE 191 @ 245 : 256
> DELETE 193 @ 259 : 263
> DELETE 194 @ 259 : 263
> DELETE 237 @ 307 : 311
> DELETE 238 @ 307 : 311
> DELETE 238 @ 312 : 319
> DELETE 239 @ 312 : 319
> CHANGE 356 : 357 @ 437 : 438
> CHANGE 357 : 358 @ 437 : 438
~ f = this.mc.gameSettings.keyBindZoomCamera.isKeyDown() ? 17.0f : this.mc.gameSettings.fovSetting;
> CHANGE 526 : 527 @ 607 : 608
> CHANGE 527 : 528 @ 607 : 608
~ GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true),
> CHANGE 528 : 529 @ 609 : 610
> CHANGE 529 : 530 @ 609 : 610
~ this.farPlaneDistance * 2.0f * MathHelper.SQRT_2);
> CHANGE 586 : 587 @ 667 : 668
> CHANGE 587 : 588 @ 667 : 668
~ GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, false),
> DELETE 630 @ 711 : 723
> DELETE 631 @ 711 : 723
> CHANGE 751 : 752 @ 844 : 845
> CHANGE 752 : 753 @ 844 : 845
~ this.lightmapColors[i] = short1 << 24 | j | k << 8 | l << 16;
> INSERT 755 : 769 @ 848
> INSERT 756 : 770 @ 848
+
+ GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
@ -118,97 +119,112 @@
+ GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
+
> DELETE 792 @ 871 : 876
> DELETE 793 @ 871 : 876
> INSERT 796 : 799 @ 880
> INSERT 797 : 800 @ 880
+ if (this.mc.gameSettings.keyBindZoomCamera.isKeyDown()) {
+ f *= 0.7f;
+ }
> DELETE 838 @ 919 : 932
> DELETE 839 @ 919 : 932
> CHANGE 866 : 867 @ 960 : 961
> CHANGE 867 : 868 @ 960 : 961
~ return EntityRenderer.this.mc.currentScreen.getClass().getName();
> CHANGE 871 : 872 @ 965 : 966
> CHANGE 872 : 873 @ 965 : 966
~ return HString.format("Scaled: (%d, %d). Absolute: (%d, %d)",
> CHANGE 878 : 879 @ 972 : 973
> CHANGE 879 : 880 @ 972 : 973
~ return HString.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d",
> DELETE 894 @ 988 : 990
> DELETE 895 @ 988 : 990
> CHANGE 926 : 927 @ 1022 : 1023
> CHANGE 927 : 928 @ 1022 : 1023
~ EaglercraftGPU.glLineWidth(1.0F);
> CHANGE 997 : 999 @ 1093 : 1095
> INSERT 953 : 958 @ 1048
+
+ if (this.mc.gameSettings.fxaa) {
+ EffectPipelineFXAA.begin(this.mc.displayWidth, this.mc.displayHeight);
+ }
+
> INSERT 974 : 978 @ 1064
+ if (this.mc.gameSettings.fxaa) {
+ EffectPipelineFXAA.end();
+ }
+
> CHANGE 1007 : 1009 @ 1093 : 1095
~ GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true),
~ (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.farPlaneDistance * 4.0F);
> CHANGE 1003 : 1004 @ 1099 : 1100
> CHANGE 1013 : 1014 @ 1099 : 1100
~ GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true),
> INSERT 1031 : 1032 @ 1127
> INSERT 1041 : 1042 @ 1127
+ GlStateManager.disableBlend();
> DELETE 1038 @ 1133 : 1134
> DELETE 1048 @ 1133 : 1134
> INSERT 1039 : 1040 @ 1135
> INSERT 1049 : 1050 @ 1135
+ GlStateManager.shadeModel(7424);
> CHANGE 1131 : 1132 @ 1226 : 1227
> CHANGE 1141 : 1142 @ 1226 : 1227
~ GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true),
> CHANGE 1141 : 1142 @ 1236 : 1237
> CHANGE 1151 : 1152 @ 1236 : 1237
~ GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true),
> CHANGE 1229 : 1230 @ 1324 : 1325
> CHANGE 1239 : 1240 @ 1324 : 1325
~ EaglercraftGPU.glNormal3f(0.0F, 1.0F, 0.0F);
> CHANGE 1277 : 1278 @ 1372 : 1373
> CHANGE 1287 : 1288 @ 1372 : 1373
~ if (f2 >= 0.15F) {
> CHANGE 1514 : 1515 @ 1609 : 1610
> CHANGE 1524 : 1525 @ 1609 : 1610
~ GlStateManager.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F);
> CHANGE 1524 : 1527 @ 1619 : 1621
> CHANGE 1534 : 1537 @ 1619 : 1621
~ EaglercraftGPU.glFog(GL_FOG_COLOR,
~ this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F));
~ EaglercraftGPU.glNormal3f(0.0F, -1.0F, 0.0F);
> CHANGE 1544 : 1545 @ 1638 : 1642
> CHANGE 1554 : 1555 @ 1638 : 1642
~ EaglercraftGPU.glFogi('\u855a', '\u855b');
> INSERT 1559 : 1562 @ 1656
> INSERT 1569 : 1572 @ 1656
+ } else if (!this.mc.gameSettings.fog) {
+ GlStateManager.setFog(2048);
+ GlStateManager.setFogDensity(0.0F);
> INSERT 1563 : 1564 @ 1657
> INSERT 1573 : 1574 @ 1657
+ GlStateManager.setFogDensity(0.001F);
> CHANGE 1574 : 1575 @ 1667 : 1670
> CHANGE 1584 : 1585 @ 1667 : 1670
~ EaglercraftGPU.glFogi('\u855a', '\u855b');
> DELETE 1584 @ 1679 : 1680
> DELETE 1594 @ 1679 : 1680
> EOF

View File

@ -73,7 +73,7 @@
~ public int guiScale = 3;
> INSERT 158 : 166 @ 172
> INSERT 158 : 167 @ 172
+ public boolean hudFps = true;
+ public boolean hudCoords = true;
@ -83,47 +83,48 @@
+ public boolean hud24h = false;
+ public boolean chunkFix = true;
+ public boolean fog = true;
+ public boolean fxaa = true;
> CHANGE 167 : 168 @ 173 : 174
> CHANGE 168 : 169 @ 173 : 174
~ public GameSettings(Minecraft mcIn) {
> CHANGE 172 : 174 @ 178 : 181
> CHANGE 173 : 175 @ 178 : 181
~ this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindZoomCamera, this.keyBindFunction,
~ this.keyBindClose }, this.keyBindsHotbar);
> CHANGE 177 : 179 @ 184 : 185
> CHANGE 178 : 180 @ 184 : 185
~ this.gammaSetting = 1.0F;
~ this.language = EagRuntime.getConfiguration().getDefaultLocale();
> CHANGE 181 : 182 @ 187 : 193
> CHANGE 182 : 183 @ 187 : 193
~ GameSettings.Options.RENDER_DISTANCE.setValueMax(18.0F);
> CHANGE 183 : 184 @ 194 : 195
> CHANGE 184 : 185 @ 194 : 195
~ this.renderDistanceChunks = 4;
> DELETE 187 @ 198 : 213
> DELETE 188 @ 198 : 213
> CHANGE 190 : 191 @ 216 : 217
> CHANGE 191 : 192 @ 216 : 217
~ : HString.format("%c", new Object[] { Character.valueOf((char) (parInt1 - 256)) })
> DELETE 274 @ 300 : 301
> DELETE 275 @ 300 : 301
> DELETE 278 @ 305 : 306
> DELETE 279 @ 305 : 306
> INSERT 323 : 325 @ 351
> INSERT 324 : 326 @ 351
+ this.mc.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"),
+ I18n.format("resourcePack.load.pleaseWait"));
> DELETE 383 @ 409 : 426
> DELETE 384 @ 409 : 426
> INSERT 396 : 428 @ 439
> INSERT 397 : 433 @ 439
+ if (parOptions == GameSettings.Options.HUD_FPS) {
+ this.hudFps = !this.hudFps;
@ -157,10 +158,14 @@
+ this.fog = !this.fog;
+ }
+
+ if (parOptions == GameSettings.Options.FXAA) {
+ this.fxaa = !this.fxaa;
+ }
+
> DELETE 482 @ 493 : 499
> DELETE 487 @ 493 : 499
> INSERT 494 : 510 @ 511
> INSERT 499 : 517 @ 511
+ case HUD_COORDS:
+ return this.hudCoords;
@ -178,22 +183,24 @@
+ return this.chunkFix;
+ case FOG:
+ return this.fog;
+ case FXAA:
+ return this.fxaa;
> CHANGE 553 : 556 @ 554 : 558
> CHANGE 560 : 563 @ 554 : 558
~ : (parOptions == GameSettings.Options.CHAT_SCALE
~ ? s + (int) (f * 90.0F + 10.0F) + "%"
~ : (parOptions == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED
> CHANGE 559 : 560 @ 561 : 562
> CHANGE 566 : 567 @ 561 : 562
~ : (parOptions == GameSettings.Options.CHAT_HEIGHT_FOCUSED
> CHANGE 561 : 562 @ 563 : 564
> CHANGE 568 : 569 @ 563 : 564
~ .calculateChatboxHeight(
> CHANGE 564 : 583 @ 566 : 600
> CHANGE 571 : 590 @ 566 : 600
~ : (parOptions == GameSettings.Options.CHAT_WIDTH
~ ? s + GuiNewChat
@ -215,17 +222,17 @@
~ + "%")
~ : "yee"))))))))))));
> CHANGE 618 : 620 @ 635 : 636
> CHANGE 625 : 627 @ 635 : 636
~ byte[] options = EagRuntime.getStorage("g");
~ if (options == null) {
> CHANGE 623 : 625 @ 639 : 640
> CHANGE 630 : 632 @ 639 : 640
~ BufferedReader bufferedreader = new BufferedReader(
~ new InputStreamReader(EaglerZLIB.newGZIPInputStream(new EaglerInputStream(options))));
> CHANGE 708 : 714 @ 723 : 724
> CHANGE 715 : 721 @ 723 : 724
~ this.resourcePacks.clear();
~ for (Object o : (new JSONArray(s.substring(s.indexOf(58) + 1))).toList()) {
@ -234,7 +241,7 @@
~ }
~ }
> CHANGE 720 : 726 @ 730 : 731
> CHANGE 727 : 733 @ 730 : 731
~ this.field_183018_l.clear();
~ for (Object o : (new JSONArray(s.substring(s.indexOf(58) + 1))).toList()) {
@ -243,11 +250,11 @@
~ }
~ }
> DELETE 764 @ 769 : 773
> DELETE 771 @ 769 : 773
> DELETE 768 @ 777 : 781
> DELETE 775 @ 777 : 781
> INSERT 884 : 916 @ 897
> INSERT 891 : 927 @ 897
+ if (astring[0].equals("hudFps")) {
+ this.hudFps = astring[1].equals("true");
@ -281,29 +288,33 @@
+ this.fog = astring[1].equals("true");
+ }
+
+ if (astring[0].equals("fxaa")) {
+ this.fxaa = astring[1].equals("true");
+ }
+
> INSERT 922 : 924 @ 903
> INSERT 933 : 935 @ 903
+ Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode());
+
> DELETE 941 @ 920 : 921
> DELETE 952 @ 920 : 921
> CHANGE 953 : 955 @ 933 : 934
> CHANGE 964 : 966 @ 933 : 934
~ ByteArrayOutputStream bao = new ByteArrayOutputStream();
~ PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(EaglerZLIB.newGZIPOutputStream(bao)));
> CHANGE 981 : 983 @ 960 : 962
> CHANGE 992 : 994 @ 960 : 962
~ printwriter.println("resourcePacks:" + toJSONArray(this.resourcePacks));
~ printwriter.println("incompatibleResourcePacks:" + toJSONArray(this.field_183018_l));
> DELETE 991 @ 970 : 971
> DELETE 1002 @ 970 : 971
> DELETE 992 @ 972 : 973
> DELETE 1003 @ 972 : 973
> INSERT 1021 : 1029 @ 1002
> INSERT 1032 : 1041 @ 1002
+ printwriter.println("hudFps:" + this.hudFps);
+ printwriter.println("hudWorld:" + this.hudWorld);
@ -313,22 +324,23 @@
+ printwriter.println("hud24h:" + this.hud24h);
+ printwriter.println("chunkFix:" + this.chunkFix);
+ printwriter.println("fog:" + this.fog);
+ printwriter.println("fxaa:" + this.fxaa);
> INSERT 1034 : 1036 @ 1007
> INSERT 1046 : 1048 @ 1007
+ Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode());
+
> INSERT 1047 : 1049 @ 1018
> INSERT 1059 : 1061 @ 1018
+
+ EagRuntime.setStorage("g", bao.toByteArray());
> CHANGE 1059 : 1060 @ 1028 : 1029
> CHANGE 1071 : 1072 @ 1028 : 1029
~ : (parSoundCategory == SoundCategory.VOICE ? 0.0F : 1.0F);
> INSERT 1113 : 1121 @ 1082
> INSERT 1125 : 1133 @ 1082
+ private String toJSONArray(List<String> e) {
+ JSONArray arr = new JSONArray();
@ -339,21 +351,21 @@
+ }
+
> CHANGE 1125 : 1126 @ 1086 : 1087
> CHANGE 1137 : 1138 @ 1086 : 1087
~ RENDER_DISTANCE("options.renderDistance", true, false, 1.0F, 16.0F, 1.0F),
> CHANGE 1134 : 1136 @ 1095 : 1099
> CHANGE 1146 : 1148 @ 1095 : 1099
~ TOUCHSCREEN("options.touchscreen", false, true), CHAT_SCALE("options.chat.scale", true, false),
~ CHAT_WIDTH("options.chat.width", true, false), CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false),
> CHANGE 1150 : 1155 @ 1113 : 1114
> CHANGE 1162 : 1167 @ 1113 : 1114
~ ENTITY_SHADOWS("options.entityShadows", false, true), HUD_FPS("options.hud.fps", false, true),
~ HUD_COORDS("options.hud.coords", false, true), HUD_STATS("options.hud.stats", false, true),
~ HUD_WORLD("options.hud.world", false, true), HUD_PLAYER("options.hud.player", false, true),
~ HUD_24H("options.hud.24h", false, true), CHUNK_FIX("options.chunkFix", false, true),
~ FOG("options.fog", false, true);
~ FOG("options.fog", false, true), FXAA("options.fxaa", false, true);
> EOF

View File

@ -12,7 +12,7 @@
~ eaglercraft.recording.start=Record Screen...
~ eaglercraft.soundCategory.voice=Voice
> INSERT 22 : 87 @ 25
> INSERT 22 : 88 @ 25
+ eaglercraft.resourcePack.prompt.title=What do you want to do with '%s'?
+ eaglercraft.resourcePack.prompt.text=Tip: Hold Shift to skip this screen when selecting a resource pack!
@ -69,6 +69,7 @@
+ eaglercraft.options.hud.24h=24h Day
+ eaglercraft.options.chunkFix=Chunk Lag Fix
+ eaglercraft.options.fog=Fog
+ eaglercraft.options.fxaa=FXAA Antialiasing
+
+ eaglercraft.key.function=Function
+ eaglercraft.key.zoomCamera=Zoom Camera
@ -80,11 +81,11 @@
+ eaglercraft.auth.continue=Join Server
+
> CHANGE 555 : 556 @ 493 : 494
> CHANGE 556 : 557 @ 493 : 494
~ resourcePack.openFolder=Open resource pack
> CHANGE 559 : 560 @ 497 : 498
> CHANGE 560 : 561 @ 497 : 498
~ resourcePack.folderInfo=(Select resource pack files here)

View File

@ -1,4 +1,4 @@
# 87 files to delete:
# 88 files to delete:
assets/minecraft/shaders/post/ntsc.json
assets/minecraft/shaders/program/outline_combine.json
assets/minecraft/shaders/post/art.json
@ -32,6 +32,7 @@ assets/minecraft/shaders/program/bits.json
assets/minecraft/shaders/program/outline_watercolor.json
assets/minecraft/shaders/program/bumpy.vsh
assets/minecraft/shaders/post/blobs.json
log4j2.xml
assets/minecraft/shaders/program/outline_combine.fsh
assets/minecraft/shaders/program/outline.fsh
assets/minecraft/shaders/program/flip.json

View File

@ -45,8 +45,10 @@ public class PlatformAssets {
File loadFile = new File("resources", path);
byte[] ret = new byte[(int) loadFile.length()];
try(FileInputStream is = new FileInputStream(loadFile)) {
is.read(ret);
is.close();
int i, j = 0;
while(j < ret.length && (i = is.read(ret, j, ret.length - j)) != -1) {
j += i;
}
return ret;
}catch(IOException ex) {
return null;

View File

@ -8,7 +8,7 @@ public class EaglercraftVersion {
/// Customize these to fit your fork:
public static final String projectForkName = "EaglercraftX";
public static final String projectForkVersion = "u5";
public static final String projectForkVersion = "u6";
public static final String projectForkVendor = "lax1dude";
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
@ -23,7 +23,7 @@ public class EaglercraftVersion {
public static final String projectOriginName = "EaglercraftX";
public static final String projectOriginAuthor = "lax1dude";
public static final String projectOriginRevision = "1.8";
public static final String projectOriginVersion = "u5";
public static final String projectOriginVersion = "u6";
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";

View File

@ -452,6 +452,8 @@ public class EaglercraftGPU {
SpriteLevelMixer.initialize();
InstancedFontRenderer.initialize();
InstancedParticleRenderer.initialize();
EffectPipelineFXAA.initialize();
SpriteLevelMixer.vshLocal.free();
}
public static final ITextureGL getNativeTexture(int tex) {

View File

@ -0,0 +1,159 @@
package net.lax1dude.eaglercraft.v1_8.opengl;
import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL;
import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL;
import net.lax1dude.eaglercraft.v1_8.internal.IRenderbufferGL;
import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL;
import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunctionConstants;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
/**
* Copyright (c) 2022 LAX1DUDE. All Rights Reserved.
*
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
*
* NOT FOR COMMERCIAL OR MALICIOUS USE
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*/
public class EffectPipelineFXAA {
private static final Logger logger = LogManager.getLogger("EffectPipelineFXAA");
public static final String fragmentShaderPath = "/assets/eagler/glsl/post_fxaa.fsh";
private static final int _GL_FRAMEBUFFER = 0x8D40;
private static final int _GL_RENDERBUFFER = 0x8D41;
private static final int _GL_COLOR_ATTACHMENT0 = 0x8CE0;
private static final int _GL_DEPTH_ATTACHMENT = 0x8D00;
private static final int _GL_DEPTH_COMPONENT32F = 0x8CAC;
private static IProgramGL shaderProgram = null;
private static IUniformGL u_screenSize2f = null;
private static IFramebufferGL framebuffer = null;
private static int framebufferColor = -1;
private static IRenderbufferGL framebufferDepth = null;
private static int currentWidth = -1;
private static int currentHeight = -1;
static void initialize() {
String fragmentSource = EagRuntime.getResourceString(fragmentShaderPath);
if(fragmentSource == null) {
throw new RuntimeException("EffectPipelineFXAA shader \"" + fragmentShaderPath + "\" is missing!");
}
IShaderGL frag = _wglCreateShader(GL_FRAGMENT_SHADER);
_wglShaderSource(frag, FixedFunctionConstants.VERSION + "\n" + fragmentSource);
_wglCompileShader(frag);
if(_wglGetShaderi(frag, GL_COMPILE_STATUS) != GL_TRUE) {
logger.error("Failed to compile GL_FRAGMENT_SHADER \"" + fragmentShaderPath + "\" for EffectPipelineFXAA!");
String log = _wglGetShaderInfoLog(frag);
if(log != null) {
String[] lines = log.split("(\\r\\n|\\r|\\n)");
for(int i = 0; i < lines.length; ++i) {
logger.error("[FRAG] {}", lines[i]);
}
}
throw new IllegalStateException("Fragment shader \"" + fragmentShaderPath + "\" could not be compiled!");
}
shaderProgram = _wglCreateProgram();
_wglAttachShader(shaderProgram, SpriteLevelMixer.vshLocal);
_wglAttachShader(shaderProgram, frag);
_wglBindAttribLocation(shaderProgram, 0, "a_position2f");
_wglLinkProgram(shaderProgram);
_wglDetachShader(shaderProgram, SpriteLevelMixer.vshLocal);
_wglDetachShader(shaderProgram, frag);
_wglDeleteShader(frag);
if(_wglGetProgrami(shaderProgram, GL_LINK_STATUS) != GL_TRUE) {
logger.error("Failed to link shader program for EffectPipelineFXAA!");
String log = _wglGetProgramInfoLog(shaderProgram);
if(log != null) {
String[] lines = log.split("(\\r\\n|\\r|\\n)");
for(int i = 0; i < lines.length; ++i) {
logger.error("[LINK] {}", lines[i]);
}
}
throw new IllegalStateException("Shader program for EffectPipelineFXAA could not be linked!");
}
u_screenSize2f = _wglGetUniformLocation(shaderProgram, "u_screenSize2f");
EaglercraftGPU.bindGLShaderProgram(shaderProgram);
_wglUniform1i(_wglGetUniformLocation(shaderProgram, "u_screenTexture"), 0);
framebuffer = _wglCreateFramebuffer();
framebufferColor = GlStateManager.generateTexture();
GlStateManager.bindTexture(framebufferColor);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
_wglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
framebufferDepth = _wglCreateRenderbuffer();
_wglBindRenderbuffer(_GL_RENDERBUFFER, framebufferDepth);
_wglBindFramebuffer(_GL_FRAMEBUFFER, framebuffer);
_wglFramebufferTexture2D(_GL_FRAMEBUFFER, _GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, EaglercraftGPU.getNativeTexture(framebufferColor), 0);
_wglFramebufferRenderbuffer(_GL_FRAMEBUFFER, _GL_DEPTH_ATTACHMENT, _GL_RENDERBUFFER, framebufferDepth);
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
}
public static void begin(int width, int height) {
if(currentWidth != width || currentHeight != height) {
currentWidth = width;
currentHeight = height;
GlStateManager.bindTexture(framebufferColor);
_wglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (ByteBuffer)null);
_wglBindRenderbuffer(_GL_RENDERBUFFER, framebufferDepth);
_wglRenderbufferStorage(_GL_RENDERBUFFER, _GL_DEPTH_COMPONENT32F, width, height);
}
_wglBindFramebuffer(_GL_FRAMEBUFFER, framebuffer);
GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 1.0f);
GlStateManager.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
public static void end() {
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
EaglercraftGPU.bindGLBufferArray(SpriteLevelMixer.vertexArray);
EaglercraftGPU.bindGLShaderProgram(shaderProgram);
GlStateManager.bindTexture(framebufferColor);
_wglUniform2f(u_screenSize2f, 1.0f / currentWidth, 1.0f / currentHeight);
_wglDrawArrays(GL_TRIANGLES, 0, 6);
}
}

View File

@ -35,8 +35,10 @@ public class SpriteLevelMixer {
public static final String vertexShaderPath = "/assets/eagler/glsl/local.vsh";
public static final String fragmentShaderPath = "/assets/eagler/glsl/texture_mix.fsh";
public static IShaderGL vshLocal = null;
private static IBufferGL vertexBuffer = null;
private static IBufferArrayGL vertexArray = null;
public static IBufferArrayGL vertexArray = null;
private static IProgramGL shaderProgram = null;
private static IUniformGL u_textureLod1f = null;
@ -75,15 +77,15 @@ public class SpriteLevelMixer {
throw new RuntimeException("SpriteLevelMixer shader \"" + fragmentShaderPath + "\" is missing!");
}
IShaderGL vert = _wglCreateShader(GL_VERTEX_SHADER);
vshLocal = _wglCreateShader(GL_VERTEX_SHADER);
IShaderGL frag = _wglCreateShader(GL_FRAGMENT_SHADER);
_wglShaderSource(vert, FixedFunctionConstants.VERSION + "\n" + vertexSource);
_wglCompileShader(vert);
_wglShaderSource(vshLocal, FixedFunctionConstants.VERSION + "\n" + vertexSource);
_wglCompileShader(vshLocal);
if(_wglGetShaderi(vert, GL_COMPILE_STATUS) != GL_TRUE) {
if(_wglGetShaderi(vshLocal, GL_COMPILE_STATUS) != GL_TRUE) {
LOGGER.error("Failed to compile GL_VERTEX_SHADER \"" + vertexShaderPath + "\" for SpriteLevelMixer!");
String log = _wglGetShaderInfoLog(vert);
String log = _wglGetShaderInfoLog(vshLocal);
if(log != null) {
String[] lines = log.split("(\\r\\n|\\r|\\n)");
for(int i = 0; i < lines.length; ++i) {
@ -110,17 +112,16 @@ public class SpriteLevelMixer {
shaderProgram = _wglCreateProgram();
_wglAttachShader(shaderProgram, vert);
_wglAttachShader(shaderProgram, vshLocal);
_wglAttachShader(shaderProgram, frag);
_wglBindAttribLocation(shaderProgram, 0, "a_position2f");
_wglLinkProgram(shaderProgram);
_wglDetachShader(shaderProgram, vert);
_wglDetachShader(shaderProgram, vshLocal);
_wglDetachShader(shaderProgram, frag);
_wglDeleteShader(vert);
_wglDeleteShader(frag);
if(_wglGetProgrami(shaderProgram, GL_LINK_STATUS) != GL_TRUE) {

View File

@ -126,6 +126,34 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Project Name: NVIDIA FXAA
Project Author: Timothy Lottes, NVIDIA
Project URL: https://gist.github.com/kosua20/0c506b81b3812ac900048059d2383126
Used For: generating and applying patch files in build system
* ==============================================================================
*
*
* NVIDIA FXAA 3.11 by TIMOTHY LOTTES
*
*
* ------------------------------------------------------------------------------
* COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
* ------------------------------------------------------------------------------
* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
* *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
* OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
* OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
* CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
* LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
* OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
* THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Project Name: java-diff-utils
Project Author: Google, forked by wumpz
Project URL: https://java-diff-utils.github.io/java-diff-utils/

View File

@ -47,18 +47,12 @@ void main() {
float particleSize = u_texCoordSize2f_particleSize1f.z * p_particleSize_texCoordsSize_2i.x;
float f1 = u_transformParam_1_2_3_4_f.x;
float f2 = u_transformParam_1_2_3_4_f.y;
float f3 = u_transformParam_1_2_3_4_f.z;
float f4 = u_transformParam_1_2_3_4_f.w;
float f5 = u_transformParam_5_f;
vec3 pos3f = p_position3f;
pos3f.x += f1 * particleSize * a_position2f.x;
pos3f.x += f4 * particleSize * a_position2f.y;
pos3f.y += f2 * particleSize * a_position2f.y;
pos3f.z += f3 * particleSize * a_position2f.x;
pos3f.z += f5 * particleSize * a_position2f.y;
pos3f.x += u_transformParam_1_2_3_4_f.x * particleSize * a_position2f.x;
pos3f.x += u_transformParam_1_2_3_4_f.w * particleSize * a_position2f.y;
pos3f.y += u_transformParam_1_2_3_4_f.y * particleSize * a_position2f.y;
pos3f.z += u_transformParam_1_2_3_4_f.z * particleSize * a_position2f.x;
pos3f.z += u_transformParam_5_f * particleSize * a_position2f.y;
gl_Position = u_matrixTransform * vec4(pos3f, 1.0);
}

View File

@ -0,0 +1,298 @@
#line 2
/*
* Copyright (c) 2022 LAX1DUDE. All Rights Reserved.
*
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
*
* NOT FOR COMMERCIAL OR MALICIOUS USE
*
* (please read the 'LICENSE' file this repo's root directory for more info)
*
*/
/*
* This file was modified by lax1dude to remove dead code
*
* Original: https://gist.github.com/kosua20/0c506b81b3812ac900048059d2383126
*
*/
/*
* ============================================================================
*
*
* NVIDIA FXAA 3.11 by TIMOTHY LOTTES
*
*
* ------------------------------------------------------------------------------
* COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
* ------------------------------------------------------------------------------
* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
* *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
* OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
* OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
* CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
* LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
* OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
* THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
*
*/
precision lowp int;
precision highp float;
precision highp sampler2D;
in vec2 v_position2f;
out vec4 output4f;
uniform sampler2D u_screenTexture;
uniform vec2 u_screenSize2f;
#define FXAA_PC 1
#ifndef FXAA_GREEN_AS_LUMA
// For those using non-linear color,
// and either not able to get luma in alpha, or not wanting to,
// this enables FXAA to run using green as a proxy for luma.
// So with this enabled, no need to pack luma in alpha.
//
// This will turn off AA on anything which lacks some amount of green.
// Pure red and blue or combination of only R and B, will get no AA.
//
// Might want to lower the settings for both,
// fxaaConsoleEdgeThresholdMin
// fxaaQualityEdgeThresholdMin
// In order to insure AA does not get turned off on colors
// which contain a minor amount of green.
//
// 1 = On.
// 0 = Off.
//
#define FXAA_GREEN_AS_LUMA 0
#endif
#ifndef FXAA_DISCARD
// 1 = Use discard on pixels which don't need AA.
// 0 = Return unchanged color on pixels which don't need AA.
#define FXAA_DISCARD 0
#endif
/*============================================================================
API PORTING
============================================================================*/
#define FxaaBool bool
#define FxaaDiscard discard
#define FxaaFloat float
#define FxaaFloat2 vec2
#define FxaaFloat3 vec3
#define FxaaFloat4 vec4
#define FxaaHalf float
#define FxaaHalf2 vec2
#define FxaaHalf3 vec3
#define FxaaHalf4 vec4
#define FxaaInt2 ivec2
#define FxaaSat(x) clamp(x, 0.0, 1.0)
#define FxaaTex sampler2D
/*--------------------------------------------------------------------------*/
#define FxaaTexTop(t, p) texture(t, p)
/*============================================================================
GREEN AS LUMA OPTION SUPPORT FUNCTION
============================================================================*/
#if (FXAA_GREEN_AS_LUMA == 0)
FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return dot(rgba.xyz, vec3(0.299, 0.587, 0.114)); }
#else
FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
#endif
/*============================================================================
FXAA3 CONSOLE - PC VERSION
============================================================================*/
/*--------------------------------------------------------------------------*/
FxaaFloat4 FxaaPixelShader(
// See FXAA Quality FxaaPixelShader() source for docs on Inputs!
//
// Use noperspective interpolation here (turn off perspective interpolation).
// {xy} = center of pixel
FxaaFloat2 pos,
//
// Used only for FXAA Console, and not used on the 360 version.
// Use noperspective interpolation here (turn off perspective interpolation).
// {xy__} = upper left of pixel
// {__zw} = lower right of pixel
FxaaFloat4 fxaaConsolePosPos,
//
// Input color texture.
// {rgb_} = color in linear or perceptual color space
// if (FXAA_GREEN_AS_LUMA == 0)
// {___a} = luma in perceptual color space (not linear)
FxaaTex tex,
//
// Only used on FXAA Console.
// This must be from a constant/uniform.
// This effects sub-pixel AA quality and inversely sharpness.
// Where N ranges between,
// N = 0.50 (default)
// N = 0.33 (sharper)
// {x___} = -N/screenWidthInPixels
// {_y__} = -N/screenHeightInPixels
// {__z_} = N/screenWidthInPixels
// {___w} = N/screenHeightInPixels
FxaaFloat4 fxaaConsoleRcpFrameOpt,
//
// Only used on FXAA Console.
// Not used on 360, but used on PS3 and PC.
// This must be from a constant/uniform.
// {x___} = -2.0/screenWidthInPixels
// {_y__} = -2.0/screenHeightInPixels
// {__z_} = 2.0/screenWidthInPixels
// {___w} = 2.0/screenHeightInPixels
FxaaFloat4 fxaaConsoleRcpFrameOpt2,
//
// Only used on FXAA Console.
// This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
// It is here now to allow easier tuning.
// This does not effect PS3, as this needs to be compiled in.
// Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
// Due to the PS3 being ALU bound,
// there are only three safe values here: 2 and 4 and 8.
// These options use the shaders ability to a free *|/ by 2|4|8.
// For all other platforms can be a non-power of two.
// 8.0 is sharper (default!!!)
// 4.0 is softer
// 2.0 is really soft (good only for vector graphics inputs)
FxaaFloat fxaaConsoleEdgeSharpness,
//
// Only used on FXAA Console.
// This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
// It is here now to allow easier tuning.
// This does not effect PS3, as this needs to be compiled in.
// Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
// Due to the PS3 being ALU bound,
// there are only two safe values here: 1/4 and 1/8.
// These options use the shaders ability to a free *|/ by 2|4|8.
// The console setting has a different mapping than the quality setting.
// Other platforms can use other values.
// 0.125 leaves less aliasing, but is softer (default!!!)
// 0.25 leaves more aliasing, and is sharper
FxaaFloat fxaaConsoleEdgeThreshold,
//
// Only used on FXAA Console.
// This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
// It is here now to allow easier tuning.
// Trims the algorithm from processing darks.
// The console setting has a different mapping than the quality setting.
// This does not apply to PS3,
// PS3 was simplified to avoid more shader instructions.
// 0.06 - faster but more aliasing in darks
// 0.05 - default
// 0.04 - slower and less aliasing in darks
// Special notes when using FXAA_GREEN_AS_LUMA,
// Likely want to set this to zero.
// As colors that are mostly not-green
// will appear very dark in the green channel!
// Tune by looking at mostly non-green content,
// then start at zero and increase until aliasing is a problem.
FxaaFloat fxaaConsoleEdgeThresholdMin
) {
/*--------------------------------------------------------------------------*/
FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
/*--------------------------------------------------------------------------*/
FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
#if (FXAA_GREEN_AS_LUMA == 0)
// TODO Luma
FxaaFloat lumaM = FxaaLuma(rgbyM);
#else
FxaaFloat lumaM = rgbyM.y;
#endif
/*--------------------------------------------------------------------------*/
FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
lumaNe += 1.0/384.0;
FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
/*--------------------------------------------------------------------------*/
FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
/*--------------------------------------------------------------------------*/
FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
/*--------------------------------------------------------------------------*/
FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
/*--------------------------------------------------------------------------*/
FxaaFloat lumaMinM = min(lumaMin, lumaM);
FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
FxaaFloat lumaMaxM = max(lumaMax, lumaM);
FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
if(lumaMaxSubMinM < lumaMaxScaledClamped)
{
#if (FXAA_DISCARD == 1)
FxaaDiscard;
#else
return rgbyM;
#endif
}
/*--------------------------------------------------------------------------*/
FxaaFloat2 dir;
dir.x = dirSwMinusNe + dirSeMinusNw;
dir.y = dirSwMinusNe - dirSeMinusNw;
/*--------------------------------------------------------------------------*/
FxaaFloat2 dir1 = normalize(dir.xy);
FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
/*--------------------------------------------------------------------------*/
FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
/*--------------------------------------------------------------------------*/
FxaaFloat2 dir2x = dir2 * fxaaConsoleRcpFrameOpt2.zw;
FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2x);
FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2x);
/*--------------------------------------------------------------------------*/
FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
/*--------------------------------------------------------------------------*/
#if (FXAA_GREEN_AS_LUMA == 0)
// TODO Luma
float lumaB = FxaaLuma(rgbyB);
#else
float lumaB = rgbyB.y;
#endif
if((lumaB < lumaMin) || (lumaB > lumaMax))
rgbyB.xyz = rgbyA.xyz * 0.5;
//
return rgbyB;
}
/*==========================================================================*/
#define edgeSharpness 4.0
#define edgeThreshold 0.125
#define edgeThresholdMin 0.05
void main(){
vec4 posPos;
posPos.xy = v_position2f - (0.5 * u_screenSize2f);
posPos.zw = v_position2f + (0.5 * u_screenSize2f);
vec4 rcpFrameOpt;
rcpFrameOpt.xy = vec2(-0.50, -0.50) * u_screenSize2f;
rcpFrameOpt.zw = vec2( 0.50, 0.50) * u_screenSize2f;
vec4 rcpFrameOpt2;
rcpFrameOpt2.xy = vec2(-2.0, -2.0) * u_screenSize2f;
rcpFrameOpt2.zw = vec2( 2.0, 2.0) * u_screenSize2f;
output4f = vec4(FxaaPixelShader(v_position2f, posPos, u_screenTexture, rcpFrameOpt, rcpFrameOpt2, edgeSharpness, edgeThreshold, edgeThresholdMin).rgb, 1.0);
}