Bugfixes, weitere Vegetationsgeneratoren hinzugefügt

This commit is contained in:
2026-07-25 20:16:13 +02:00
parent 574bad3d67
commit d7aeb890c9
66 changed files with 2379 additions and 173 deletions

View File

@@ -7,9 +7,9 @@ MaterialDef Tree {
Vector2 WindDir : 0.0 1.0
Texture2D BarkMap
Boolean HasBarkMap : false
Vector3 LightDir : 0.6 -0.8 0.4
Vector3 SunColor : 0.68 0.65 0.60
Vector3 AmbientColor : 0.08 0.10 0.16
Vector3 LightDir : 0.45 1.0 0.3
Vector3 SunColor : 1.4 1.3 1.1
Vector3 AmbientColor : 0.18 0.18 0.22
// Vom Shadow-Renderer befüllt (PostShadow-Pass)
Int BoundDrawBuffer

View File

@@ -29,9 +29,9 @@ MaterialDef TreeLeaf {
Matrix4 LightViewProjectionMatrix4
Matrix4 LightViewProjectionMatrix5
Vector3 LightPos
Vector3 LightDir : 0.6 -0.8 0.4
Vector3 SunColor : 0.68 0.65 0.60
Vector3 AmbientColor : 0.08 0.10 0.16
Vector3 LightDir : 0.45 1.0 0.3
Vector3 SunColor : 1.4 1.3 1.1
Vector3 AmbientColor : 0.18 0.18 0.22
Float PCFEdge
Float ShadowMapSize
Boolean BackfaceShadows : false

View File

@@ -2,6 +2,10 @@ MaterialDef Voxel {
MaterialParameters {
Texture2D TexFlat
Texture2D TexFlat2
Texture2D TexFlat3
Texture2D TexFlat4
Texture2D SplatMap
Texture2D TexSteep
Texture2D NormalMapFlat
Texture2D NormalMapSteep
@@ -32,6 +36,7 @@ MaterialDef Voxel {
HAS_LIGHTDIR : LightDir
HAS_SCENE_LIGHT : SunColor
DEBUG_NO_LIGHT : DebugNoLight
HAS_SPLAT : SplatMap
}
RenderState {
@@ -60,6 +65,7 @@ MaterialDef Voxel {
HAS_DISP_STEEP : DisplacementMapSteep
HAS_LIGHTDIR : LightDir
HAS_SCENE_LIGHT : SunColor
HAS_SPLAT : SplatMap
}
RenderState {

View File

@@ -0,0 +1,28 @@
#Fri Jul 24 16:47:20 CEST 2026
attachedEmitters.count=0
attachedLights.count=0
castShadow=true
category=
cullDistance=120.0
footstepSurface=
interactableOffsetX=0.0
interactableOffsetY=0.5
interactableOffsetZ=0.0
interactableRotY=0.0
interactableType=NONE
lod1Distance=30.0
lod1Path=
lod2Distance=80.0
lod2Path=
name=bridge1
pivotOffsetY=0.0
placementOffsetY=0.0
randomScaleMax=1.0
randomScaleMin=1.0
receiveShadow=true
scaleX=1.0
scaleY=1.0
scaleZ=1.0
solid=true
tags=
uniformScale=true

View File

@@ -25,14 +25,20 @@ void main() {
vec2 windN = (dot(m_WindDir, m_WindDir) > 0.001) ? normalize(m_WindDir) : vec2(0.0, 1.0);
vec2 perpN = vec2(-windN.y, windN.x);
float wavePhase = dot(worldXZ, windN);
float randPhase = fract(sin(dot(worldXZ, vec2(127.1, 311.7))) * 43758.5453) * 6.2832;
// 1m-Raster für den Phase-Hash: benachbarte Vertices (Ast + Blatt-Basis) landen im
// gleichen Rasterfeld → identische randPhase → Blatt-Basis schwebt nicht mehr
vec2 hashPos = floor(worldXZ);
float randPhase = fract(sin(dot(hashPos, vec2(127.1, 311.7))) * 43758.5453) * 6.2832;
float mainSway = sin(t + wavePhase * 0.08 + randPhase) * windW * m_WindStrength;
float crossSway = cos(t * 0.73 + wavePhase * 0.06 + randPhase) * windW * m_WindStrength * 0.25;
// Y-Kompression: Äste neigen sich statt zu strecken → verhindert Breiterwerden der Spitzen
float sway2 = mainSway * mainSway + crossSway * crossSway;
vec3 animPos = inPosition + vec3(
windN.x * mainSway + perpN.x * crossSway,
0.0,
-sway2 * 0.5,
windN.y * mainSway + perpN.y * crossSway
);

View File

@@ -1,5 +1,12 @@
uniform sampler2D m_TexFlat;
uniform sampler2D m_TexSteep;
#ifdef HAS_SPLAT
uniform sampler2D m_SplatMap;
uniform sampler2D m_TexFlat2;
uniform sampler2D m_TexFlat3;
uniform sampler2D m_TexFlat4;
#endif
uniform float m_TexScale;
#ifdef HAS_NM_FLAT
@@ -57,7 +64,22 @@ void main() {
// Flat: reines XZ-UV wie das Terrain (uvY = worldPos.xz / texScale), kein Triplanar.
// Steep: Triplanar für alle nicht-flachen Flächen inkl. Decken und Tunnelwände.
vec4 col = texture(m_TexFlat, uvY) * flatBlend
#ifdef HAS_SPLAT
// Splatmap-UV: worldPos.xz linear auf [0,1] (kein Flip nötig Konvention im Editor: pz=0 → worldZ=-2048)
vec2 splatUV = (vWorldPos.xz + 2048.0) / 4096.0;
vec4 splat = texture(m_SplatMap, splatUV);
float w2 = splat.g;
float w3 = splat.b;
float w4 = splat.a;
float w1 = max(0.0, 1.0 - w2 - w3 - w4);
vec4 flatCol = texture(m_TexFlat, uvY) * w1
+ texture(m_TexFlat2, uvY) * w2
+ texture(m_TexFlat3, uvY) * w3
+ texture(m_TexFlat4, uvY) * w4;
#else
vec4 flatCol = texture(m_TexFlat, uvY);
#endif
vec4 col = flatCol * flatBlend
+ triplanar(m_TexSteep, uvX, uvY, uvZ, bw) * steepBlend;
// Geometrie-Normale für Beleuchtung, ggf. durch Normal-Map ersetzt.

View File

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 177 KiB

View File

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 KiB

View File

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 232 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 799 KiB

After

Width:  |  Height:  |  Size: 799 KiB

View File

Before

Width:  |  Height:  |  Size: 297 KiB

After

Width:  |  Height:  |  Size: 297 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB