-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MeshToLevelSet Rendering Fixes #5923
MeshToLevelSet Rendering Fixes #5923
Conversation
Welcome back Daniel, and thanks for looking into this!
Reading through the code, I'm not sure it was ever the intention to fail to render grids which didn't have the metadata. I suspect the intention was just to print a warning when we couldn't figure out a size estimate, but to render regardless. And the fact that
The existence of
I was confused by this, since you've only modified MeshToLevelSet, and I couldn't see any existing code to do the same in LevelSetOffset or PointsToLevelSet. To confuse me further, testing with the SceneInspector suggested that those nodes do generate the metadata despite not containing a call to I'm not actually sure how valid it is to use And since the
I definitely don't think we should be requiring the metadata to exist to render. And since the metadata may not be up to date, and doesn't even measure the required stream size anyway, I question whether we should use it at all. I'd also advocate for the following :
Seems like a good topic for our catch up today... |
46cad14
to
660f97a
Compare
Updated this PR to implement your suggestion that Arnold rendering should not depend on the metadata. |
660f97a
to
792e5f3
Compare
Rebased to fix conflict, and reworded Changes.md to be suitably user-facing. Merging. |
Artists at ImageEngine were confused why they couldn't render the output from MeshToLevelSet in Arnold.
I started by not discarding the exception message when it fails to render, which revealed the exception: "LookupError: Cannot find metadata file_mem_bytes".
I think we can reasonably assume that any vdb loaded from disk should have this stats information, so there are two reasonable solutions: either make sure every volume produced in Gaffer has these stats computed, or make sure rendering falls back to using the
memUsage()
call that computes it if the metadata isn't found. I've currently gone with the first one, since there might be more of a possible performance hazard with the second ( there might be some sort of instancing setup where you could end up callingmemUsage()
many times? ), but I haven't thought too hard about it, and there might be an argument for the second approach.The obvious next step is that if people actually want to render the result of these operations as volumes, then they need a way to convert them to fog volumes rather than level sets. We should probably have a LevelSetToVolume node - but it would be pretty wasteful to cache both versions, so there probably ought to be a MeshToVolume node as well ( which does what the current MeshToLevelSet does, and then calls openvdb::LevelSetUtil::sdfToFogVolume in place on it ).