Gerstner waves general shader.
More...
|
| vec3 | gerstner (Wave gw, vec2 p, float t) |
| |
| void | gerstnerFrame (Wave gw, vec3 pos, float t, inout vec3 tn, inout vec3 bn, inout vec3 nn, float distWeight) |
| |
| void | gerstnerFrameFinalize (inout vec3 tn, inout vec3 bn, inout vec3 nn) |
| |
Gerstner waves general shader.
◆ gerstner()
| vec3 GPUShaders::Common::Gerstner_waves::gerstner |
( |
Wave |
gw, |
|
|
vec2 |
p, |
|
|
float |
t |
|
) |
| |
|
inline |
Apply a Gerstner wave to a given location in the plane.
- Parameters
-
| gw | the wave parameters |
| p | the 2D position to evaluate the wave at |
| t | the current time |
- Returns
- the shifted 3D wave position
◆ gerstnerFrame()
| void GPUShaders::Common::Gerstner_waves::gerstnerFrame |
( |
Wave |
gw, |
|
|
vec3 |
pos, |
|
|
float |
t, |
|
|
inout vec3 |
tn, |
|
|
inout vec3 |
bn, |
|
|
inout vec3 |
nn, |
|
|
float |
distWeight |
|
) |
| |
|
inline |
Compute the normal and tangent frame information associated to a given wave.
- Note
- Multiple waves can be applied sequentially, call gerstnerFrameFinalize at the end.
- Parameters
-
| gw | the wave parameters |
| pos | the 3D wave position |
| t | the current time |
| tn | will contain accumulated tangent information |
| bn | will contain accumulated bitangent information |
| nn | will contain accumulated normal information |
| distWeight | wave attenuation factor |
◆ gerstnerFrameFinalize()
| void GPUShaders::Common::Gerstner_waves::gerstnerFrameFinalize |
( |
inout vec3 |
tn, |
|
|
inout vec3 |
bn, |
|
|
inout vec3 |
nn |
|
) |
| |
|
inline |
Finalize the local tangent frame for a point on the surface.
- Parameters
-
| tn | accumulated tangent information |
| bn | accumulated bitangent information |
| nn | accumulated normal information |
- Note
- Inputs will be updated and normalized.
The documentation for this class was generated from the following file:
- resources/island/shaders/gerstner_waves.glsl