Quote: "Perhaps a variable that provides the Y-height of the wave at X,Z location"
Working on that right now besides trying to fix some bugs.
I thought I could just use the calculation from the vertex shader at first, but the vertices also need to move on the X and Z axis.
This is what I tried, but one can't just pull the Y value from it as it would be the height for another X and Z position:
function SP_Ocean_GetWaveHeight(OceanID,X#,Z#)
WavePower#=2.5
DeltaT#=Timer()*SP_Ocean[OceanID].Speed#*1000.0
for WaveID=0 to SP_Ocean[OceanID].MaxWaves
w#=2.0*3.1416/SP_Ocean[OceanID].Wave[WaveID].Length#*0.3
DirX#=sin(SP_Ocean[OceanID].Wave[WaveID].Angle#)
DirY#=cos(SP_Ocean[OceanID].Wave[WaveID].Angle#)
Amplitude#=SP_Ocean[OceanID].Wave[WaveID].Amplitude#
dotD#=X#*DirX#+Z#*DirY#
C#=pow(cos(w#*dotD#+DeltaT#*2.0)*0.5+1.0,WavePower#)
S#=pow(sin(w#*dotD#+DeltaT#*2.0)*0.5+1.0,WavePower#)
WaveX#=WaveX#+SP_Ocean[OceanID].Steepness#*Amplitude#*DirX#*C#
WaveY#=WaveY#+(Amplitude# * S#) - Amplitude#
WaveZ#=WaveZ#+SP_Ocean[OceanID].Steepness#*Amplitude#*DirY#*C#
next WaveID
endfunction WaveY#
[Edit]Now, I guess it's even better if you also get the X and Z distortion of a sample point.[Edit]