Water rendering doesnt work yet

This commit is contained in:
Dynamitos
2024-08-17 15:11:57 +02:00
parent 252a241208
commit 81090d78f0
12 changed files with 189 additions and 50 deletions
+40 -21
View File
@@ -64,16 +64,25 @@ class WaterRenderer {
float depth = 20.0f;
float lowCutoff = 0.0001f;
float highCutoff = 9000.0f;
int seed = 0;
int seed = 1;
Vector2 lambda = Vector2(1, 1);
uint32 N = 1024;
uint32 lengthScale0 = 256;
uint32 lengthScale1 = 256;
uint32 lengthScale2 = 256;
uint32 lengthScale3 = 256;
float foamBias = -0.5f;
float foamDecayRate = 0.05f;
float foamAdd = 0.5f;
// Layer 1
uint32 lengthScale1 = 94;
// Layer 2
uint32 lengthScale2 = 128;
// Layer 3
uint32 lengthScale3 = 64;
// Layer 4
uint32 lengthScale4 = 32;
float foamBias = 0.85f;
float foamDecayRate = 0.0175f;
float foamAdd = 0.1f;
float foamThreshold = 0.0f;
} params;
float speed = 1.0f;
@@ -89,34 +98,44 @@ class WaterRenderer {
Gfx::OSampler linearRepeatSampler;
struct MaterialParams {
Vector sunDirection = Vector(0, -1, 0);
Vector sunDirection = Vector(-1.29f, -1.0f, 4.86f);
float displacementDepthAttenuation = 1;
float foamSubtract0 = 0;
float foamSubtract1 = 0;
float foamSubtract2 = 0;
float foamSubtract3 = 0;
float foamSubtract0 = 0.04f;
float foamSubtract1 = -0.04f;
float foamSubtract2 = -0.46f;
float foamSubtract3 = -0.38f;
float tile1 = 0.01f;
float tile2 = 3.0f;
float tile3 = 3.0f;
float tile4 = 0.13f;
float normalStrength = 1;
float foamDepthAttenuation = 1;
float normalDepthAttenuation = 1;
float roughness = 0.1f;
float roughness = 0.075f;
Vector sunIrradiance = Vector(1, 1, 1);
float foamRoughnessModifier = 1;
Vector sunIrradiance = Vector(1.0f, 0.694f, 0.32f);
float foamRoughnessModifier = 0;
Vector scatterColor = Vector(1, 1, 1);
float environmentLightStrength = 1;
Vector scatterColor = Vector(0.016f, 0.0735f, 0.16f);
float environmentLightStrength = 0.5f;
Vector bubbleColor = Vector(1, 1, 1);
Vector bubbleColor = Vector(0, 0.02f, 0.016f);
float heightModifier = 1;
float bubbleDensity = 1;
float wavePeakScatterStrength = 1;
float scatterStrength = 1;
float scatterShadowStrength = 1;
float scatterShadowStrength = 0.5f;
Vector foamColor = Vector(1, 1, 1);
uint32 contributeDisplacement1 = true;
uint32 contributeDisplacement2 = false;
uint32 contributeDisplacement3 = false;
uint32 contributeDisplacement4 = false;
Vector foamColor = Vector(0.6f, 0.5568f, 0.492f);
} materialParams;
// Water
Gfx::OUniformBuffer materialUniforms;