Comments (3)
I can take a look at this over the next few weeks (really busy now, and it's a bit of work).
There is a method to add a mesh to the bvh, and if you know ahead of time which parts of your mesh will be modified, you can use the meshid to add and ignore certain meshes.
But I think there is another method in embree we can use for dynamic, but it will take some effort to port it. I remember it will also make rays a bit slower because of how it handles a changing bvh , so I need to add more flags or a new method etc
from dhart.
Appreciate it!
I searched a bit and here are my initial findings:
- There is an official tutorial including source code showing how to work with dynamic scenes
- The key here is to update the vertex buffer using the rtcUpdateGeometryBuffer method
https://github.com/embree/embree/blob/489b746c0d5010e0da10345e9dc96768bec9a037/tutorials/dynamic_scene/dynamic_scene_device.cpp#L268 - Additionally, it might be a good idea to set the build quality to
RTC_BUILD_QUALITY_REFIT
https://github.com/embree/embree/blob/489b746c0d5010e0da10345e9dc96768bec9a037/tutorials/dynamic_scene/dynamic_scene_device.cpp#L121-L122 - Currently the c# interface disposes of buffers after use and for the above methods to work they would have to be stored somewhere.
Somewhat related to this feature request, I had to identify the primitive Id of the hit mesh (essentially its face index) and added these changes to the dev branch:
ed722e0
Let me know if they should go somewhere else.
from dhart.
You are really moving along!
Yes the dynamic scene is what I was mentioning, but there is a bit more to it for dhart. Since you are getting into the weeds and moving faster than I can comment on, some considerations to keep in mind for what will need to happen...
- We need to consider speed. updating bvh can have some implications here. This means we will need to have a flag to use it or not
- Once we have a flag, there are multiple places the API needs to keep track of what it is using
- We need error handling for when users don't provide valid inputs/changes
- The python API has to get updated for any change that happens to the C interface (part of my delay on pulling dev was that I need to do this)
- There is a 'double precision' flag for the raytracer. the issue about it being called embreebvh has continued, but the backend can switch between nanort for double precision and embree. The functions are templated to support this, so the more we change about the bvh, the harder this becomes
- We need unit tests for everything, including in C api, especiallly for things like keeping hold of references and cleaning them
None of this is saying we can't do it, just some things I hope you can keep in mind when modifying so it is easier/faster for me to go through the PR
Thanks for working on all these features!
from dhart.
Related Issues (20)
- Naming Conventions Differ in C# and Python
- C API crashes when invalid mesh is used by a BVH or can't be cleaned up HOT 1
- Expose Save OBJ options HOT 1
- Building in command line places build folder outside of repo
- Add built-in for object distance in graph
- Add support for stream of rays in Embree HOT 6
- Documentation for Build missing visuals
- Github Actions overwriting interface docs
- consider changing C_Interface to use floats HOT 1
- Old C Interface unittests are commented out
- Git functionality not working in VS 2022 HOT 2
- Update cmake settings to presets
- Overloads for C# interface to accept floats HOT 6
- OpenMP batch sizing for additional functions
- OBJ loader assuming triangles
- Graph connections with aggregation may return 0 value HOT 1
- Upgrade Embree to v4
- Expose Edge Types
- Missing individual package build explanation
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 dhart.