Comments (2)
Thanks SirPolly! I'll write some thoughts below.
Crest also uses gerstner waves, and there are functions to sample displacement/height - see the ShapeGerstnerBatched component. This is stateless, although the time is currently driven by an internal variable in the OceanRenderer (_elapsedTime) right now. It would be possible to use any time here though.
The unfortunate caveat with the above is that these functions dont take into account the depth of the ocean floor (which dampens the waves which have long wavelengths). This is because the sea depth is rendered on the fly on the GPU, or cached in textures on the GPU. An option here would be to read the sea depth on the CPU and use this when computing the wave shape on the CPU. Another option would be to use some kind of manual dampening of the waves using primitives such as spheres, which could be used on both the CPU and GPU.
The best path to get the collision on the CPU is to read back the GPU shape textures. This has a couple of frames of latency. I'm guessing though that this would not work for a networked game because you probably need the future state of the ocean, and therefore latency is not acceptable.
A final option is to bake out the ocean shape into textures as an offline step instead of computing them on the fly - for example bake out 32 frames of animation from a simulation software such as blender, and then read these textures on both the CPU and GPU. This would be cheap but requires the offline setup steps.
Let me know if this makes sense and if it addresses your questions!
from crest.
I'll resolve this (I'm a "zero inbox" kind of guy :)) but feel free to keep this conversation going, i'll get notifications if you reply.
I'm interested to know if there are any generic changes i can absorb into crest to make it work better for networking, so it would be good for me to understand this better.
from crest.
Related Issues (20)
- Local / movable spectrums or crest shapes HOT 3
- Foam / wake vibration when approaching whirlpools HOT 20
- Pressing the Windows Key in the editor disables underwater rendering HOT 3
- Wake / foam artifacts when moving the camera quickly HOT 11
- Delayed LOD / tile enabling when using large clipping areas HOT 5
- Depth Cache not populated - Exported Image is Black HOT 8
- Water interaction is not visible when moving camera away from the sea level HOT 1
- Underwater broken with XR multi-pass rendering HOT 1
- No caustics, no shadow data and/or constant shadowing on iOS
- Error of Does not exist some Classes. HOT 1
- Sporadic gaps / precision errors in tiles. HOT 32
- SphereWaterInteraction and RegisterDynamicWavesInput do not work correctly inside a flow area HOT 11
- Activating flow in the material when oceanrenderer is running does only work in editor HOT 2
- FindObjectsSortMode HOT 3
- Enable Shader API does not function without changing underwater appearance HOT 20
- Enable Shader API causes artifacts HOT 4
- Planar Reflections issue with non-standard shaders using transparency HOT 13
- Premature tile culling during extreme camera maneuvers above the ocean HOT 1
- Portal feature broken with Unity Recorder 360 View
- Directional lights that are not active on any layer change the color of subsurface scattering HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crest.