Home Technical Talk

Vector Displacement Maps and Bit Depth

greentooth
Offline / Send Message
Sebvhe greentooth
Hi guys,

I'm playing for the first time with vector displacement maps. To keep it simple, I made a VDM of ocean waves in Maya and used the .exr to displace a plane in UE4. The reason I'm using VDMs rather than heightmaps is because I want to play with horizontal displacement as well.
So everything looks fine in UE4, no issues with that.
My map looks like this :

 

What bothers me is that I have to use a 32bit exr map to make it work, I feel like I don't need that precision (and massive file size). Furthermore, I'd like to edit my VDM in Photoshop to try things out, but you have almost no control on a 32bit image.

This leads to my question, how could I convert a 32bit image to a 16 or 8 bit without having to deal with tonemapping that completely ruins the information? I pretty much want to keep one value every 65536. This doesn't seem like a big deal to me, but I can't find a proper way to do it.
If in UE4 I just compress the picture to DXT rather then HDR uncompressed, I think it just clamps values above/below 0-1, so everything is mostly flat. I could be wrong though, I'm pretty novice to such matters.

I must admit I don't really understand how VDMs work and what I actually see in that texture means in terms of displacement, I just know there is no reason to have 4,294,967,296 colors in it when you displace a slightly subdivided plane.

Hope it's clear, I feel my explanation is a bit messy 
:p 
Thanks for your help :smile:

Replies

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    The colors represents directions. Positive and negative x,y and z. Not literally negative value in the texture itself but it describes positive and negative displacement on the 3 axes.

    The bit depth, imagine it like this:




    On this image, I'm showing how some wave displacement bake would look like on 16 and 32 bits bit depth. In case of a non moving object, this might be totally fine but when its a moving texture and you don't have enough geometry density, you might start seeing some stepping in the movement, as the steps of the values slides across the vertices.

    Vector displacement is only required if you want movement other than local normal z axis. So like if you would want to have overhanging waves.

    When you use a 8 bits vector displacement map, it means you have 256 values per axis to describe the displacement. So then you have 128 different value for each positive and negative axis. That clearly isn't enough even when its not a moving thing. 
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Great explanation by obscura. A vdm is like a normal map texture in that it is xyz to RGB data encoded in the file. They are generally used with a subdivided mesh.


    From PIXAR:
    Vector maps are 32bit colour files which are used to perform accurate vertex displacement.

    This 3d displacement can even overhang other surface points in the model. This has not been possible with traditional displacement mapping, which uses a greyscale "heightmap" approach, where points are displaced along a fixed normal.

    Vector maps contain information on the direction and amount a surface point should be moved. 




  • Sebvhe
    Offline / Send Message
    Sebvhe greentooth
    Thanks a lot guys!

    So my understanding of VDMs was pretty okay in the end, what confuses me a lot, and is probably the reason of my problems is that if I take only one channel of my map let's say the Red for instance I get this. Unlike normal maps/heightmaps it´s really hard to understand what is going on.



    As you can see a lot of the values are plain black/white. I'm assuming that's because Photoshop doesn't show me the full range not because these values are clamped to min/max, right?

    But I also think it's the reason I can't accurately convert my 32bit map to a 16bit. How would you do that properly?
    16bits is definitely enough for my needs, and I even think 8bit could be fine too, I just want to find a way to try it....

  • Burpee
    Offline / Send Message
    Burpee polycounter lvl 9
    I'd do this in Nuke, ( or natron ) because as you say photoshop clamp the viewport value. ( at least for me ) 
    You just want to move your blackpoint until your mid value is set to 0.5, then you'll be able to use it as a 8 or 16bit map
Sign In or Register to comment.