Parallax Occlusion Mapping Decals (Using Custom Decal Response) UE5

Поділитися
Вставка
  • Опубліковано 27 вер 2024
  • Many have wanted to use POM and decals together to add details to an object or environment, only to find that the built in node breaks if it is rotated in any way - making it unusable as a decal.
    This is because POM relies on mesh tangents to render correctly, and the decal cannot sample them. In my last video, we learned how custom decal responses could be used to allow working tangent space normal map decals. Using the same technique, we can give POM the tangents it needs by offloading the POM to the underlying mesh material, and viewing decals as a vessel for general purpose data.
    How to rotate POM:
    forums.unreale...

КОМЕНТАРІ • 59

  • @Brudiz
    @Brudiz 11 місяців тому +2

    Hi, Alex. Actually, POM decals can be unsensitive to tangent without blueprint implementation, just by modifying function itself. I provided this solution in last video by link in the comments

    • @TechArtAlex
      @TechArtAlex  11 місяців тому

      Your function is quite good. But without the true smooth mesh tangents, I did notice much more distortion on curved surfaces. Perhaps this is not such an issue since POM is best avoided on curved surfaces anyway. But regardless, I was able to combine the two techniques for the best of both worlds.

    • @Brudiz
      @Brudiz 11 місяців тому +1

      @@TechArtAlex Nice to hear that, thanks for your responce

    • @bartkoch1988
      @bartkoch1988 11 місяців тому +2

      @Brudiz could you provide the link again? I can't find it.

    • @Brudiz
      @Brudiz 11 місяців тому

      @@bartkoch1988 drive.google.com/file/d/1Gt8qx6Naq6iDpXFm1YPcmz76nKsWekxN/view?usp=sharing

    • @yarbone7
      @yarbone7 21 день тому

      @@TechArtAlex Could you explain the technique used? Brudiz' I can't seem to find the video that Brudiz is talking about. Thanks

  • @MIKELENZTIPS
    @MIKELENZTIPS 8 місяців тому +1

    I was wondering if this was possible the other day! Thanxxx for outlining!

    • @TechArtAlex
      @TechArtAlex  8 місяців тому

      Sure thing, thanks for watching!

  • @monsterhunter9748
    @monsterhunter9748 4 місяці тому +1

    Hey, idk if I missed anything super obvious, but I can't seem to get this method to work with sampling different decals for the same receiver. My idea would have been to pass some sort of id from the decal mat instance to the receiver which then switches the decal by offsetting the UVs on an atlas, but I haven't found a way to actually achieve that.. at this point I feel like this would start to just cost too much performance since our master material is already quite heavy, but I'd be curious if you had any ideas

    • @TechArtAlex
      @TechArtAlex  4 місяці тому

      That should work just fine, and is basically what I show at 3:30. The decal is passing an index value to the base material, which offsets which part of the atlas is sampled, but could also alter anything else as needed.

    • @monsterhunter9748
      @monsterhunter9748 4 місяці тому +1

      ​@@TechArtAlex bruhh you even showed the setup already :(( thanks for pointing it out again tho. Guess I'll just have to fix the rotation center and it should be done

  • @vaillecgart1854
    @vaillecgart1854 11 місяців тому +1

    Amazing ! Thanks again for sharing ! I will try this soon. The previous Triplanar video blend pre sampling technique turned out to be great for my custom Texture Bombing system ! Really appreciated man

    • @TechArtAlex
      @TechArtAlex  11 місяців тому +1

      Glad to hear- Thanks for watching!

  • @Hellwalker855
    @Hellwalker855 10 місяців тому

    Is it possible to have another material on the receiver or control the opacity of the decal? Seems like the use cases are limited.

    • @TechArtAlex
      @TechArtAlex  10 місяців тому +1

      You would control the opacity just by using a lerp in the underlying material. In my example, I faded the edges radially using the UV coordinates, but you could also use an alpha texture or even the height map.
      You can't use the opacity of the decal material, because it pre-multiplies the other outputs which will mess up the data. You can un-multiply it, but I found it to be too inaccurate.
      The underlying material works just like normal, beyond the altered response to the decal. It can be anything. The method should not limit usage in any way, since you have complete control over how it responds to what decals.
      In fact, the opposite is true. Not using custom decal response workflow is limiting, because previously the only control you had was to receive all decals or receive none.

    • @Hellwalker855
      @Hellwalker855 10 місяців тому +1

      @@TechArtAlex Thanks for the reply. I think I figured it out. A lerp was all that I was missing. Thanks again.

    • @TechArtAlex
      @TechArtAlex  10 місяців тому

      @@Hellwalker855 Sure thing, thanks for watching!

  • @buffalosoldier-br1mi
    @buffalosoldier-br1mi 4 місяці тому

    is this game performant thats my question

    • @TechArtAlex
      @TechArtAlex  4 місяці тому

      It really depends on how you configure the settings for the POM. The same best practices apply here as when using POM anywhere else.

  • @angrygamer1822
    @angrygamer1822 4 місяці тому +1

    so much fucking yapping

  • @islingtonbel
    @islingtonbel 11 місяців тому +1

    hey, Alex, great tutorial! Really appreciate your POM series. But I have an issue with really bad ghosting/shadowing effect around my character when he runs over POM or Tessellated floor or stands next to POM/Tess wall. it somewhat goes away if I add strong light source nearby, but I can't use this trick everywhere. any ideas what causes this? Thanks again!

    • @TechArtAlex
      @TechArtAlex  11 місяців тому +1

      Ghosting issues are almost always a result of bad motion vectors combined with TAA / TSR.
      POM is prone to messing up motion vectors unless you use Pixel Depth Offset. Unfortunately it is impossible to use PDO with POM decals. Keeping the displacement levels very low will reduce ghosting too. Tesselation doesn't normally have that problem though, so I'm not sure why that would be happening.

    • @islingtonbel
      @islingtonbel 11 місяців тому +1

      thank you! @@TechArtAlex

  • @Hotrood999
    @Hotrood999 11 місяців тому +1

    Amazing video!
    May I ask how did you do to place the decal aligned perfectly to the surface normals of the meshes at the beginning of the video?

    • @TechArtAlex
      @TechArtAlex  11 місяців тому +2

      In the top right of the viewport there is a snap to surface setting, which also has a toggle for aligning the selection to the surface normal. Very handy for decals.

    • @Hotrood999
      @Hotrood999 11 місяців тому +1

      Thank you!

  • @МаксимЩемелев-ч2д
    @МаксимЩемелев-ч2д 9 місяців тому +1

    Hi, Alex. Can you give some arbitrary e-mail address where I can send my question with pics about the POM-Decal? I made the Decal as in your actually very good tutorial but it is pixelated and the parallax effect is not correct either. Changing different Parameters won’t help. I tried to make it in a substrate material but I don’t think that there should be a problem.

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      If it is still pixelated try dividing and re-multiplying the UVs by a higher number than 8 (like 128). This should reduce the banding issue I showed even further.
      As for incorrect parallax... Check that the decal is oriented correctly. Unless you modify the POM node, the decal tangent must be aligned with the surface tangent.
      I don't have a public email set up yet for the channel but that's a good idea. I'll set one up later today - let me know if you're still struggling and I'll link it.

    • @МаксимЩемелев-ч2д
      @МаксимЩемелев-ч2д 9 місяців тому

      @@TechArtAlex
      Alex, I had a Mask node set to a wrong channel (receiver material) but after correction it helped not much. I’m sure I made some mistake but where, no clue. My English is very weak, this is the reason why I wanted to explain maybe with screenshots.

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      @@МаксимЩемелев-ч2д
      I set up techartalex.yt@gmail.com

    • @МаксимЩемелев-ч2д
      @МаксимЩемелев-ч2д 9 місяців тому

      @@TechArtAlex
      Alex, I have send to you an e-mail but got no response.

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      @@МаксимЩемелев-ч2д Okay, I sent a response now.

  • @pauljojo1318
    @pauljojo1318 9 місяців тому +1

    Can the "Rotate POM" be modified to leave the shadows coming from the right angle (sun vector or whatever)?

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      Yes, but It would probably be easier to just counter rotate the sun vector, like we do with the normal map.

    • @pauljojo1318
      @pauljojo1318 9 місяців тому +1

      ​@@TechArtAlex I tried to achieve this all day :D Couldn't figure out how to rotate a vector in the material editor (without higher trigonometry).

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      @@pauljojo1318 There isn't really a general purpose way to rotate vectors without trig. The rotate about axis node is the simplest way to rotate a 3D vector by axis and angle, but it's doing trig under the hood.

    • @pauljojo1318
      @pauljojo1318 9 місяців тому +1

      @@TechArtAlex I tried to hook them up in the right way for a while. There seems no tutorials on rotating a vector in mat - only WPO. A hint on how to hook the sun light vector up with the rotate about axis node?

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      1) I'd probably use the -(vertex normal) for the rotation axis.
      2) Use the same -(rotation angle) as with the normal map.
      3) Pivot point is (0,0,0) when rotating a vector.
      4) Position will be -(light vector).
      5) Then, add the output back to your original position aka -(light vector).
      6) Use this as the input for your POM light vector.

  • @alinarangi7826
    @alinarangi7826 7 місяців тому

    Hi Alex, thanks for your tutorial, I have a question, I'm new to Unreal and I want to make game assets, if I use POM in my assets they may cause performance issues. your tutorial was advance for me, and i don't understand lots of things. thanks in advance

    • @TechArtAlex
      @TechArtAlex  7 місяців тому

      It really depends on how you set it up. POM can be fairly cheap or extremely expensive depending on the heightmap resolution, texture filtering settings, sample count, etc.

    • @alinarangi7826
      @alinarangi7826 7 місяців тому

      @@TechArtAlexthanks for reply, can you please guid me to make a nice and cheap POM? the setup of this tutorial is cheap or expensive? you know man, i think about modular set and use POM decals for them

  • @pauljojo1318
    @pauljojo1318 9 місяців тому +1

    Very cool. Does this work with textures too? So having a texture instead of grey and just "parallaxing" (so to speak) that texture with the decal?

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      Yes, you can either lerp to a different texture that samples using the POM UVs, or you can offset the main material's UVs by the POM offset amounts.

    • @pauljojo1318
      @pauljojo1318 9 місяців тому +1

      @@TechArtAlex Hmm problem is, the texture gets only displayed where the decal is. Everywhere around it's just having it's base color (brown for mud).

    • @TechArtAlex
      @TechArtAlex  9 місяців тому

      @@pauljojo1318 the POM node has an "offset only" output that can be combined with other UVs, rather than using the POM UVs alone.

    • @pauljojo1318
      @pauljojo1318 9 місяців тому +1

      @@TechArtAlex I tried to use them to only offset the Material but the result is weird. Have you made it work?

    • @TechArtAlex
      @TechArtAlex  9 місяців тому +1

      ​@@pauljojo1318
      Hm the offset only output does not seem to be working as intended. Instead, manually subtract the original decal UVs from the POM UVs to get the correct offset amount. Add this to the texture coordinates instead.
      You also need to make sure the offsets are scaled properly to account for the difference in scale of the decal Uvs and the base material UVs.