Skip to content

Commit

Permalink
Fix the foliage having extra instances in the center (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
spimort authored Nov 9, 2024
1 parent 3845ff1 commit ddc751b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void calculateFoliageVertex(int instanceID, inout vec3 vertex, inout vec3 normal
}
} else {
// Disable instance
vertex.y = 0.0; // Scale down the mesh so it "vanish"
vertex = vec3(0.0); // Scale down the mesh so it "vanish"
}

cellWidth = pow(float(2), float(currentLODLevel - 1)) * InitialCellWidth;
Expand Down Expand Up @@ -239,7 +239,7 @@ void calculateFoliageVertex(int instanceID, inout vec3 vertex, inout vec3 normal

if (zoneUV.z < 0.0) {
// Disable instance
vertex.y = 0.0; // Scale down the mesh so it "vanish"
vertex = vec3(0.0); // Scale down the mesh so it "vanish"
} else {
vec4 foliagePosition = texture(FoliageTextures, zoneUV);
bool foliagePresence = false;
Expand All @@ -261,7 +261,7 @@ void calculateFoliageVertex(int instanceID, inout vec3 vertex, inout vec3 normal
vec4 heightMapPosition = texture(HeightmapTextures, zoneUV);
if (heightMapPosition.g > 0.0) {
// Disable instance
vertex.y = 0.0; // Scale down the mesh so it "vanish"
vertex = vec3(0.0); // Scale down the mesh so it "vanish"
} else {
float height = heightMapPosition.x;

Expand Down Expand Up @@ -312,7 +312,7 @@ void calculateFoliageVertex(int instanceID, inout vec3 vertex, inout vec3 normal
}
} else {
// Disable instance
vertex.y = 0.0; // Scale down the mesh so it "vanish"
vertex = vec3(0.0); // Scale down the mesh so it "vanish"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion addons/terrabrush/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="TerraBrush"
description=""
author="spimort"
version="0.9.2-alpha"
version="0.9.3-alpha"
script="Plugin.cs"

0 comments on commit ddc751b

Please sign in to comment.