Comments (5)
my heart sank a little bit when i read this. i had a great plan here - all of the cpu collision queries were supposed to come from displacement textures. this would mean cpu collision takes advantage of the inherent LODing, and the visuals/collision would always exactly match. the cpu would have to just select whichever displacement texture is available at a point and then sample it, without needing to add all the components together.
however when i tried it i got massive pipeline stalls when reading the texture back. i had a test running where i was rendering a texture and then reading it back ~20 frames later and i still got a massive stall. i'm almost certain this is something broken in unity. i will try getting a latest version of unity and reproducing this issue in a small standalone project, and then submit it as a bug report.
in the meantime your idea should work, and i'll look at implementing this. im not stoked on adding more computation and memory accesses to the height samples - but your caching work should offset that cost!
from crest.
Promising news - to address this very stall issue unity has introduced an async GPU readback api. I came across it via this recent tweet: https://twitter.com/_kzr/status/951760588127924224
I have a small project which does the old and new readback paths, and the new api has no stall whatsoever, and the implementation is really simple. I've got it working with the right texture format and I'm ready to have a stab at it in Crest. I'll keep you posted.
The catch is that the API is in the experimental stage (introduced in 2018.1), and currently only supports DX11/12. It sounds like Unity will expand the platform support next. However, if the 2018.1 dependency or the current limited platform support sound like issues to you, let me know.
(Older links for the record: https://medium.com/google-developers/real-time-image-capture-in-unity-458de1364a4c , https://answers.unity.com/questions/465409/reading-from-a-rendertexture-is-slow-how-to-improv.html , https://forum.unity.com/threads/readpixels-stalls-the-pipeline-in-unity-5.339324/ ).
from crest.
from crest.
So maybe the great plan worked out after all - reading back the shape data asynchronously worked out well and comes with a load of advantages. I've created a pull request to capture the notes, and any feedback:
Let me know what you think.
from crest.
I am closing this for now, as I don't have plans to do further work on this. I wrote my understanding of the status at the bottom of #14 . Reopen if I have overlooked something.
from crest.
Related Issues (20)
- Boat Physics - Adding colliders and player to boat causing big issues HOT 1
- Problems when rendering HOT 1
- Shader broken on 2022.2.4 on Metal HOT 5
- URP reflection error when using two cameras after build. HOT 3
- Updating ShapeFFT parameters runtime, generates a lot of garbage HOT 5
- HDRP underwater volumetric lights not working properly HOT 2
- 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 35
- 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
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.