Files
Seele/res/shaders/WaterCommon.slang
T

73 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-08-13 22:44:04 +02:00
struct WaterPayload
{
2024-08-21 10:24:37 +02:00
float3 offset;
float extent;
2024-08-26 22:35:22 +02:00
uint numMeshes;
2024-08-21 10:24:37 +02:00
};
struct WaterTile
{
int2 location;
2024-08-13 22:44:04 +02:00
float extent;
float height;
2024-08-21 10:24:37 +02:00
}
2024-08-13 22:44:04 +02:00
struct WaterVertex
{
float4 position_CS : SV_Position;
float3 position_WS : POSITION0;
float2 texCoord : TEXCOORD0;
float depth : DEPTH;
2024-08-26 22:35:22 +02:00
uint lod : BONEINDEX;
2024-08-13 22:44:04 +02:00
};
struct MaterialParams
{
float3 sunDirection;
float displacementDepthAttenuation;
float foamSubtract0;
float foamSubtract1;
float foamSubtract2;
float foamSubtract3;
2024-08-17 15:11:57 +02:00
float tile1;
float tile2;
float tile3;
float tile4;
2024-08-13 22:44:04 +02:00
float normalStrength;
float foamDepthAttenuation;
float normalDepthAttenuation;
float roughness;
float3 sunIrradiance;
float foamRoughnessModifier;
float3 scatterColor;
float environmentLightStrength;
float3 bubbleColor;
float heightModifier;
float bubbleDensity;
float wavePeakScatterStrength;
float scatterStrength;
float scatterShadowStrength;
2024-08-17 15:11:57 +02:00
uint contributeDisplacement1;
uint contributeDisplacement2;
uint contributeDisplacement3;
uint contributeDisplacement4;
2024-08-13 22:44:04 +02:00
float3 foamColor;
2024-08-17 15:11:57 +02:00
2024-08-13 22:44:04 +02:00
Texture2DArray displacementTextures;
Texture2DArray<float2> slopeTextures;
TextureCube environmentMap;
SamplerState sampler;
2024-08-21 10:24:37 +02:00
StructuredBuffer<WaterTile> tiles;
2024-08-13 22:44:04 +02:00
};
layout(set = 1)
ParameterBlock<MaterialParams> pWaterMaterial;