Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
GPUShaders::Common::Gerstner_waves Class Reference

Gerstner waves general shader. More...

Classes

struct  Wave
 

Public Member Functions

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)
 

Detailed Description

Gerstner waves general shader.

Member Function Documentation

◆ 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
gwthe wave parameters
pthe 2D position to evaluate the wave at
tthe 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
gwthe wave parameters
posthe 3D wave position
tthe current time
tnwill contain accumulated tangent information
bnwill contain accumulated bitangent information
nnwill contain accumulated normal information
distWeightwave 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
tnaccumulated tangent information
bnaccumulated bitangent information
nnaccumulated normal information
Note
Inputs will be updated and normalized.

The documentation for this class was generated from the following file: