Icons for modifier settings and replace modes. Rendering mirror lines and areas in world.

Removed shaders.
This commit is contained in:
Christian Knaapen
2023-02-02 00:45:21 +01:00
parent d4cb0c6858
commit 07667efe98
18 changed files with 281 additions and 610 deletions

View File

@@ -1,105 +0,0 @@
#version 150
#moj_import <fog.glsl>
uniform sampler2D Sampler0;
uniform sampler2D Sampler2;
uniform float GameTime;
uniform vec4 ColorModulator;
uniform float FogStart;
uniform float FogEnd;
uniform vec4 FogColor;
uniform float dissolve; // Passed in via Callback
uniform int highlight;
uniform int red;
uniform vec3 blockpos;
uniform vec3 firstpos;
uniform vec3 secondpos;
in vec3 vertexPosition;
in float vertexDistance;
in vec4 vertexColor;
in vec2 texCoord0;
in vec4 normal;
out vec4 fragColor;
void main() {
//convert gametime to seconds (roughly)
float time = GameTime * 1200;
vec3 pixelposition = floor(vertexPosition * 8.0) / 8.0;
vec3 worldpos = blockpos + pixelposition.xyz;
vec4 texcolor = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
vec4 color = texcolor;
vec3 firstposc = firstpos + 0.51; //center in block
vec3 secondposc = secondpos + 0.5;
//find place in between first and second pos
float firstToSecond = length(secondposc - firstposc);
float place = 0.0;
if (firstToSecond > 0.5) {
float placeFromFirst = length(worldpos - firstposc) / firstToSecond;
float placeFromSecond = length(worldpos - secondposc) / firstToSecond;
place = (placeFromFirst + (1.0 - placeFromSecond)) / 2.0;
} //else only one block
//find 2d texture coordinate for noise texture based on world position
vec2 maskcoord = vec2(worldpos.y, worldpos.z);
if (abs(normal.y) > 0.5)
maskcoord = vec2(worldpos.x, worldpos.z);
if (abs(normal.z) > 0.5)
maskcoord = vec2(worldpos.x, worldpos.y);
maskcoord /= 20.0;
vec4 maskColor = texture(Sampler2, maskcoord);
float maskgs = maskColor.r;
color.rgb *= vertexColor.rgb;
//desaturate
color.rgb *= vec3(0.8);
//add blueish hue
color.rgb += vec3(-0.1, 0.0, 0.2);
//add pulsing blue
float pulse = (sin(time * 4.0) + 1.0) / 2.0;
color.rgb += 0.4 * vec3(-0.5, 0.2, 0.6) * pulse;
//add diagonal highlights
float diagTime = mod(time / 2.0, 1.4) - 0.2;
float diag = smoothstep(diagTime - 0.2, diagTime, place) - smoothstep(diagTime, diagTime + 0.2, place);
color.rgb += 0.2 * diag * vec3(0.0, 0.2, 0.4);
float diagTime2 = mod(time / 3.5, 1.4) - 0.2;
float diag2 = smoothstep(diagTime2 - 0.2, diagTime2, place) - smoothstep(diagTime2, diagTime2 + 0.2, place);
color.rgb += 0.2 * diag2 * vec3(0.0, 0.4, 0.8);
//add flat shading
// if (abs(normal.x) > 0.5)
// color.rgb -= 0.0;
if (abs(normal.y) > 0.5)
color.rgb += 0.05;
if (abs(normal.z) > 0.5)
color.rgb -= 0.05;
if (highlight == 1 && dissolve == 0.0) {
color.rgb += vec3(0.0, 0.1, -0.2);
}
if (red == 1) {
color.rgb += vec3(0.4, -0.3, -0.5);
}
color.r = max(0, min(1, color.r));
color.g = max(0, min(1, color.g));
color.b = max(0, min(1, color.b));
if (maskgs * 0.3 + place * 0.7 <= dissolve)
fragColor = vec4(texcolor.rgb, 0.0);
else fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
}

View File

@@ -1,37 +0,0 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "effortlessbuilding:dissolve",
"fragment": "effortlessbuilding:dissolve",
"attributes": [
"Position",
"Color",
"UV0",
"UV2",
"Normal"
],
"samplers": [
{ "name": "Sampler0" },
{ "name": "Sampler2" }
],
"uniforms": [
{ "name": "ModelViewMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] },
{ "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] },
{ "name": "ChunkOffset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] },
{ "name": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "GameTime", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "dissolve", "type": "float", "count": 1, "values": [0.0] },
{ "name": "highlight", "type": "int", "count": 1, "values": [0] },
{ "name": "red", "type": "int", "count": 1, "values": [0] },
{ "name": "blockpos", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
{ "name": "firstpos", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
{ "name": "secondpos", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] }
]
}

View File

@@ -1,31 +0,0 @@
#version 150
#moj_import <light.glsl>
in vec3 Position;
in vec4 Color;
in vec2 UV0;
in ivec2 UV2;
in vec3 Normal;
uniform sampler2D Sampler2;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
uniform vec3 ChunkOffset;
out vec3 vertexPosition;
out float vertexDistance;
out vec4 vertexColor;
out vec2 texCoord0;
out vec4 normal;
void main() {
gl_Position = ProjMat * ModelViewMat * vec4(Position + ChunkOffset, 1.0);
vertexPosition = gl_Position.xyz;
vertexDistance = length((ModelViewMat * vec4(Position + ChunkOffset, 1.0)).xyz);
vertexColor = Color;
texCoord0 = UV0;
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
}

View File

@@ -1,24 +0,0 @@
#version 150
#moj_import <fog.glsl>
uniform sampler2D Sampler0;
uniform vec4 ColorModulator;
uniform float FogStart;
uniform float FogEnd;
uniform vec4 FogColor;
in float vertexDistance;
in vec4 vertexColor;
in vec4 lightMapColor;
in vec2 texCoord0;
in vec4 normal;
out vec4 fragColor;
void main() {
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
color *= lightMapColor;
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
}

View File

@@ -1,31 +0,0 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "effortlessbuilding:glowing_shader",
"fragment": "effortlessbuilding:glowing_shader",
"attributes": [
"Position",
"Color",
"UV0",
"UV1",
"UV2",
"Normal"
],
"samplers": [
{ "name": "Sampler0" },
{ "name": "Sampler2" }
],
"uniforms": [
{ "name": "ModelViewMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] },
{ "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] },
{ "name": "IViewRotMat", "type": "matrix3x3", "count": 9, "values": [ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ] },
{ "name": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] },
{ "name": "FogShape", "type": "int", "count": 1, "values": [ 0 ] }
]
}

View File

@@ -1,36 +0,0 @@
#version 150
#moj_import <fog.glsl>
in vec3 Position;
in vec4 Color;
in vec2 UV0;
in vec2 UV1;
in ivec2 UV2;
in vec3 Normal;
uniform sampler2D Sampler1;
uniform sampler2D Sampler2;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
uniform mat3 IViewRotMat;
uniform int FogShape;
out float vertexDistance;
out vec4 vertexColor;
out vec4 lightMapColor;
out vec2 texCoord0;
out vec2 texCoord1;
out vec4 normal;
void main() {
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
vertexDistance = fog_distance(ModelViewMat, IViewRotMat * Position, FogShape);
vertexColor = Color;
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0);
texCoord0 = UV0;
texCoord1 = UV1;
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
}

View File

@@ -1,15 +0,0 @@
#version 120
uniform sampler2D bgl_RenderedTexture;
void main() {
vec2 texcoord = vec2(gl_TexCoord[0]);
vec4 color = texture2D(bgl_RenderedTexture, texcoord);
float r = color.b * gl_Color.r;
float g = color.g * gl_Color.g;
float b = color.r * gl_Color.b;
float a = color.a * gl_Color.a;
gl_FragColor = vec4(r, g, b, a);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB