Rotating Normal Maps in Unreal Engine

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ • 55

  • @TechArtAlex
    @TechArtAlex  Рік тому +5

    Another way to find the perpendicular vector @ 7:00 would be to just use the (Y, -X) of the first vector as the (X, Y) of the second rather than offsetting the Sin & Cos. It comes to the same instruction count, but generally it's best to minimize the use of trigonometric functions in materials as they are relatively expensive compared to other math.

  • @seewenhan
    @seewenhan 11 місяців тому +3

    thank you for this essential tutorial :)

  • @Mr_Dee
    @Mr_Dee Рік тому +2

    Your explanations are so crystal clear and easy to understand. Love it!👍🏻

  • @rzaman-gg6en
    @rzaman-gg6en 5 місяців тому +1

    Very helpful tutorial! This is how more UE5 tutorials should be;
    it makes it so simple that it should really be in UE5 by default for how important, common, and easy-to-miss this issue is.

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

      Thanks! It turns out there is a pre-made node that you can use, called "custom rotator" that does this - But I think it's still good to know the how and why behind it anyway.

  • @Psikais
    @Psikais Місяць тому +1

    Amazing video! Thank you!

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

    Thank you very much for this awesome tutorial !!

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

    Nicely done, though I'd need to watch this a few hundred more times before I'd able to reproduce it adhoc.

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

      Turns out this is more or less what you'd find inside the premade "custom rotator" material function so you probably won't need to create the node setup from scratch normally - but I do think it's still important to understand the how and why it works and why it matters.

  • @UnrealEngine_Master
    @UnrealEngine_Master Рік тому +1

    man, thanks a lot! your tuts are pure gold!

  • @paulmroczek
    @paulmroczek 7 місяців тому +1

    Dear Sir! I struggle a lot. Do You know how to make a rotator inside POM material? There are some problems like the Height map and normal direction, and there is not much info about rotation Parallaxa in internet.

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

      Yes, you would need to alter the node as seen here.
      forums.unrealengine.com/t/proper-way-to-rotate-a-pom-parallax-occlusion-mapping/384661

  • @Cloroqx
    @Cloroqx Рік тому +1

    Super cool video, mate. Happy holidays!

  • @MonsterJuiced
    @MonsterJuiced Рік тому +1

    Would you recommend learning trigonometry for understanding shaders?

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      At the very least I think it's valuable to fully understand the unit circle, and the basic relationships between Sin, Cos and Tan of a triangle. This will help a lot when dealing with all sorts of problems.

  • @MonsterJuiced
    @MonsterJuiced Рік тому +1

    lmao, I never even considered this. Nice one thanks for showing us :)

  • @stephananemaat
    @stephananemaat Рік тому +1

    Quixel seem to have their own setup in the megascans master material (in the MapAdjustments material function), does the setup they use achieve the same result as what you've achieved here? Thanks very much

    • @TechArtAlex
      @TechArtAlex  Рік тому

      Yes. They are using another custom rotator node to rotate the RG channels of the normal map inversely from the base rotation. Inside the custom rotator node, the math is essentially the same as what I built here. Results and performance should be identical.

  • @esk6a
    @esk6a Рік тому +2

    Fantastic! Thank you sir!

  • @namesurname624
    @namesurname624 6 місяців тому +1

    how do you move the light inside the viewport at 1:00?

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

      Hold down L and then click and drag.

  • @inversus1733
    @inversus1733 Місяць тому

    Thank you very much for the tutorial, but I don't understand what for "Add" node between "RotateAboutAxis" and NormalMap ?

    • @TechArtAlex
      @TechArtAlex  Місяць тому

      I can't remember the mathematical reason off the top of my head, but I know that it will not work if you don't add them together.

  • @chucknavarromark
    @chucknavarromark Рік тому +2

    Extremely helpful, thank you!🙂

    • @TechArtAlex
      @TechArtAlex  Рік тому

      Happy to help, thanks for watching!

  • @JakeTheHuman11
    @JakeTheHuman11 Рік тому +1

    Firstly, thank you so much for this incredible tutorial, it was extremely helpful as I couldn't find info on this anywhere else. But after watching and reflecting on it I still have a question. Why do normal maps ""turn around"" when multiplied by -1 instead of turning black like a regular texture would do?

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      Because normal vectors are in -1 to 1 space. Instead of thinking of normals as colors, think of the RGB values as a position in a 3D space which the normal vector points towards.

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

    What's the purple "Axis" node during the 3D portion? Still learning nuances of UE5 shading...

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

      It is a named re-route node. Basically allows you to take an input and name it like declaring a variable, then recall that name. It just makes the node graph less spaghetti.

  • @unumpolum
    @unumpolum Рік тому +1

    Well done. Thank you.

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

    3D rotation works great for a single axis, but how to sum rotations across multiple axes?

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

      The best option is probably to combine the two rotational axis into one first, then apply the rotation after the fact using the combined axis.
      normalize((Va + Vb) / 2 )
      This will give you a new vector halfway between both axis to rotate around.

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

      @@TechArtAlex Yeah, combined axis is a very good choice for uniform rotation, but non-uniform rotation does not always work correctly due to the influence of components on each other. With vertices it's easy to create a chain of sequential actions to solve this problem, but it doesn't work with normals.
      Or maybe I'm missing something by trying to bring the rotation vector to the combined axis.

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

      If I'm understanding your issue correctly, you would need to use the formula for compositing two axis-angle rotations or use quaternions. The former will allow you to input not just two rotational axis, but also two angles and effectively apply them sequentially into a single outcome. The latter allows the rotations to be combined via simply multiplication, but for that you would use the formula to convert axis-angle to quaternions, and then back again.

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

      @@TechArtAlex Yes, compositing two axis-angle rotations is what I needed. Thanks a lot for the tip!

  • @devjitpaul1191
    @devjitpaul1191 Рік тому +2

    I chose to be a 3D artist to escape from math, wtf!! lol, wish i paid more attention at math classes, i hate math. but this level and quality of information is very hard to come by for free, thanks for sharing

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      There is no escape from math I'm afraid. Thanks for watching!

    • @devjitpaul1191
      @devjitpaul1191 Рік тому +1

      @@TechArtAlex math can be fun, yeah, when the results turn out good like this, it is satisfying, schools make math a chore. It's getting interesting making shaders.

  • @hakeemadam955
    @hakeemadam955 Рік тому +1

    Great video but it is really difficult to see the nodes on your graph clearly.

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      I'll keep that in mind and try to zoom in more in the future. Thanks!

  • @YuuJer
    @YuuJer Рік тому +1

    nice vid! more math vids!

  • @FishMan1nsk
    @FishMan1nsk Рік тому

    Why do you even want to rotate something in the shader? AFAIK its expensive AF...

    • @TechArtAlex
      @TechArtAlex  Рік тому +4

      Rotating in the shader is not expensive, because it is done purely on the GPU. Rotating an object outside of the shader requires both the CPU and GPU to do what the GPU could've done by itself. There are lots of cases where you might want to rotate in the shader, for example to reduce tiling on a landscape material. Some of these cases would be impossible to do outside of the shader.
      All that said. there are exceptions, and every project is different. Thanks for watching.