Hello,
Does anyone know if vector displacement maps are supported in materialx/karma? It appears to be according to the documentation. It says:
"(Float or Vector3) If Float, scalar displacement amount along the surface normal direction. If vector3, Vector displacement in (dPdu, dPdv, N) tangent/normal space."
I have no trouble with regular displacement maps. I am trying to use the vector displacement maps that you export from the ocean evaluate sop. (the reason I am doing this instead of the karma ocean lop is because that doesn't work with xpu).
The first image is the just a render with no displacement. It is the output of the ocean spectrum. So this the "ground truth". When I add displacement to a flat grid it should match this.
The second image is if I use my vector displacement map. See how it is flat and definitely not correct. If I scale the displacement it looks strange.
I read somewhere that vector displacement maps can be read xyz or xzy. So the third/fourth image is if I swap the y and z components of the vector. The result is almost perfect. You probably can't tell unless you are toggling back and forth, but the displacement heightwise (in y) is prefect. But its a bit off in the x and z slightly.
I should mention this works in mantra with the principled shader. If I set the displacement texture to vector and space to world or object space (not tangent).
Any tips/suggestions?
vector displacement materialx
1814 5 1- evanrudefx
- Member
- 208 posts
- Joined: Feb. 2016
- Offline
- tamte
- Member
- 8449 posts
- Joined: July 2007
- Offline
- evanrudefx
- Member
- 208 posts
- Joined: Feb. 2016
- Offline
tamteOh, if it expects tangent space for vector displacement, then it probably won't work 100% because I believe the ocean spectrums output is either object space or world space. If I use mantra to render this grid and set to use vector displace and use object space it works. But it doesn't work in tangent space.
try: +x -z +y
I mean just guessing, but since it looks like that mtlx displacement expects tangent space vector and I assume your UVs are aligned along +x and -z, and N points in +y, it could in theory work
Thanks,
Evan
Evan
- tamte
- Member
- 8449 posts
- Joined: July 2007
- Offline
As I mentioned since your grid and UVs are aligned with world space you should be able to find matching tangent space just by shuffling the axes
Did you try what I mentioned?
If it didn't work it may be different axes/directions but should be easy to find match
Did you try what I mentioned?
If it didn't work it may be different axes/directions but should be easy to find match
Edited by tamte - Aug. 28, 2022 23:29:13
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- peytonbbair
- Member
- 1 posts
- Joined: Aug. 2022
- Offline
- evanrudefx
- Member
- 208 posts
- Joined: Feb. 2016
- Offline
tamte
As I mentioned since your grid and UVs are aligned with world space you should be able to find matching tangent space just by shuffling the axes
Did you try what I mentioned?
If it didn't work it may be different axes/directions but should be easy to find match
It was more off than my default settings of xzy. Everything I do is close, but nothing is perfect. It should be good enough,however.
Thanks,
Evan
Evan
-
- Quick Links