Update loc of Vertex.

This commit is contained in:
Troispoils 2024-03-01 15:03:45 +01:00
parent bb723036c0
commit 4ea0101cf6
4 changed files with 55 additions and 27 deletions

View file

@ -5,7 +5,7 @@ out vec4 outputColor;
uniform vec3 viewPos;
uniform vec3 lightPos;
uniform vec3 lightColor;
uniform sampler2D texture0;
uniform sampler2DArray texture0;
in vec4 FarColor;
in vec3 Normal;
@ -16,25 +16,10 @@ in float RealType;
void main()
{
float tileSize = 64.0 / 512.0;
float baseWeight = 0.2;
float dominantWeight = 0.4;
vec4 weights = vec4(baseWeight);
vec2 uvOffsets[4];
for (int i = 0; i < 4; i++) {
float type = TexType[i];
uvOffsets[i] = vec2(mod(type, 8.0), floor(type / 8.0)) * tileSize;
if (type == RealType) {
weights[i] = dominantWeight;
}
}
vec4 blendedColor[4];
for (int i = 0; i < 4; i++) {
vec2 uv = TexCoord * tileSize + uvOffsets[i];
blendedColor[i] = texture(texture0, uv);
float type = TexType[i];
blendedColor[i] = texture(texture0, vec3(TexCoord, type));
}
float weightX = TexCoord.x;