-
Notifications
You must be signed in to change notification settings - Fork 3
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
Unexpected png renders #3
Comments
That's very likely a failure to zero-initialize glm vectors (see #2). You can either hard code the zero-initialization, or set the flag GLM_FORCE_CTOR_INIT. As a side note, I have been expanding this program here (for windows but compiled with MinGW so it only requires tiny changes for other platforms): https://bitbucket.org/Diffeomorphic/import_daz/issues/357/it-is-possible-to-read-dhdm-files-directly . It's still not well organized since I was trying different things, but feel free to take stuff from there too, like EXR support, support for base meshes with triangles (like genesis 2 ones), auto-scaling option, interfacing with Blender directly, etc. |
Thanks a lot, I'm trying those right now! |
@Xin-888 I'm trying to implement your modifications, can you explain the code required to generate the meshdiff in your version? Here is what I've tried but it returns black exrs: ...
auto baseMesh = Mesh::fromDSF(baseMeshPath, uvMapPath);
std::string baseObj = "displacement_base.obj";
baseMesh.writeObj(baseObj); // I'm using a second function with the same name to save to file
auto finalMesh = baseMesh;
auto level = finalMesh.applyMorphs(morphPaths);
baseMesh.subdivide(level, {}, -1);
fmt::print(fg(fmt::color::green_yellow), "Triangulating...");
baseMesh.triangulate();
finalMesh.triangulate();
const char* baseName = "myBaseName";
MeshDiff::renderContextInit('X', 4096); // use 'P' for png
MeshDiff diff('T', baseMesh, finalMesh ,baseName,true ,1.0,0.5,1.0);
const std::set<unsigned short> selectedTiles {1001,1002,1003,1004,1005,1006};
std::vector<std::future<void>> asyncs;
diff.writeToImage("out",selectedTiles,asyncs);
MeshDiff::renderContextFinish();
std::cout << "Async Waiting...\n";
for (auto & async : asyncs)
async.get(); Small note: |
Tiles are still being filtered out if the maximum displacement in that tile is small (just like the version here does). The tile set filtering added later is done after that to exclude tiles which have non-negligible displacement but which you don't care about. Also, thanks for that slashes thing, I will change that. |
Thanks I did not know about this optimization very useful!
|
Hi @edolstra,
Thanks for this great utility, I'm trying to debug it now but everything seems to work except the render to png (Applied morphs obj look like they should):
Do you have a clue?
I'm on macOS with:
The text was updated successfully, but these errors were encountered: