mpr icon indicating copy to clipboard operation
mpr copied to clipboard

How to implement Oracle-type operations?

Open VokerZJ opened this issue 1 year ago • 2 comments

I would like to use the Tree constructed with Libfive's Oracle API for rendering with MPR, taking full advantage of the GPU's acceleration capabilities. However, I found that the code does not seem to support this kind of operation. I want to know how to implement it. Can anyone give me some advice and help? image

VokerZJ avatar Sep 03 '24 07:09 VokerZJ

This will not be particularly easy!

As you've seen, MPR only supports pure math operations. Implementing a fully generic oracle for MPR would probably be overkill; in libfive, it was important to allow others to extend the library with closed-source components.

It would be simpler to add a specific new opcode (e.g. ORACLE_MESH), then write the CUDA code to implement that operation. The actual implementation — as well as how to pass in data and whether to support tape simplification — are left as an exercise to the reader.

mkeeter avatar Sep 03 '24 12:09 mkeeter

Thank you so much,sir . I

VokerZJ avatar Sep 04 '24 07:09 VokerZJ

Dear sir, I have encountered another issue. When I use functions like blend (or blend_intersection, etc.) to mix SDFs several times, I find that the normal vector becomes "infinite", which causes the graph to turn black. Do you have any suggestions for solving this? Thank you

VokerZJ avatar Jan 26 '25 07:01 VokerZJ