Skip to main content

🌊 Spline Data Generator - Physics-Accurate Breaking Wave Authoring

Β· 4 min read
Galidar
Founder, Galidar Studio

Advanced spline-based authoring system for creating physically-accurate breaking wave animations with real-time controls and LUA export for Wave Forge Studio integration.

Overview​

The Spline Data Generator provides a complete workflow for authoring breaking wave animations using 21 spline curves that represent the full lifecycle of a surf waveβ€”from initial swell through barrel formation to collapse and wash.


Breaking Wave Spline System​

21-Spline Architecture​

Each spline represents a phase in the wave lifecycle:

SplinesPhaseDescription
01-04SwellDeep water wave approaching shore
05-07RiseWave steepening as depth decreases
08-16BarrelWave curling and tube formation
17-21Collapse & WashBreaking and foam rush

Spline Point Structure​

FBreakingWaveSplinePoint​

Each control point contains complete transformation data:

USTRUCT(BlueprintType)
struct FBreakingWaveSplinePoint
{
UPROPERTY(EditAnywhere)
float InputKey = 0.f;

UPROPERTY(EditAnywhere)
FVector Location = FVector::ZeroVector;

UPROPERTY(EditAnywhere)
FRotator Rotation = FRotator::ZeroRotator;

UPROPERTY(EditAnywhere)
FVector ArriveTangent = FVector::ZeroVector;

UPROPERTY(EditAnywhere)
FVector LeaveTangent = FVector::ZeroVector;
};

Real-Time Controls​

Splash Impact​

Controls the intensity of the wave breaking curl:

UPROPERTY(EditAnywhere, meta = (ClampMin = "0.0", ClampMax = "1.0"))
float SplashImpact = 1.0f;
ValueResult
0.0Minimal curl, gentle wave
0.5Moderate tube formation
1.0Full barrel, surf wave impact

Surf Wave Height Transition​

Controls overall wave crest height:

UPROPERTY(EditAnywhere, meta = (ClampMin = "0.0", ClampMax = "2.0"))
float SurfWaveHeightTransition = 1.0f;
ValueResult
0.0Minimum wave height
1.0Default physics-based height
2.0Double height (exaggerated)

Ripple Wave Height Transition​

Controls post-impact ripple amplitude:

UPROPERTY(EditAnywhere, meta = (ClampMin = "0.0", ClampMax = "2.0"))
float RippleWaveHeightTransition = 1.0f;

Physics ratios:

  • Pre-breaking (05-07): 20% of crest height
  • Post-impact (08-21): 27% of crest height (energy transfer)

Editor Actions​

Spline Generation​

// Generate/synchronize splines to match SplineCount
UFUNCTION(CallInEditor)
void GenerateSplines();

// Generate points for all managed splines
UFUNCTION(CallInEditor)
void GeneratePointsForAllSplines();

// Generate points for selected spline only
UFUNCTION(CallInEditor)
void GeneratePointsForSelectedSpline();

Breaking Wave Actions​

// Apply physics data with current control values
UFUNCTION(CallInEditor)
void ApplyBreakingWavesData();

// Reset all controls to defaults
UFUNCTION(CallInEditor)
void ResetBreakingWavesDefaults();

// Export modified data to LUA
UFUNCTION(CallInEditor)
void ExportBreakingWavesLUA();

LUA Import/Export​

Wave Forge Studio Integration​

Export spline data for use in Wave Forge Studio:

UFUNCTION(CallInEditor)
void ExportLUA();

UFUNCTION(CallInEditor)
void ImportLUA();

Export Format​

-- Generated by Oceanology Spline Data Generator
SplineData = {
Spline_01 = {
{ Key = 0, Location = {0, 0, 0}, Rotation = {0, 0, 0},
ArriveTangent = {100, 0, 0}, LeaveTangent = {100, 0, 0} },
-- ... more points
},
-- ... splines 02-21
}

Spline Configuration​

General Settings​

UPROPERTY(EditAnywhere)
FName ActorTag = "OceanologySplineData";

UPROPERTY(EditAnywhere, meta = (ClampMin = "0", ClampMax = "21"))
int32 SplineCount = 0;

UPROPERTY(EditAnywhere, meta = (ClampMin = "2", ClampMax = "20"))
int32 SplinePointCount = 2;

Automatic Management​

The system automatically:

  • Creates/destroys spline actors based on SplineCount
  • Assigns stable names (OceanologySplineData_01 through _21)
  • Tags actors for identification
  • Positions splines in sequence

Interpolation System​

Smooth Transitions​

Splines 08-16 use interpolation between wave states:

void InterpolateSplinePoints(
const TArray<FBreakingWaveSplinePoint>& PointsA,
const TArray<FBreakingWaveSplinePoint>& PointsB,
float Alpha,
TArray<FBreakingWaveSplinePoint>& OutInterpolatedPoints
) const;

This enables:

  • Smooth barrel formation progression
  • Continuous wave shape evolution
  • Physically plausible transitions

Breakpoint Key​

Each spline has a defined breakpoint where the wave impact occurs:

int32 GetBreakpointKeyForSpline(int32 SplineIndex) const;

The breakpoint is Key 4 for most barrel splines (08-16).


Physics Data​

Crest Height Calculation​

float GetCrestHeightForSpline(int32 SplineIndex) const;

Key 2 defines the wave crest in all splines.

Ripple Ratio​

float GetRippleRatioForSpline(int32 SplineIndex) const;

Returns 0.20 (pre-breaking) or 0.27 (post-impact) based on energy conservation.


Editor Selection Integration​

Interactive Workflow​

The generator responds to editor selection:

  1. Select a managed spline actor
  2. Click "Generate Points for Selected Spline"
  3. Points regenerate with current settings

Selection-aware updates via USelection::SelectionChangedEvent.


Visualization​

Spline Colors​

Editor visualization uses distinct colors per spline phase:

  • Swell: Blue gradient
  • Rise: Cyan gradient
  • Barrel: Green to yellow
  • Collapse: Orange to red

Point Distribution​

Points are distributed along local X from 0 to 1000:

void RegenerateSplinePoints(
USplineComponent* SplineComp,
int32 NumPoints
) const;

Workflow Example​

Creating Breaking Waves​

  1. Place Generator in level
  2. Set SplineCount = 21 for full wave lifecycle
  3. Generate Splines - Creates all 21 actors
  4. Apply Breaking Waves Data - Loads physics-based shapes
  5. Adjust Controls - Fine-tune SplashImpact, heights
  6. Export LUA - Save for Wave Forge or runtime use

Iterative Refinement​

  1. Modify control values
  2. Apply Breaking Waves Data
  3. Preview in editor
  4. Repeat until satisfied
  5. Export final configuration

Integration Points​

Wave Forge Studio​

Exported LUA data can be:

  • Imported into Wave Forge Studio
  • Modified with Hermite curve tools
  • Baked to textures
  • Re-imported to Unreal

Runtime Material System​

Spline data drives:

  • Shore wave displacement
  • Foam generation masks
  • Normal map generation
  • UV animation curves

Resources​

  • Discord: #wave-authoring channel
  • Wave Forge Studio: Companion web tool
  • Documentation: Breaking waves technical guide