Vector Displacement in Karma
7853 21 2-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
Hello All,
It's that time of year when some knob brings up vector displacement. And I .... am that knob. lol
Here is what I have done:
Made a simple plane with overhangs in ZBrush.
Exported the level 4 mesh and vector displacement with the export settings set to 42 as demonstrated in the Zbrush docs.
Zbrush Vector Dislacment Docs:
http://docs.pixologic.com/user-guide/3d-modeling/exporting-your-model/vector-displacement-maps/ [docs.pixologic.com]
It is doing .. something: I am getting some bubbly meshes out of the render. I have attached screen grabs of my material network and render.
I am using OCIO color settings, so does that mean my displacement needs to be converted to ACSES CG? I thought I would not have to convert it b/c it is just raw data.
Kama vs. Mantra Comparison says there is displacement shading in both but doesn't specify if vector displacement works
https://www.sidefx.com/faq/question/karma-vs-mantra/ [www.sidefx.com]
As always, any help is greatly appreciated.
It's that time of year when some knob brings up vector displacement. And I .... am that knob. lol
Here is what I have done:
Made a simple plane with overhangs in ZBrush.
Exported the level 4 mesh and vector displacement with the export settings set to 42 as demonstrated in the Zbrush docs.
Zbrush Vector Dislacment Docs:
http://docs.pixologic.com/user-guide/3d-modeling/exporting-your-model/vector-displacement-maps/ [docs.pixologic.com]
It is doing .. something: I am getting some bubbly meshes out of the render. I have attached screen grabs of my material network and render.
I am using OCIO color settings, so does that mean my displacement needs to be converted to ACSES CG? I thought I would not have to convert it b/c it is just raw data.
Kama vs. Mantra Comparison says there is displacement shading in both but doesn't specify if vector displacement works
https://www.sidefx.com/faq/question/karma-vs-mantra/ [www.sidefx.com]
As always, any help is greatly appreciated.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
Hey, I'd also like to see vector displacement with Karma as well.
No, color management is only for the display. Would you apply color space to geo attributes? Don't think so. Displacement is the same but just with higher resolution. All you want is to get the same result as the original so no fiddling with the data.
If you could provide just a proxy setup maybe (a zip with a mesh, vector+normal disp, and maybe the most simple Karma setup), I'll be happy to take a look with Karma, and I'm no guru with that (so no promises). However, I've only got normal displacement going so far.
Edit: Maybe there is no need for a file. I'm trying myself.
Edit2: Added an image with a cube. There is some displacement (3 channels, 32-bit), but there are also some artifacts making it hard to see what is going on with the cube. Maybe I'll try with a simple plane first.
Edit3: Added image with plane. It seems like vector displacement actually works with Karma, at least "basically". However, that is all I can say for now. (with a subdivide, not included in the image below, the plane will look better due to the UV)
I am using OCIO color settings, so does that mean my displacement needs to be converted to ACSES CG?
No, color management is only for the display. Would you apply color space to geo attributes? Don't think so. Displacement is the same but just with higher resolution. All you want is to get the same result as the original so no fiddling with the data.
If you could provide just a proxy setup maybe (a zip with a mesh, vector+normal disp, and maybe the most simple Karma setup), I'll be happy to take a look with Karma, and I'm no guru with that (so no promises). However, I've only got normal displacement going so far.
Edit: Maybe there is no need for a file. I'm trying myself.
Edit2: Added an image with a cube. There is some displacement (3 channels, 32-bit), but there are also some artifacts making it hard to see what is going on with the cube. Maybe I'll try with a simple plane first.
Edit3: Added image with plane. It seems like vector displacement actually works with Karma, at least "basically". However, that is all I can say for now. (with a subdivide, not included in the image below, the plane will look better due to the UV)
Edited by SWest - Nov. 12, 2022 16:26:52
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
After looking closer at my "hole on the side of a hill" I start to question if vector displacement is really working, at least in my setup. From the look of it with this angle, I'd expect the hole to have a sharp corner all around, but it has one only at the lower end. The direction of the hill is also off a bit, but I'm focusing on the hole first.
Sorry for any inconvenience!
Edit: That said, in the third picture the "hole on the hill" did clearly appear. So vector displacement must be working. However, in my case it seem to be about 90 degree off or so.
Edit: Think we are close now. Added one more image. The thing with Karma I noticed is that it will not always update source images. You probably should use an incremental number for each updated texture. So I added plane_a1.exr, plane_a2.exr and things started to happen. Probably some tweaks are needed still.
Sorry for any inconvenience!
Edit: That said, in the third picture the "hole on the hill" did clearly appear. So vector displacement must be working. However, in my case it seem to be about 90 degree off or so.
Edit: Think we are close now. Added one more image. The thing with Karma I noticed is that it will not always update source images. You probably should use an incremental number for each updated texture. So I added plane_a1.exr, plane_a2.exr and things started to happen. Probably some tweaks are needed still.
Edited by SWest - Nov. 13, 2022 11:02:30
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
Those "edge" issues, where there is something for each edge on the base mesh, made me go to Mantra using along normal for a while. I just wanted to see what settings will work, especially on the ZBrush side. Maybe Karma will build upon that. For me it looks good enough.
Edit: Added an image with vector displacement (Karma). It is almost good enough. The only visible issue I see is there are some cracks in the mesh. There are no UV borders there.
Edit 2: With those cracks I think I'm stuck. Here's a video for the current setup.
Edit: Added an image with vector displacement (Karma). It is almost good enough. The only visible issue I see is there are some cracks in the mesh. There are no UV borders there.
Edit 2: With those cracks I think I'm stuck. Here's a video for the current setup.
Edited by SWest - Nov. 13, 2022 16:31:27
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
Greetings SWest,
Thank you so so much for the detailed investigation. And thank you for clarifying the colorspace question.
My setup is similar to yours, except I have not added a subdivide in sops land to my mesh. I was using the render properties to increase the dicing attribute, which I think was incorrect. I will try adding the subdivide in sops land and see if that helps, as well as trying the editProperties adn MeshEdit nodes to see if I can push that data to rendertime.
One question I have is this; What is the main difference between using the mtlxImage node and the usdTextrue Node other than the need to feed in a texcord? Is one recommended over the other? Are there use cases for one and use cases for the other?
Here are the tests from my original setup that I forgot to post...apologies for that.
Thank you so so much for the detailed investigation. And thank you for clarifying the colorspace question.
My setup is similar to yours, except I have not added a subdivide in sops land to my mesh. I was using the render properties to increase the dicing attribute, which I think was incorrect. I will try adding the subdivide in sops land and see if that helps, as well as trying the editProperties adn MeshEdit nodes to see if I can push that data to rendertime.
One question I have is this; What is the main difference between using the mtlxImage node and the usdTextrue Node other than the need to feed in a texcord? Is one recommended over the other? Are there use cases for one and use cases for the other?
Here are the tests from my original setup that I forgot to post...apologies for that.
Edited by bryanebentleycgs - Nov. 13, 2022 23:39:29
-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
Update:
Still no closer to a solution. I have attached what my mesh looks like in ZBrush. I know this is a very extreme test.
1. Tried adding a subdivide - Still getting the bubbles. They are smoother, but they are still very there
2. Tried adding a meshEdit to add a subdivision scheme to the geometry - same as above so ... YAY subdivisions work great! #lookonthebrightside lol
3. "Too Close Switching to Guns" ... Tried building just a redshift material in Solaris .... Mayday Mayday Houdini is crashing!!!
Next Steps, Try vanilla redshift and see if that works. It's a shame cus the main reason I am working on this is to practice with lops and USD. If I want to stay in Lops I'll have to retool back to scalar displacement.
LOL, maybe this is why you don't hear peeps talking about vector displacement that much.
Any insights are very welcome, and thank you so much for all the help so far.
Happy rendering all!
Still no closer to a solution. I have attached what my mesh looks like in ZBrush. I know this is a very extreme test.
1. Tried adding a subdivide - Still getting the bubbles. They are smoother, but they are still very there
2. Tried adding a meshEdit to add a subdivision scheme to the geometry - same as above so ... YAY subdivisions work great! #lookonthebrightside lol
3. "Too Close Switching to Guns" ... Tried building just a redshift material in Solaris .... Mayday Mayday Houdini is crashing!!!
Next Steps, Try vanilla redshift and see if that works. It's a shame cus the main reason I am working on this is to practice with lops and USD. If I want to stay in Lops I'll have to retool back to scalar displacement.
LOL, maybe this is why you don't hear peeps talking about vector displacement that much.
Any insights are very welcome, and thank you so much for all the help so far.
Happy rendering all!
-
- jsmack
- Member
- 8173 posts
- Joined: Sept. 2011
- Offline
bryanebentleycgs
1. Tried adding a subdivide - Still getting the bubbles. They are smoother, but they are still very there
2. Tried adding a meshEdit to add a subdivision scheme to the geometry - same as above so ... YAY subdivisions work great! #lookonthebrightside lol
3. "Too Close Switching to Guns" ... Tried building just a redshift material in Solaris .... Mayday Mayday Houdini is crashing!!!
Looks like you have it working in your previous post, the vectors look correct. The problem seems to be dicing. Your displacement is increasing the surface area of small areas by a lot which might require re-dicing to get optimal results. I don't think karma supports redicing though. Brute forcing it by increasing dicing quality quality scale is all you can do.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
Here's a demo render of the vector displacement diagnostics file from ZBrush with separated channels. In my vector displacement renders there are cracks in the mesh from channel 1 and 2 (r,g) similar to what is visible in this diagnostics file.
Maybe I'll just skip vector displacement (until there is a solution to the cracks) with Karma or only use the blue channel (which gives the best result in my tests).
Edit: "ZBrush has an option to Creates diagnostic files based on your export settings in the Tool " Vector Displacment [docs.pixologic.com]
First I was assuming that the diagnostics file does not use the export settings, however the quote sais otherwise. So maybe it is possible to get rid of the cracks by trying some other export settings. Well, that will be for another day or someone else to try.
Maybe I'll just skip vector displacement (until there is a solution to the cracks) with Karma or only use the blue channel (which gives the best result in my tests).
Edit: "ZBrush has an option to Creates diagnostic files based on your export settings in the Tool " Vector Displacment [docs.pixologic.com]
First I was assuming that the diagnostics file does not use the export settings, however the quote sais otherwise. So maybe it is possible to get rid of the cracks by trying some other export settings. Well, that will be for another day or someone else to try.
Edited by SWest - Nov. 14, 2022 16:28:58
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- jsmack
- Member
- 8173 posts
- Joined: Sept. 2011
- Offline
SWest
Here's a demo render of the vector displacement diagnostics file from ZBrush with separated channels. In my vector displacement renders there are cracks in the mesh from channel 1 and 2 (r,g) similar to what is visible in this diagnostics file.
Maybe I'll just skip vector displacement (until there is a solution to the cracks) with Karma or only use the blue channel (which gives the best result in my tests).
Edit: "ZBrush has an option to Creates diagnostic files based on your export settings in the Tool " Vector Displacment [docs.pixologic.com]
First I was assuming that the diagnostics file does not use the export settings, however the quote sais otherwise. So maybe it is possible to get rid of the cracks by trying some other export settings. Well, that will be for another day or someone else to try.
the video is useless, karma doesn't continuously dice the displacement. Pick a camera angle, and then restart karma and don't wildly move the camera without restarting the render.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
Jsmack, the video illustrate the problem. I’ve been investigating a couple of issues several hours.
For your information, redicing is needed for normal directional displacement if you zoom in. Then you can get rid of minor cracks.
However, there is an issue with vector displacement and it's possibly originating from the ZBrush settings. Alternatively something is needed to fix with Karma.
Please do not make quick conclusions like that. You could ask a question.
Edit: Changing displacement scale will trigger an update to the dicing resolution. If you can recreate the problem and have a real solution to that any help would be appreciated. Thank you!
For your information, redicing is needed for normal directional displacement if you zoom in. Then you can get rid of minor cracks.
However, there is an issue with vector displacement and it's possibly originating from the ZBrush settings. Alternatively something is needed to fix with Karma.
Please do not make quick conclusions like that. You could ask a question.
Edit: Changing displacement scale will trigger an update to the dicing resolution. If you can recreate the problem and have a real solution to that any help would be appreciated. Thank you!
Edited by SWest - Nov. 15, 2022 01:20:58
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
Greetings All,
Thank you both for the spirited responses. I have made some progress. I have rolled back to 19.0 from 19.5 as the current build is too unstable to test on. I'll wait till they have some new releases to bump back up.
I got karma and redshift to render maps out of ZBrush. Although they are still not 1to1. The "bubbling," from what I have read, is a limitation of VDMs. I have noticed in those areas in my low res, only 2 or 4 polys represent that area, and they are thin and stretched. All of these things I try to avoid on production meshes. So this may not be that much of an issue, but more of a nuisance.
Swest your video is very helpful in demonstrating how the map is read by a rendering engine. I now know if I have problem areas, I can mask the red and green channels and get back to what I would have with a scalar displacement setup. So that is pretty cool.
jsmack, thank you for the tips about dicing I will defiantly keep that nugget of information for later use.
FYI here are the ZBrush Flip Settings for some renderers I found
Houdini - 42
https://www.sidefx.com/forum/topic/48585/ [www.sidefx.com]
Redshift - 25
https://www.youtube.com/watch?v=qslbtQEYc2E&ab_channel=CGDreamsTutorials [www.youtube.com]
Maya Arnold - 11
https://www.youtube.com/watch?v=xQBqumslsGk&ab_channel=VFXTutors [www.youtube.com]
https://www.youtube.com/watch?v=6wveSeLgJfc&ab_channel=VFXTutors [www.youtube.com]
or 25
https://hapzunglam.wordpress.com/2021/06/09/repost-vector-displacement-zbrush-export-to-arnold-maya-renderman-katana-settings/ [hapzunglam.wordpress.com]
RenderMan - 43
https://rmanwiki.pixar.com/display/RFM24/ZBrush+Vector+Displacement [rmanwiki.pixar.com]
or 41
https://www.youtube.com/watch?v=6tzyrtE-zMs&ab_channel=SmallRobotStudio [www.youtube.com]
I have attached two renders. One from Karma(orange) and one from Redshift(red). There are errors in both due to the above limitation, but they are far less noticeable in the redshift version.
I DO love the lops workflow. It makes way more sense than just having everything smashed into a big soup like we used to do in Maya and Houdini. Hopefully, they will keep improving the system with the coming versions and updates.
Thanks for all the help, this community rocks!
Thank you both for the spirited responses. I have made some progress. I have rolled back to 19.0 from 19.5 as the current build is too unstable to test on. I'll wait till they have some new releases to bump back up.
I got karma and redshift to render maps out of ZBrush. Although they are still not 1to1. The "bubbling," from what I have read, is a limitation of VDMs. I have noticed in those areas in my low res, only 2 or 4 polys represent that area, and they are thin and stretched. All of these things I try to avoid on production meshes. So this may not be that much of an issue, but more of a nuisance.
Swest your video is very helpful in demonstrating how the map is read by a rendering engine. I now know if I have problem areas, I can mask the red and green channels and get back to what I would have with a scalar displacement setup. So that is pretty cool.
jsmack, thank you for the tips about dicing I will defiantly keep that nugget of information for later use.
FYI here are the ZBrush Flip Settings for some renderers I found
Houdini - 42
https://www.sidefx.com/forum/topic/48585/ [www.sidefx.com]
Redshift - 25
https://www.youtube.com/watch?v=qslbtQEYc2E&ab_channel=CGDreamsTutorials [www.youtube.com]
Maya Arnold - 11
https://www.youtube.com/watch?v=xQBqumslsGk&ab_channel=VFXTutors [www.youtube.com]
https://www.youtube.com/watch?v=6wveSeLgJfc&ab_channel=VFXTutors [www.youtube.com]
or 25
https://hapzunglam.wordpress.com/2021/06/09/repost-vector-displacement-zbrush-export-to-arnold-maya-renderman-katana-settings/ [hapzunglam.wordpress.com]
RenderMan - 43
https://rmanwiki.pixar.com/display/RFM24/ZBrush+Vector+Displacement [rmanwiki.pixar.com]
or 41
https://www.youtube.com/watch?v=6tzyrtE-zMs&ab_channel=SmallRobotStudio [www.youtube.com]
I have attached two renders. One from Karma(orange) and one from Redshift(red). There are errors in both due to the above limitation, but they are far less noticeable in the redshift version.
I DO love the lops workflow. It makes way more sense than just having everything smashed into a big soup like we used to do in Maya and Houdini. Hopefully, they will keep improving the system with the coming versions and updates.
Thanks for all the help, this community rocks!
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
bryanebentleycgs
Thanks for all the help, this community rocks!
Yes indeed, I'm inspired by some experts who happily share their hard earned insights.
Hey "bryanebentleycgs", could you please share a screenshot of your ZBrush preferences for vector displacement, and also for the export you are using?
And I have this question, if you zoom in on close ups, and do the redicing thing, have you no cracks at all? (I managed to get rid of them only with one channel displacement)
Thanks for the positive spirits!
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
I am not seeing the "cracking" like you are, but I m not making such a hard-cut hole into a plane. As we get further down the rabbit hole on this, I a realizing we are asking ALOT of this system. lol, these are edge cases for sure. I have to keep reminding myself it's math, not magic.
I have attached the only cracks I can see and my annotated export settings from ZBrush.
Cheers,
I have attached the only cracks I can see and my annotated export settings from ZBrush.
Cheers,
-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
Looks like you have it working in your previous post, the vectors look correct. The problem seems to be dicing. Your displacement is increasing the surface area of small areas by a lot which might require re-dicing to get optimal results. I don't think karma supports redicing though. Brute forcing it by increasing dicing quality quality scale is all you can do.
This is an interesting insight. I am currently setting my dicing to 2 from 0.5 with a rendergeometrysettings node, but the bubbling is still present.
Is this the correct way to change this setting or am I missing something?
Thank you for the insites.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
Thanks bryanebentleycgs,
there is a difference. Our settings are almost identical. However, the 'cracks' on my hill are more obvious with your settings. There are also some movements to the overall curvatures as well.
If you give me any ZBrush file that can be used to recreate the "bubble on peak" issue I'll render it out over here.
Edit: I'm using nr 43 that will reduce my cracks as seen in the image.
The third (rendered) image is vector displacement with blue channel only. It is the "best" I can get so far. I've not noticed any issues with that yet.
there is a difference. Our settings are almost identical. However, the 'cracks' on my hill are more obvious with your settings. There are also some movements to the overall curvatures as well.
If you give me any ZBrush file that can be used to recreate the "bubble on peak" issue I'll render it out over here.
Edit: I'm using nr 43 that will reduce my cracks as seen in the image.
The third (rendered) image is vector displacement with blue channel only. It is the "best" I can get so far. I've not noticed any issues with that yet.
Edited by SWest - Nov. 15, 2022 04:45:56
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
Cool!
Here is a link to the Ztool I've been testing with. It's too big to attach here:
https://drive.google.com/file/d/1JMp5f4yBSQDY3NwCQ5iaeT88elkk9gp6/view?usp=share_link [drive.google.com]
I'll try your settings of Flip = 43 and blue channel only as see what I get.
I will keep you posted here.
Thanks Again!
Cheers,
Here is a link to the Ztool I've been testing with. It's too big to attach here:
https://drive.google.com/file/d/1JMp5f4yBSQDY3NwCQ5iaeT88elkk9gp6/view?usp=share_link [drive.google.com]
I'll try your settings of Flip = 43 and blue channel only as see what I get.
I will keep you posted here.
Thanks Again!
Cheers,
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
jsmack
the video is useless, karma doesn't continuously dice the displacement.
Now, could you please point out the difference in the following images?
In one image, the render began looking from the 180 degree other side. Then, while running the render, it was moved all the way to the opposite side.
For the other image, Karma was restarted.
Now, facts first. As proven in the example images here it is fine to move the camera during rendering. However, in some cases you should trigger redicing of the scene definition. You can do a close-up and then trigger it.
Second, in the video, before moving the camera around I had already done close-ups and updated the dicing. I simply moved the camera away to show an overview.
Thirdly, please don't give a bad attitude. This is not the place for it.
Thanks!
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
bryanebentleycgs
Cool!
Here is a link to the Ztool I've been testing with.
In ZBrush, deleted the lower levels below the one in the image to the right.
Exported vector displacement at 4K.
Used only blue channel (the other give artifacts and cracks).
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- bryanebentleycgs
- Member
- 20 posts
- Joined: Sept. 2020
- Offline
Dope!
Questions:
At what level did you delete lower?
Did you use the tool command or the multimap exporter?
Are you still using switch 43?
It would be cool to see a comparison between a "single-channel vector displacement," as you are doing here and a traditional displacement.
I'll see if I can replicate this on my end.
Thanks a bunch, I'll keep you posted.
Cheers!
Questions:
At what level did you delete lower?
Did you use the tool command or the multimap exporter?
Are you still using switch 43?
It would be cool to see a comparison between a "single-channel vector displacement," as you are doing here and a traditional displacement.
I'll see if I can replicate this on my end.
Thanks a bunch, I'll keep you posted.
Cheers!
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
bryanebentleycgs
At what level did you delete lower?
It is SDiv 5. If you start from level 0 and move up you will see when the major shapes are in place. This "base mesh" is a proxy (approximation) mesh.
bryanebentleycgsThe tool command "CreateAndExport VD Map" (exr) with the same settings as yours.
Did you use the tool command or the multimap exporter?
bryanebentleycgsYes.
Are you still using switch 43?
bryanebentleycgsThis I did yesterday. Back then I had an issue with the rounding at the base of the hill when using traditional normal displacement. However, I'd need to revisit that and tweak to be convinced about it.
It would be cool to see a comparison between a "single-channel vector displacement," as you are doing here and a traditional displacement.
A side note. I'm mainly focusing on character workflows with a strong ZBrush to Houdini workflow and for that single channel displacement will be enough as long as there are no artifacts. That is why this topic concerns me a lot.
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- Quick Links