• 검색 결과가 없습니다.

FFT Ocean

N/A
N/A
Protected

Academic year: 2021

Share "FFT Ocean"

Copied!
60
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

BoraFX Ocean Tool

User Guide

Wanho Choi

(2)
(3)

Chronology

Zephyrus ZFX ZarVis BoraFX

2018 2017

2016 2014

해적 서유기2 귀취등 ?

(4)

Bora (보라)

잘게 부스러지거나 한꺼번에 많이 가루처럼 흩어지는 눈이나 물 따위.

(Snow or water that is crumbled or scattered like powder at a time.)

C++ based in-house fluid framework for Dexter Studios

It includes plug-ins for Maya, Houdini, and RenderMan

눈보라

(5)

Zephyrus / ZFX / ZarVis Ocea Bora Ocean

FFTW 3.3.6 FFTW 3.3.7

OpenMP (Intel Open Multi-Processing) TBB (Inter Threading Building Block) - GLSL realtime shader

world space / uv space world space / (uv space)

domainSize physicalLength / geometricLength with sceneConvertingScale

Phillips / JONSWAP / TMA (ad hoc)

Phillips / PiersonMoskowitz / JONSWAP / TMA (more physically accurate)

directionality (ad hoc)

swell

(more physically accurate) waveScale amplitudeGain

choppiness pinch

foam crest

foamPower, foamScale, foamAdd crestGain, crestBias .exr ➜ .tex ➜ ZVOceanOceanLoader .exr ➜ PxrBoraOcean

(6)
(7)

What we do not deal with

breaking wave

Tsunami

swash & backwash

whitecaps

(8)

What we do deal with

Ocean surface waves

Wind waves

(9)

Ocean Wave Generation Mechanism

If a

fluctuation breaks the equilibrium water surface level,

1)

gravity pulls it down

2)

inertia acquired during the falling movement appears

3)

it causes the water to penetrate below its level of equilibrium

4)

and

buoyancy causes a bouncing motion.

gravity

(10)
(11)

Key Terms

MWL

(Mean Water Level)

(12)

2D Height Field Approach

(13)
(14)

Ocean Waves

A complex of

many different sets of waves of different

(15)

Wind(-generated) Waves

Waves

on the free surface of bodies of water

(like oceans, seas, lakes, rivers, canals, puddles or ponds)

They result from the

wind blowing over an area of water surface.

They can

travel thousands of miles before reaching shore.

Main factors

1)

wind

2)

gravity

(16)
(17)

Wind(-generated) Waves

(18)

Fetch

(19)

Fully Developed Sea

The waves of a fully developed sea have the

maximum height

(20)

Swell

(21)

Swell

When directly generated and affected by local winds,

a wind wave system is called a

wind sea.

After the wind ceases to blow, wind waves are called swells.

More generally, a swell consists of wind-generated waves

that are

not significantly affected by the local wind at that time.

(22)

Sinusoidal vs Real Ocean Wave

A real ocean wave has

1)

sharper crests

2)

flatter troughs

(23)
(24)
(25)
(26)

The FFTW Library

Fastest Fourier Transform in the West

www.fftw.org

m_fftPlan = fftwf_plan_guru_dft_c2r (

rank, dims, howMany, howManyDims,

reinterpret_cast<fftwf_complex*>(in), out, FFTW_ESTIMATE | FFTW_DESTROY_INPUT

);

(27)
(28)
(29)
(30)
(31)
(32)
(33)
(34)

A Ocean Tile

A

2D square on xz-plane with y=0

It is

repeatable.

(35)

Attribute Editor Controls

(36)

Display Controls

Display Mode: None / Wireframe / Shaded Surface

Deep Water Color: trough 부분의 색상

Shallow Water Color: crest 부분의 색상

Sky Texture File: dome light로 사용할 이미지 파일 (.exr, .hdr, .jpg)

Glossiness: sky texture의 반사정도 (0.0~1.0)

Draw Outline: ocean tile의 외곽선 표시 on/off

Outline Color: outline의 색상

Outline Width: outline의 두께

Show Tangles: normal이 뒤집히는 부분 표시 on/off

Tangle Color: normal이 뒤집히는 부분을 표시 색상

(37)
(38)

Basic Controls (1/3)

Time Offset: 시간에 대한 옵셋

Time Scale: 시간에 대한 배속

Looping Duration: 몇 초 마다 반복할 것인가

(10초로 설정되어 있으면 240 프레임 마다 반복됨)

(crestAccumulation이 on되어 있으면 비활성화됨)

(flowSpeed>0이면 비활성화됨)

(39)

Basic Controls (2/3)

Direction: 바람의 방향 (0˚: +x축, 90˚: +z축)

Speed: 바람의 속도 (m/s)

Wind Fetch Length: wind fetch의 길이 (km)

Swell: swell의 정도 (0: no swell, 1: 100% swell)

Non-physical Flow Speed: translation 속도

(물리적이지 않음)

(40)

Basic Controls (3/3)

Swell: swell의 정도 (0~1)

Amplitude Gain: 수직(y축) 방향으로의 displacement scale factor

Pinch: 수평(xz-평면) 방향으로의 displacement scale factor

Crest Gain: crest(alpha 채널)값에 곱해지는 계수

Crest Bias: crest(alpha 채널)값에 더해지는 계수

alpha값 = ( crestGain * crest값) + crestBias

Crest Accumulation: crest값을 누적시킬지에 대한 on/off

Crest Decay: crest값이 사라지는 정도

(41)

Scene Converting Scale

Maya: grid 1 unit = 1cm (default setting)

Dexter: grid

1 unit = 10 cm (=0.1 m)

Bora Ocean의 scene converting scale = 10

Houdini: grid 1 unit = 1 m (default setting)

Dexter: grid

1 unit = 1 m 로 간주하여 사용한다.

Bora Ocean의 scene converting scale = 1

180 cm

18 칸 (Maya) 1.8 칸 (Houdini)

(42)

Scene Converting Scale

Scene Converting Scale OceanTile의 한 변의 길이 Maya Grid의 칸 수 Maya Grid 한 칸의 길이

0.1 100 m 10 칸 10 m (1,000 cm) 1 100 m 100 칸 1 m (100 cm) 10 100 m 1,000 칸 0.1 m (10 cm) 100 100 m 10,000 칸 0.01 m (1 cm) default setting

(43)
(44)
(45)

Export & Import MEL Script

BoraOceanCmd -nodeName “BoraOceanShape1” -toolName “export” -filePath

“/home/wanho.choi/zzz” -fileName “MyOcean” -startFrame 1001 -endFrame 1234;

BoraOceanCmd -nodeName “BoraOceanShape1” -toolName “import” -filePath

“/home/wanho.choi/zzz” -fileName “MyOcean”;

export

(46)

The Result Data

(47)
(48)

Data Workflow

Maya RenderMan

BoraOcean

PxrBoraOcean

.oceanParams

.exr sequence

displacement

.tex sequence

(49)
(50)

Ocean Map Rotation

θ rotated map original map θ Q(x ,z )P(x, z)

The coordinates should be rotated by -

θ

.

The vector should be rotated by +

θ

.

(51)
(52)
(53)
(54)

To Do List

Houdini VEX node

UV based displacement

Handling breaking waves

Interlocking with Bora water simulation

Fast peak detection for mist generation

Maya deformer

(55)
(56)

Key Classes

OceanParams

: parameters

OceanTile (resolution: 2

N

x2

N

)

: ocean spectrum data, FFT result data

OceanTileVertexData (resolution: (2

N

+1)x(2

N

+1))

: ocean tile geometry data, interpolation

OceanGLSLShader

: GLSL shader

GLDrawOcean

(57)

OceanTile oceanTile;

OceanTileVertexData oceanTileVertexData;

Per Frame Update Code

Header

Body

OceanParams oceanParams;

if( oceanTile.initialize( oceanParams ) ) {

oceanTileVertexData.initialize( oceanTile ); }

oceanTile.update( time );

(58)

glDrawOcean.draw ( oceanTileVertexData, cameraPosition, lightPosition, lightColor, deepWaterColor, shallowWaterColor, glossiness, exposure );

GLSL Drawing Code

Header Body GLDrawOcean glDrawOcean;

(59)

Interpolation Code

OceanTileVertexData oceanTileVertexData;

Header

Body

Vec3f GRD; // point before applying displacement Vec3f POS; // point after applying displacement Vec3f NRM; // normal

float WAV; // amount of displacement only in y-direction float CRS; // crest value

Vec3f wp; // world position being queried

oceanTileVertexData.lerp( wp, &GRD, &POS, &NRM, &WAV, &CRS );

oceanTileVertexData.catrom( wp, &GRD, &POS, &NRM, &WAV, &CRS ); oceanTileVertexData.lerp( wp, NULL, &POS, NULL, NULL, NULL );

(60)

참조

관련 문서

Department of Naval Architecture and Ocean Engineering Department of Naval Architecture and Ocean Engineering Department of Naval Architecture and Ocean Engineering, Department

Department of Naval Architecture and Ocean Engineering Department of Naval Architecture and Ocean Engineering Department of Naval Architecture and Ocean Engineering, Department

Department of Naval Architecture and Ocean Engineering Department of Naval Architecture and Ocean Engineering Department of Naval Architecture and Ocean Engineering, Department

Department of Naval Architecture and Ocean Engineering, Seoul National University... 2009

Department of Naval Architecture and Ocean Engineering, Seoul National University of College of Engineering.. Ship Motion &amp; Wave Load

Department of Naval Architecture and Ocean Engineering, Seoul National University.. Naval Architecture

[Ex] free surface wave motion generated by pressure forces (Fig. 6.8) flow over a weir under gravity forces (Fig.. • Vortex motion.. i) Forced vortex

Wide continental shelf → large storm surge (e.g. southwest coast of Korea) Storm surge + high tide → severe flooding in coastal areas.. 5.10 Simplified Analysis