Parallax Occlusion Mapping Magic

  • Published on Jan 18, 2018
  • GamingGaming

Comments • 34

  • Fotenks
    Fotenks 3 years ago +39

    I've always loved this effect. Why isn't parallax occlusion mapping used more in games?

    • Thri _
      Thri _ 2 months ago

      GTA 5 Uses it for their grass

    • cyrez2402
      cyrez2402 3 months ago

      POM isn't expensive in terms of perfomance lol. In modern games it replaced with tesselation shaders and displacement mapping. The main issue of parallax mapping is it works good only on flat planes, on curved surfaces it looks really terrible. But displacement mapping hasn't this issue, it looks good on any kind of surfaces.

    • Juho Joensuu
      Juho Joensuu 5 months ago +1

      Plain and simple, performance. The very first thing when making such a feature is a button to disable it in options :)

    • Soundhunter
      Soundhunter 7 months ago

      @SantiTab Navascues So would you recommend to go with a higher vertex count and use tesselation over pom?

      OPENWORLD GAME DEV JONTY[IN] 10 months ago

      @SantiTab Navascues THANKS FOR THE INFO ..!! I AM NEW .. : -)

    AUTUMN WIND 2 years ago +4

    Very nice work!
    Can you help me to learn about Parallax Occlusion Mapping workflow?
    I can create everything, I mean I can create model like this, bake the low poly and texture it.
    But I can't find information about Parallax Occlusion Mapping workflow.
    How it was done, is this height map from ZBrush maybe, with color map to separate parts, and then you are going to Substance Painter or Designer?
    Is the Parallax Occlusion only possible in Unreal Engine?

    I see steps like this.
    1. 3d model in 3d software like Modo, 3ds Max, Maya or other...
    2. Import model to Zbrush and create the height map for it with color map.
    3. Import to Substance Painter and create textures
    4. Unreal Engine final render.

    But I'm missing the baking process for flat surface like this, this is flat plane right?
    How to transfer the height from the Hi Poly model to flat surface?

    This guy said long time ago that he will share the workflow, but he never did.
    I can create model like this, with all od the detail, but in normal way, I mean normal low poly topology.
    I simply don't undestand how the Parallax Occlusion Mapping is created.

    Help me please!

    • Remon
      Remon 2 years ago +1

      @Daedalus MJ12 have you guys made it work ? its an interesting discussion to read. Personally I haven't looked into the vertex normals affecting the POM but it makes sense. I got it too work fairly well using the POM node and plugging in the heightmap and normals but im not entirely sure im doing it correctly.

      AUTUMN WIND 2 years ago +3

      @Daedalus MJ12 I woke up today morning, I have read your reply, and I finally understand that Parallax Occlusion Mapping workflow is the same as for normal map but with HEIGHT map involved.
      I have pretty good knowledge about normal map baking.
      Anyway I did another test model, please have a look.

      This time I used "GrabDoc" in ZBrush to generate Normal Map and Displacement/Height map. Then I baked the rest of the maps from the normal made in ZBrush in Substance Painter so I could make some textures with procedural effects.

      So now about artefacts. From what I see you can't create Hi Poly model with perpendicular height I mean you need a bit of angle on the model to make it work well.
      As you can see on test model (last two renders) I have some artefacts after I used Parallax Occlusion Mapping. The texture is stretching, so for the best effect, you have to avoid straight extrusions.

      Or maybe youn know a better way to avoid the distortion?

      Now about vector displacement, yes I agree, it's just insane, I'm searching for tutorial as well. But is nearly impossible to find a tutorial for it.

      What I know about it.

      If you want to create Vector Displacement for 3ds Max and Vray, you have to use the MUDBOX, it's impossible to create vector displacement in ZBrush for 3ds Max.

      But still is possible to use ZBrush, you can import model from ZBrush to MUDBOX, and create projection from Hi Poly model made in ZBrush.

      I found only these videos where you can see how does it work.

      And this is the rest of information I found, but still I did not manage to make it work.

      Maybe we can make it work together :),topicNumber=d30e8078

      I'm from Poland.

    • Daedalus MJ12
      Daedalus MJ12  2 years ago +2

      @AUTUMN WIND Oh.. this video is not mine. I once found a link on it on some russian resource and saved it. And when I found through years the video by link doesn't exist anymore, I decided to upload the saved one to youtube. Some guy made a shader in Cryengine. And it's quite advanced parallax, with self-shadowing, and almost no artifacts. As I told before, I used to play around with simple Unity parallax shaders (Alloy Shader Framework), and it eats just heightmap for work. I suppose there is no difference with the one shown in video.
      As far as I understood from your questions - you haven't ever baked normal maps from hipoly to lopoly, don't u? The principle of "3d shape transfering" is the same. U can bake one in substance painter, just load lopoly, and press "bake maps", there will be a place for hipoly.
      XNormal do the same. It creates virtual "cage" around lopoly (u can make one with projection modifer in 3dmax), and then this cage gather hipoly micronormal information from hipoly, coding it to colors. Red and Green channels are used to code the polar coordinates of normal vectors, Blue channel represents perpendicular/parallel info and builded automatically from R G channels. Google for "baking normals in substance" "normal mapping workflow" or smth.
      Also, I can't find time for checking out a principles of working of "vector displacement mapping", which is more advanced parallax method I have no idea how to bake textures for. And I've never seen shaders to play with. Mind be more mindblowing.
      P.S. I'm from Russia. Where r u from?

      AUTUMN WIND 2 years ago +2

      Thank you so much for your long response I found it very helpful!
      I did understand now that Tessellation is working just like subdivision for displacement, to project detail from height map in to the surface.

      I have a question at this point, do you think it is possible to use the same height map as displacement in Vray?
      I'm not sure, but I think it can be possible.

      Yestarday I was fighting with it, and I found that you can render the Parallax Occlusion Mapping in Marmoset Toolbag. Also it is possible to use preview of your displacement in Substance Painter. To activate it you have to add DISPLACEMENT channel then go to the shader settings TAB and activate there Parallax Occlusion Mapping. It's not real Parallax Occlusion Mapping, just a smart trick which helps you a lot when you are painting height information around height information. So for example you can stamp your height detail, and paint rust around it, and you will be able to see how the first layer is working with painted rust, very cool!
      So this is my test from yestarday.

      I noticed that Parallax Occlusion Mapping is working much better on flat surface.
      How I did it.
      1. Decal in 3ds Max
      2. Import to ZBrush and grab the heigh map.
      3. In Substance painter I stamp it on the model, and added some details.
      4 Imported to Marmoset for render.

      I'm on the right path to finaly understand how does it work.
      I was waiting a long time to undestand this process, I mean if you don't know the steps is very hard to find solution.

      Ones again, thank you so much for your help!
      If you don't mind I will come back if I find a problem on the way to master the Parallax Occlusion Mapping :)

      I nearly forget, I have very important question.
      How do you create textures for flat surface like on your model.
      The height map is just a projection from the top to bake the detail from high poly, but the Hi Poly model is ofcourse a 3D shape with UV coordinates for every single part of your model.
      How to transfer 3D texture to the flat surface like this, how "the flat surface" will undestand UV coordinates from 3D Hi Poly model?
      Do you bake it at the end somehow the texture to the flat surface?

    • Daedalus MJ12
      Daedalus MJ12  2 years ago +5

      As far as I know parallax or tesselation shaders in UE4 or Unity needs a heightmap on input.
      I tried it only for terrain tiled textures, generated in Substance Designer. Applied one of them on sphere and parallax with tesselation worked well. Tryed it on default cube - and it was broken, because of the vertex normals on default cube, they needed to be smoothed to make effect (it's when one vetrex has one normal, not separate three as with default engine cube).
      This means, that parallax aslo uses vertex normals to work correctly on corners for exapmle. On the Window AC Unit Low Poly Asset, provided by your link on artstation, u can turn on marmoset viewer, and look at topology layer. U can see that the guy used chamfers on the edges, which not only was made for the model to look better on edges, but for correct work of parallax. Pay attention its not just a chamfer, but there are also the "subdivision support loops" near the edges. This was made to make the suface with parallax to have vertex normals, pointed in same one normal direction, and they begin to change direction only from near-edge loops to chamfer loops.
      This ensures your parallax will work correctly in bounds of one model, shader and texture, and there will be no need to brake in on separate materials.

      Next.. baking process. U can google "generate heightmap from hipoly", or "heightmap from normal map".
      Making heightmap in Zbrush by color looks like perverison, so u can bake it many ways. If approximate heightmap is enough - u can use easy conversions from normal maps (Bitmap2mateial, Substance Designer in one step, nodes be like like input-convert to heightmap-output). If u need correct distribution of height, bake it from hipoly to lopoly in bakers like xNormal.
      There are also many tuts on blender, maya, 3dmax and others for this procedure.

      And the main aspect. Parallax Occlusion is made basically for games. I first saw it in S.T.A.L.K.E.R. on brick walls and ground assets, then remember it on stairs in ME1, next seen it in FarCry3, e.t.c. It's rather expensive (performance cost) tech, as if u need good quality - u need more samples to flee the artifacts on critical angles of camera.
      So u need a good render programmer to write and optimize it in your game.
      If u dont have one - the only way for u to use it is just for playing around to learn.
      In cinema or static renders there is no need to use it - it's much easier to render subdivided model with polygonal details, which will be more realistic. Parallax is approximation, and used for polycount economy.
      It was rather actual when GPUs couldn't handle high polycount, but now they are multicore, so a modern bottleneck lies in shaders and textures. Tesselation also made it deprecated.
      It's still good for use only in terrain textures, and special cases. Devs cant afford themselves to use it everywhere.

  • BadFactor
    BadFactor Year ago +3

    want to know if this texture is a 8 bit and how big is the resolution???

  • nutzeeer
    nutzeeer Year ago

    does this use less resources than polygon objects? i like to think so. is there a way to automate parallax occlusion mapping?

    • Daedalus MJ12
      Daedalus MJ12  Year ago

      in this case - no.. its too expensive, because its with shadows, to many parallax steps, ultra high res textures.. For games parallax and tesselation are always a great optimization struggle. Some time ago it was able to burn your gpu. Google "parallax optimization tips" or smth.

  • Акылбек Талипбаев

    Amaizing! tutorial please!!!

  • SledgeNE
    SledgeNE Year ago +1

    Awesome Effect.

  • Pipe C
    Pipe C Year ago +5

    So parallax mapping is adding a 3d shadow to a plane texture right?

    • Heath Mitchell
      Heath Mitchell 4 months ago +1

      No, it’s adding parallax (things close to you moving more than things far away)

  • Termozoid
    Termozoid Year ago

    How did you do it so well? In my case it looks shit

  • mashOnoid
    mashOnoid Year ago

    This is better than pornhub xD so satisfying. Love it.

  • Juris Perkons
    Juris Perkons 2 years ago

    Hmmm. Interesting...