Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the foliage having extra instances in the center #167

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"