载入中...
搜索中...
未找到
OceanSprayWgsl.h
浏览该文件的文档.
1#pragma once
2// Generated by scripts/compile_ocean_shaders.py.
4inline constexpr char sprayVertex[] = R"wgsl(struct Light3D{posRadius:vec4f,color:vec4f};
5struct Frame{mvp:mat4x4f,model:mat4x4f,lightDir:vec4f,lightColor:vec4f,tint:vec4f,cameraPos:vec4f,ambient:vec4f,lights:array<Light3D,8>,texBomb:vec4f,parallax:vec4f,surface:vec4f,view:mat4x4f,clipInfo:vec4f,cloud:vec4f,cloudWind:vec4f,envProbeCenter:vec4f,envProbeExtent:vec4f,skinInfo:vec4f,reflectionProbeCenter:array<vec4f,2>,reflectionProbeExtent:array<vec4f,2>};
6@group(0) @binding(0) var<uniform> frame:Frame;
7struct Varying {@builtin(position) pos:vec4f,@location(0) uv:vec2f,@location(1) coverage:f32};
8struct Vertex {@location(0) pos:vec3f,@location(1) normal:vec3f,@location(2) uv:vec2f};
9@vertex fn vs_main(input:Vertex)->Varying {
10 var out:Varying; out.pos=frame.mvp*vec4f(input.pos,1.0); out.pos.y=-out.pos.y;
11 out.uv=input.uv; out.coverage=input.normal.x; return out;
12}
13)wgsl";
14inline constexpr char sprayFragment[] = R"wgsl(struct Varying {@builtin(position) pos:vec4f,@location(0) uv:vec2f,@location(1) coverage:f32};
15@fragment fn fs_main(input:Varying)->@location(0) vec4f {
16 let alpha=(1.0-smoothstep(0.2,1.0,length(input.uv)))*input.coverage*0.7;
17 return vec4f(0.85,0.94,1.0,alpha);
18}
19)wgsl";
20}
constexpr char sprayFragment[]
constexpr char sprayVertex[]