Use the Multiresolution modifier for HD details
You can use the Multiresolution modifier to subdivide a mesh and then copy the vertex coordinates from another mesh (Reshape button). I tried this with a base resolution Genesis 8 mesh subdivided 3 times and a HD subdivision level 3 mesh exported from Daz Studio but unfortunately only a few of the vertices matched and the mesh turned into a mess.
Comments (30)
-
-
repo owner Without having looked much into the HD morphs, my spontaneous feeling is that they should be converted to normal maps somehow. So you can have high detail but the mesh is not denser and can be smoothed after posing. Too bad Daz didn’t provide normal maps instead.
-
reporter You can bake HD details into normal maps but the way is tedious and finicky (as far as I know), and requires manually fixing the seams since the meshes need to be separated so the UVs don’t overlap.
-
I fully agree about using normal maps instead of hd details. Indeed it is also possible to export the hd geometry to obj and convert it to a normal map or a displacement map for real bumps. I’d like to stress here that this only works for the base hd shape though. The hd morphs are morphs on the hd shape and I don’t know any method to export them.
https://www.youtube.com/watch?v=f1fynKtys-Y
Exporting the hd mesh to a multires is another thing and it mimics daz studio more closely. Then I understand it may be not worth it if it is too much of a work for the plugin, since doing it by hand is not too difficult anyway.
edit. @Brad in blender you can create a new uv map for the hd baking. You don’t need to use the daz maps.
-
The first test with commit 56f7ba7 is exciting. Below there's a comparison of the Mutation Morphs HD for G8F by JoLab, first iray then cycles.
https://www.daz3d.com/mutation-morphs-hd-for-genesis-8-female
The good side is that materials are preserved in the HD mesh. That doesn't happen with a obj export of course. So the plugin allows us to render the daz HD mesh with cycles that's super cool.
A little issue is that the rig doesn't follow the pose of the character. Exporting a posed character can be useful for prebending especially when baking HD where we don't have the HD jcms. Plus since for non-HD characters the rig is posed it would be consistent behaviour to pose it for HD too.
Then the less good side is:
1) The HD geometry can't be used as is for multires because the vertices don't follow the same order. We can use shrinkwrap to fit it but first we have to split separated meshes such as eyes and teeth. And depending on the HD shape we could have different degrees of success since shrinkwrap is not perfect anyway.
2) Same for baking displacement or normal maps, we need to split separated meshes first.
Then the above two points are true for obj exports as well so I believe what we get here is much better anyway.
3) The dbz exporter is very slow compared to obj, so we have to wait a bit. But this is expected since it's exported via script.
Scene included.
-
- attached muta.duf
-
repo owner This is a first step towards HD meshes. Not sure what will come out of it eventually. Some comments.
That the rig pose is lost is a bug. Previously it was baked into the rest pose, and is so again with the latest commit.
I could create a multires modifier from python, but I don’t know how to access the individual vertices. But even if I could, using multires is probably not feasible, since Blender and DS use different subdiv algorithms by default. Unless the subdivided vertices are ordered in the exact same order, one cannot copy the locations, so there is no simple way to transfer the information to the multires modifier.
That said, it should be possible to bake normal maps effectively. The reason is that this is a local problem; each face in the original mesh corresponds to a few (typically four) faces in the subdivided mesh, and they cover the same area in UV space. For each face, it should be possible to compute the offset for each point (pixel) in UV space with linear interpolation. But that is something that requires interpolation.
-
Commit 7c5b34d fixes the posed armature thank you Thomas for the quick fix !
As for multires yes that's the issue. I fear there's no way to fit the blender subdivision. That would require to reorder the vertices by following the topology that sounds very complex to me.
-
There is an interesting discussion by jcade of the daz forum. He found a method to get the hd mesh into the multires modifier by using a plugin to copy the vertex order. May be this could be useful to improve hd support.
https://www.daz3d.com/forums/discussion/comment/5786701/#Comment_5786701
-
There is a nice video by jcade where the process is shown step by step. It requires blender 2.9 though. The comments by Padone are mine that’s my name on the daz forum.
https://www.daz3d.com/forums/discussion/comment/5790646/#Comment_5790646
-
There’s also an interesting discussion at the daz forum about making an alembic importer compatible with the diffeomorphic plugin. The work is in progress by TheMysteryIsThePoint and will be useful to import hd animations in blender.
Also in the same discussion there’s Jessub Kim “JClave” who has in progress the special cycles build in
to render the uber shader.#7https://www.daz3d.com/forums/discussion/298831/
-
Since 2.9 is out and we have material issues with the HD figure as reported in
#184, may be it’s a good time to implement the solution by jcade, that doesn’t require manual operations by the user so it should be possible to automate it.https://www.daz3d.com/forums/discussion/comment/5790646/#Comment_5790646
-
repo owner Interesting. That could mean that HD export actually becomes useful.
-
I’ve been using this method alot recently and it works like a charm! With the most recent version of blender, even the transfer vertices script isn’t neccessary anymore
-
I am impressed that you guys have been able to figure this out… I haven’t tried it yet - but I have a question. If I were to use this method, theoretically I would be able to keep the multires modifier hidden until final render, upon which I can enable it and render an animation with the full HD mesh, correct? If that’s the case I have to try this. I recently realized how much detail is lost without HD on some of my more muscular models. It would be great to be able to get that detail back. Baking normal maps only does so much.
-
Yes, that’s correct!
As it’s a modifier you can enable it for rendering only.
That makes it possible to work with the low res model with great performance and render everything out in superior quality! -
Yes that’s what multires is for. Personally I have some doubts about rebuild subdivisions since different HD meshes may derive from the same base mesh so I don’t understand entirely if the generated base mesh is always the same. May be this works best when HD is used for fine details.
In any case the workflow by jcade is interesting because it doesn’t require manual operations by the user, so it should be possible to automate it.
edit. About my doubts. As I understand it, to correctly transfer maps from the original base mesh to the derived base mesh, the HD morph should be applied to the original base mesh. Since this is done with dbz then I guess the workflow by jcade should work fine for the general case. AKA the derived base mesh is not always the same but we’re fine with it.
-
Thank you for the latest commit Thomas!
1eaa1f2
works like a charm
-
repo owner It appears that Rebuild Subdivisions creates a base mesh that has the same vertex order as the original mesh at base resolution. That is marvellous, because it means that no vertex reordering is necessary.
-
As for commit d734b1c it seems to work great. Below a comparison of the muta HD character, first iray then cycles.
I feel we have a milestone here.
-
Thomas, there’s a clever idea from Krampus at the daz forum about geografts. Basically you save the HD character without geografts then append the geograft from the base resolution version and it works fine just like that. There’s one minor caveat that you have to pay attention to first merge the geograft then merge the armatures. I tried with futalicious on the muta HD character and it works fine here.
I don’t know if this may help to fix something, or we can just explain this workflow in the user docs.
- Export the base resolution character with geografts, import in blender and save.
- Export the HD character without geografts, import in blender and save.
- In blender load the HD character and append the geograft from the base resolution, then parent the geograft to the HD character, then merge the geograft, then merge the armatures.
Please Thomas let us now what you think about this.
https://www.daz3d.com/forums/discussion/comment/5999337/#Comment_5999337
-
repo owner Yes, this seems to work. Actually, you don’t to save the blend files. Here is a slight variation:
- Import the HD character without geografts. Two collections are created, delete the one at base resolution.
- Import the base resolution character. Another collection is created.
- Merge the geografts from the last collection with the HD mesh in step 1.
- Delete the last collection.
This works because the HD mesh with its multires modifier has the same topology as the original mesh, so you can do the same things with it (merge geografts, load JCMs, etc.)
-
repo owner I don’t think this workflow can be automated, since it requires two separate files from DS, so I need to write something about it.
-
I was hoping that the HD exporter could export the base mesh, then “unparent” aka “unfit” the geografts, then export the HD mesh without geografts. Then the HD importer could also copy the geografts to the HD figure.
If this is possible then the user would just have to merge geografts as usual. Also in this case an option to avoid importing the base mesh would be useful, since we only need it to bake normal maps and it is not needed for multires.
If this is not possible or too much complex to implement then manual work from the user is just fine I guess. We do have a great tool anyway. Please note that geografts may be rigged so in step 3 you also need to parent the geograft armature to the HD figure.
-
repo owner Well, I just wrote a blog post on how to deal with geografts, and it is not really that complicated. https://diffeomorphic.blogspot.com/2020/09/hd-meshes-and-geografts.html
Besides, I’m not really comfortable with the Daz scripting language, so the less that has to be changed on the DS side the better. So unless there is some really strong reasons to do things differently, I will leave it as it is.
-
As for the daz api there’s TheMysteryIsThePoint at the daz forum who’s developing an alembic exporter compatible with diffeo. Would you mind if we ask him for a c++ version of the HD exporter ? This will speed up things a lot.
-
Also, since the HD workflow may require to get the base mesh anyway, then we may have the HD exporter to export only the HD version and the base exporter to export only the base version. This would make sense also for the case where the user doesn’t need to bake normal maps and/or to use geografts.
-
repo owner Alessandro, at this time the LD version is needed, because the import script copies things like materials and uv map names from the LD mesh to the HD mesh. That could done differently, but that would require rewriting some code on the import side, which I don’t want to do right now.
I wouldn’t worry so much about that the extra LD mesh uses up resources. As the table at the bottom of http://diffeomorphic.blogspot.com/2020/09/high-resolution-meshes.html shows, the LD mesh is very small compared to the HD mesh, especially at high subdivision levels. Asymptotically both export time and file size seem to grow quadratically with subd level, which makes sense since the number of vertices quadruples and most time is probably spent on disk access.
-
repo owner TheMysteryIsThePoint is the guy with this thread, right. If somebody wants to develop a C++ version of the exporters, then yes please, I would appreciate that. It shouldn’t be terribly hard, because the code is rather short and the same API is available in both languages, I think.
-
repo owner - changed status to resolved
- Log in to comment
@Brad You have to use shrinkwrap first to match the vertices.
https://www.youtube.com/watch?v=MU7EQjauKNo
https://www.youtube.com/watch?v=1CiQxc1QvRM
Personally I'm not a big fan of HD characters because they are too heavy for animation. Also I fear it's not possible to import HD morphs because they are not documented and only available to PAs.
Nevertheless I agree some basic support for HD, such as importing the base HD shape as suggested above, would be nice to have. This would allow at least for still pictures of HD characters in blender. It is also true that doing this by hand is not a big deal so if this is too complex for the plugin to implement it may be not worth it.
edit. Also may be there could be issues with geografts since they would probably need to be merged before applying the multires.