Weiter gearbeitet
22
blight-assets/src/main/resources/MatDefs/FlowingWater.j3md
Normal file
@@ -0,0 +1,22 @@
|
||||
MaterialDef Flowing Water {
|
||||
MaterialParameters {
|
||||
Texture2D NormalMap
|
||||
Texture2D FoamMap
|
||||
Color Tint
|
||||
Float UVScale : 6.0
|
||||
Float Time : 0.0
|
||||
Float FlowSpeed : 1.0
|
||||
Float FoamAmount : 0.0
|
||||
}
|
||||
Technique {
|
||||
VertexShader GLSL150: Shaders/FlowingWater.vert
|
||||
FragmentShader GLSL150: Shaders/FlowingWater.frag
|
||||
WorldParameters {
|
||||
WorldViewProjectionMatrix
|
||||
}
|
||||
Defines {
|
||||
HAS_NORMALMAP : NormalMap
|
||||
HAS_FOAMMAP : FoamMap
|
||||
}
|
||||
}
|
||||
}
|
||||
62
blight-assets/src/main/resources/Shaders/FlowingWater.frag
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifdef HAS_NORMALMAP
|
||||
uniform sampler2D m_NormalMap;
|
||||
#endif
|
||||
#ifdef HAS_FOAMMAP
|
||||
uniform sampler2D m_FoamMap;
|
||||
#endif
|
||||
|
||||
uniform vec4 m_Tint;
|
||||
uniform float m_FoamAmount;
|
||||
|
||||
in vec2 vUV;
|
||||
in vec2 vTex1;
|
||||
in vec2 vTex2;
|
||||
|
||||
out vec4 outFragColor;
|
||||
|
||||
void main() {
|
||||
// ── Randabstand: 0 = Mitte, 1 = Rand ─────────────────────────────────────
|
||||
float edgeDist = abs(vUV.x * 2.0 - 1.0);
|
||||
|
||||
// ── Tiefengradient ────────────────────────────────────────────────────────
|
||||
// Ränder heller/transparenter (flaches Ufer), Mitte dunkler (tief)
|
||||
vec3 baseColor = m_Tint.rgb * (1.0 - edgeDist * 0.45);
|
||||
float baseAlpha = m_Tint.a * smoothstep(0.0, 0.18, 1.0 - edgeDist);
|
||||
|
||||
// ── Dual-Layer Normal-Map: Specular + Wellenhelligkeit ────────────────────
|
||||
float specular = 0.0;
|
||||
float ripple = 0.0;
|
||||
#ifdef HAS_NORMALMAP
|
||||
vec3 n1 = texture(m_NormalMap, vTex1).rgb * 2.0 - 1.0;
|
||||
vec3 n2 = texture(m_NormalMap, vTex2).rgb * 2.0 - 1.0;
|
||||
vec3 n = normalize(n1 + n2);
|
||||
|
||||
// Feste Sonnenrichtung – gut für Bachlauf-Optik
|
||||
vec3 sunDir = normalize(vec3(0.5, 1.0, 0.3));
|
||||
specular = pow(max(0.0, dot(n, sunDir)), 22.0);
|
||||
// Wellenhelligkeit variiert den Basiston leicht
|
||||
ripple = dot(n, vec3(0.0, 1.0, 0.0)) * 0.10;
|
||||
#endif
|
||||
|
||||
// ── Schaum ────────────────────────────────────────────────────────────────
|
||||
// Uferschaum wird stärker je näher am Rand; Wasserfälle extra
|
||||
float foamEdge = smoothstep(0.55, 1.0, edgeDist);
|
||||
float foamMask = clamp(foamEdge + m_FoamAmount * 0.75, 0.0, 1.0);
|
||||
|
||||
#ifdef HAS_FOAMMAP
|
||||
float foamSample = texture(m_FoamMap, vTex1 * 0.4).r;
|
||||
foamMask *= foamSample;
|
||||
#else
|
||||
// Prozeduraler Fallback wenn keine Schaumtextur geladen
|
||||
float procFoam = (sin(vTex1.x * 6.283) * 0.5 + 0.5)
|
||||
* (sin(vTex1.y * 3.141) * 0.5 + 0.5);
|
||||
foamMask *= procFoam;
|
||||
#endif
|
||||
|
||||
// ── Zusammenführen ────────────────────────────────────────────────────────
|
||||
vec3 waterColor = baseColor + ripple + vec3(0.35, 0.45, 0.55) * specular;
|
||||
vec3 finalColor = mix(waterColor, vec3(1.0), foamMask);
|
||||
float finalAlpha = max(baseAlpha, foamMask * 0.9);
|
||||
|
||||
outFragColor = vec4(clamp(finalColor, 0.0, 1.0), finalAlpha);
|
||||
}
|
||||
21
blight-assets/src/main/resources/Shaders/FlowingWater.vert
Normal file
@@ -0,0 +1,21 @@
|
||||
uniform mat4 g_WorldViewProjectionMatrix;
|
||||
uniform float m_Time;
|
||||
uniform float m_UVScale;
|
||||
uniform float m_FlowSpeed;
|
||||
|
||||
in vec3 inPosition;
|
||||
in vec2 inTexCoord;
|
||||
|
||||
out vec2 vUV; // raw [0..1] UV für Tiefe / Rand-Logik
|
||||
out vec2 vTex1; // scrollende Normal-Map-UV (flussabwärts)
|
||||
out vec2 vTex2; // scrollende Normal-Map-UV (diagonal, gegenläufig)
|
||||
|
||||
void main() {
|
||||
vUV = inTexCoord;
|
||||
float t = m_Time * m_FlowSpeed;
|
||||
vTex1 = vec2(inTexCoord.x * m_UVScale,
|
||||
inTexCoord.y * m_UVScale - t);
|
||||
vTex2 = vec2(inTexCoord.x * m_UVScale * 0.7 - t * 0.25,
|
||||
inTexCoord.y * m_UVScale * 0.7 + t * 0.55);
|
||||
gl_Position = g_WorldViewProjectionMatrix * vec4(inPosition, 1.0);
|
||||
}
|
||||
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 205 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 205 KiB |
|
After Width: | Height: | Size: 213 KiB |
|
After Width: | Height: | Size: 211 KiB |
|
After Width: | Height: | Size: 384 KiB |
BIN
blight-assets/src/main/resources/Textures/water/river.jpg
Normal file
|
After Width: | Height: | Size: 164 KiB |
BIN
blight-assets/src/main/resources/Textures/water/river_normal.jpg
Normal file
|
After Width: | Height: | Size: 227 KiB |
|
After Width: | Height: | Size: 654 KiB |
|
After Width: | Height: | Size: 47 KiB |
BIN
blight-assets/src/main/resources/animations/clips/idle.j3o
Normal file
BIN
blight-assets/src/main/resources/animations/clips/idle_jump.j3o
Normal file
BIN
blight-assets/src/main/resources/animations/clips/running.j3o
Normal file
BIN
blight-assets/src/main/resources/animations/clips/sprint.j3o
Normal file
BIN
blight-assets/src/main/resources/animations/clips/stand_up.j3o
Normal file
BIN
blight-assets/src/main/resources/animations/clips/tpose.j3o
Normal file
BIN
blight-assets/src/main/resources/animations/clips/walking.j3o
Normal file
BIN
blight-assets/src/main/resources/animations/idle.glb
Normal file
BIN
blight-assets/src/main/resources/animations/idle_jump.glb
Normal file
BIN
blight-assets/src/main/resources/animations/running_jump.glb
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"clips": [
|
||||
"idle",
|
||||
"idle_jump",
|
||||
"running",
|
||||
"running_jump",
|
||||
"sprint",
|
||||
"stand_up",
|
||||
"tpose",
|
||||
"walking"
|
||||
],
|
||||
"actionMap": {
|
||||
"DEFAULT": "tpose",
|
||||
"IDLE": "idle",
|
||||
"WALK": "walking",
|
||||
"RUN": "running",
|
||||
"SPRINT": "sprint",
|
||||
"JUMP": "idle_jump",
|
||||
"RUNNING_JUMP": "running_jump"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"clips": [
|
||||
"idle",
|
||||
"idle_jump",
|
||||
"running",
|
||||
"running_jump",
|
||||
"sprint",
|
||||
"stand_up",
|
||||
"tpose",
|
||||
"walking"
|
||||
],
|
||||
"actionMap": {
|
||||
"DEFAULT": "tpose",
|
||||
"IDLE": "idle",
|
||||
"JUMP": "idle_jump",
|
||||
"WALK": "walking",
|
||||
"RUN": "running",
|
||||
"SPRINT": "sprint",
|
||||
"RUNNING_JUMP": "running_jump"
|
||||
}
|
||||
}
|
||||
BIN
blight-assets/src/main/resources/animations/sprinting.glb
Normal file
BIN
blight-assets/src/main/resources/animations/stand_up.glb
Normal file
BIN
blight-assets/src/main/resources/animations/tpose.glb
Normal file
19
blight-assets/src/main/resources/character/hero.character
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"chapter": 0,
|
||||
"level": 0,
|
||||
"xp": 0,
|
||||
"currentHp": 0,
|
||||
"maxHp": 0,
|
||||
"currentStamina": 0,
|
||||
"maxStamina": 0,
|
||||
"currentMana": 0,
|
||||
"myMana": 0,
|
||||
"listeners": [],
|
||||
"characterId": "hero",
|
||||
"name": {
|
||||
"id": "hero.name"
|
||||
},
|
||||
"modelPath": "Models/Chars/mainchar.j3o",
|
||||
"animSetPath": "human",
|
||||
"type": "MAIN_CHARACTER"
|
||||
}
|
||||
10
blight-assets/src/main/resources/character/silas.character
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"trader": false,
|
||||
"characterId": "silas",
|
||||
"name": {
|
||||
"id": "silas.name"
|
||||
},
|
||||
"modelPath": "Models/Chars/silas.j3o",
|
||||
"animSetPath": "human",
|
||||
"type": "NPC"
|
||||
}
|
||||