diff options
author | makamys <makamys@outlook.com> | 2022-06-20 00:23:26 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-20 00:24:29 +0200 |
commit | 93fff8b1a9154bf514b2b0d3fcf2bd4c44a1a941 (patch) | |
tree | f0e061f38432e6b5a0adb81022f522937bd0b52c /src | |
parent | 92d6f9502b0aec45fa3806d821d558bbe0a58d71 (diff) | |
download | Neodymium-93fff8b1a9154bf514b2b0d3fcf2bd4c44a1a941.tar.gz Neodymium-93fff8b1a9154bf514b2b0d3fcf2bd4c44a1a941.tar.bz2 Neodymium-93fff8b1a9154bf514b2b0d3fcf2bd4c44a1a941.zip |
Rename squadron to megaquad
Less funny but more clear in my opinion
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/MeshQuad.java | 18 | ||||
-rw-r--r-- | src/main/resources/shaders/chunk.frag | 8 | ||||
-rw-r--r-- | src/main/resources/shaders/chunk.vert | 6 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/MeshQuad.java b/src/main/java/makamys/neodymium/renderer/MeshQuad.java index bddabe7..9316023 100644 --- a/src/main/java/makamys/neodymium/renderer/MeshQuad.java +++ b/src/main/java/makamys/neodymium/renderer/MeshQuad.java @@ -22,13 +22,13 @@ import net.minecraft.util.EnumFacing; * | | * 3--2 * - * We can glue quads together, forming a "quad squadron", or "squadron" for short. - * In the fragment shader we need to know which quad of the squadron we are operating on. - * For this reason, we store the "squadron X" and "squadron Y" coordinates in the vertices. + * We can glue quads together, forming a megaquad. + * In the fragment shader we need to know which quad of the megaquad we are operating on. + * For this reason, we store the "megaquad X" and "megaquad Y" coordinates in the vertices. * Their values at vertex 0: (0, 0) - * Their values at vertex 1: (sqadron width, 0) - * Their values at vertex 2: (squadron width, squadron height) - * Their values at vertex 3: (0, squadron height) + * Their values at vertex 1: (megaquad width, 0) + * Their values at vertex 2: (megaquad width, megaquad height) + * Their values at vertex 3: (0, megaquad height) */ public class MeshQuad { @@ -56,8 +56,8 @@ public class MeshQuad { // positive U direction is parallel to edge 0-1 public boolean uDirectionIs01; - // 0: quads glued together on edge 1-2 or 3-0 ("squadron row length") - // 1: quads glued together on edge 0-1 or 2-3 ("squadron column length") + // 0: quads glued together on edge 1-2 or 3-0 ("megaquad row length") + // 1: quads glued together on edge 0-1 or 2-3 ("megaquad column length") private int[] quadCountByDirection = {1, 1}; public static int[] totalMergeCountByPlane = new int[3]; @@ -167,7 +167,7 @@ public class MeshQuad { + 4 // B (int) + 4 // C (int)) + 4 - ; // squadron XY (byte) + ; // megaquad XY (byte) } private boolean isTranslatedCopyOf(MeshQuad o, boolean checkValid) { diff --git a/src/main/resources/shaders/chunk.frag b/src/main/resources/shaders/chunk.frag index b11fcc8..b19f152 100644 --- a/src/main/resources/shaders/chunk.frag +++ b/src/main/resources/shaders/chunk.frag @@ -4,7 +4,7 @@ out vec4 FragColor; in vec2 TexCoord; in vec2 BTexCoord; in vec4 Color; -in vec4 SPos; +in vec4 MQPos; in vec4 Viewport; in mat4 ProjInv; in vec4 FogColor; @@ -17,10 +17,10 @@ uniform sampler2D lightTex; void main() { - float wrappedU = mod(SPos.x, 1.0); - float wrappedV = mod(SPos.y, 1.0); + float wrappedU = mod(MQPos.x, 1.0); + float wrappedV = mod(MQPos.y, 1.0); - vec2 goodTexCoord = ProvokingTexCoord.xy + (((TexCoord.xy - ProvokingTexCoord.xy) / SPos.zw) * vec2(wrappedU, wrappedV)); + vec2 goodTexCoord = ProvokingTexCoord.xy + (((TexCoord.xy - ProvokingTexCoord.xy) / MQPos.zw) * vec2(wrappedU, wrappedV)); vec4 texColor = texture(atlas, goodTexCoord); diff --git a/src/main/resources/shaders/chunk.vert b/src/main/resources/shaders/chunk.vert index 44101bb..9fee06c 100644 --- a/src/main/resources/shaders/chunk.vert +++ b/src/main/resources/shaders/chunk.vert @@ -3,7 +3,7 @@ layout (location = 0) in vec3 aPos; layout (location = 1) in vec2 aTexCoord; layout (location = 2) in vec2 aBTexCoord; layout (location = 3) in vec4 aColor; -layout (location = 4) in vec4 aSPos; +layout (location = 4) in vec4 aMQPos; uniform mat4 modelView; uniform mat4 proj; @@ -17,7 +17,7 @@ uniform vec3 playerPos; out vec2 TexCoord; out vec2 BTexCoord; out vec4 Color; -out vec4 SPos; +out vec4 MQPos; out vec4 Viewport; out mat4 ProjInv; out vec4 FogColor; @@ -31,7 +31,7 @@ void main() TexCoord = aTexCoord; BTexCoord = aBTexCoord; Color = aColor; - SPos = aSPos; + MQPos = aMQPos; Viewport = viewport; ProjInv = projInv; FogColor = fogColor; |