Update for AtlasBuilder ok
Need to improuve duplicate vertex for mapping texture.
This commit is contained in:
parent
4777783ffb
commit
b9a2b87fe9
11 changed files with 160 additions and 33 deletions
|
|
@ -3,15 +3,17 @@
|
|||
out vec4 outputColor;
|
||||
|
||||
uniform vec3 viewPos;
|
||||
uniform sampler2D texture0;
|
||||
|
||||
in vec4 Color;
|
||||
in vec4 FarColor;
|
||||
in vec3 FragPos;
|
||||
in vec2 TexCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
float distance = length(viewPos - FragPos);
|
||||
float interpolationFactor = clamp(distance / 1000, 0.0, 1.0);
|
||||
float interpolationFactor = clamp(distance / 1000.0, 0.0, 1.0);
|
||||
|
||||
outputColor = mix(Color, FarColor, interpolationFactor);
|
||||
vec4 textureColor = texture(texture0, TexCoord);
|
||||
outputColor = mix(textureColor, FarColor, interpolationFactor);
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec4 aColor;
|
||||
layout (location = 2) in vec4 aColorFar;
|
||||
layout (location = 3) in vec2 aTexCoord;
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
|
|
@ -10,6 +11,7 @@ uniform mat4 projection;
|
|||
out vec3 FragPos;
|
||||
out vec4 Color;
|
||||
out vec4 FarColor;
|
||||
out vec2 TexCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -17,4 +19,5 @@ void main()
|
|||
FragPos = vec3(vec4(aPos, 1.0) * model);
|
||||
Color = aColor;
|
||||
FarColor = aColorFar;
|
||||
TexCoord = aTexCoord;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue