Your Triplanar is wrong. Here's how to make one that works. [UE5]

Поділитися
Вставка
  • Опубліковано 3 лют 2025

КОМЕНТАРІ • 102

  • @TorQueMoD
    @TorQueMoD 10 місяців тому +18

    Damn! You must be the best shader programmer working in Unreal Engine right now! Well done sir!

  • @simulacrumgames
    @simulacrumgames 11 місяців тому +27

    9:43 This is what real programming looks like 😆
    Man I love watching people put in the effort to do stuff the *right* way!

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

      man got gaslit on what left and right was

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

      So true! Also you'll get the 'best" ideas when you can't try them out: Eurikaaa! But then, you try them out: yep, nope...

  • @ZappForThat
    @ZappForThat 11 місяців тому +28

    Lol me sitting here doing the vector finger pointing bit, only to look back at my screen to see footage of you doing the same 😂
    Thanks for adding that note-it helped me feel better abt not *just* knowing the math.

    • @VisualTechArt
      @VisualTechArt  11 місяців тому +7

      We all struggle with that xD

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

      Came here to make pretty much the same comment haha

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

      Modular c++ code

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

      9:33 The story of every graphics programmer. =P

  • @NasteXify
    @NasteXify 11 місяців тому +6

    I really appreciate you posting these videos. There are so many small and big things that one can learn and apply, not only in the context of the video but also in other areas. This was incredibly helpful and informative, just like all your videos always are! The normal axis finger pointing thing, lol!

  • @Bestvegeta
    @Bestvegeta 8 місяців тому +2

    Best in depth explaination of tri planar and even beyond.
    I do not comment very often on youtube videos but this one is extremly well done.

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

    Quite a coincidence, I was actually talking about triplanar in a meeting yesterday :D Greate video as usual :) Can't wait for part two!

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

    Absolutely top-tier breakdown and explanation. Appreciate the time it took to not only figure out the penta and enna-planar techniques, but also the time to break it all down and show it.

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

    Hey awesome video, at 9:00 minutes though, how did you get the "world X Axis" and "World Y Axis" - I keep looking for them, but I can't seem to find it when creating nodes :(

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

      They're just Named Reroute Nodes of basic vectors :)

  • @mlecz
    @mlecz 11 місяців тому +18

    Fantastic Video ! It would be great if you could bring up the "seamless_scale" topic, which was created to bypass texture stretching issues on tessellation(or WPO) displacement surfaces.
    This has been implemented in the Valve 'Source' Engine since 2007, but in the Unreal Engine there is still no way to cope with texture stretching at high World Position Offset values.
    I think you are the right person to handle such a complex problem.

    • @VisualTechArt
      @VisualTechArt  11 місяців тому +5

      It sounds interesting, even though I'm not sure of what you're referring to xD can you provide a resource for me to start the research from?

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

      @@VisualTechArt
      He is talking about Source Engine seamless_scale, a shader parameter for dealing with texture stretching issues on displacement.
      You can found in the developer valvesoftware wiki.
      But it is not a complete solution in some cases it's talked about in their wike Caveats.

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

    Amazing video as always! Good to see I'm not the only one that looks like that when trying to figure out vector math transformations.

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

    SUBSCRIBED!!!
    The combination of humor and teaching amazing stuuf is amazing Thank you for your work.

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

    great video as ever, your the triplanar king! Looking forward to your video on Triplanar for assets as thats what i use it for the most. What annoys me the most is how the built in world space mapper from Epic is so flawed.. even the way it mixes the channels togther it ludicrously broken..

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

    Dude you are amazing, youve done so many people such a huge favor and are changing the indie game dev community!

  • @hugowijaya883
    @hugowijaya883 3 місяці тому

    Amazing video, it's incredibly helpful! May i ask what you set the Center X, Center Y and Speed values to for the Rotator node in 22:30? I understood that this was where you made the 45 degree rotation but i wasn't sure if there were any values specifically adjusted for the rotator node. Once again, much appreciated!

    • @VisualTechArt
      @VisualTechArt  3 місяці тому

      The set up is the same as the one I show the first time I place down a Rotator :D

  • @ali.3d
    @ali.3d 11 місяців тому +2

    Absolutely love this in-depth tutorial, thank you mate!

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

    This video and the one that follows are a matter of ABSOLUTE PUBLIC INTEREST when it comes to materials in UE. Well f'ing done man, and thanks for undergoing all these hours of existential crisis for all of us x) ! That's a sub right there!
    It also has to be said that thanks to this video, I understand axes, vectors and normal maps waaaay better !!

  • @retroman3252
    @retroman3252 11 місяців тому +6

    Ennplanar projection - Mind Blown

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

    Thank you so much for this! Everything looks so much better now. I can't believe I didn't realize how wrong it was before, I had an inkling but it seems like night and day now. Your knowledge, intelligence and generosity is very much admired and appreciated! Bravo!

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

    15:05 - So Sine in UE is not the same as Sine HLSL or Cosine reversed (1-) both of which are the same, which makes me Ask rather than question since I have forgotten the period value fix part... if the material is right & wouldn't a Cosine reversed (1-) be better here?

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

      I'm not sure I got all what you were thrying to say...
      Anyways: in HLSL the trigonometric functions are all in radians, while in UE's nodes you're forced to set a period length. In this case I set it to 4 because I just wanted the vector to rotate 90° with a parameter that goes from 0 to 1 :)

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

      @@VisualTechArt ah ok so you did set them. Best example of what I was saying is do a custom (HLSL) node & add sine to it. Then do a Sine node in unreal (dont set a period - use as is like most people...). Compare the result. The result is different. Now do a Cosine with a oneminus in unreal with nodes & compare that result, its result is the same as the HLSL sine. Meaning a Cosine & Sine used straight, no period setting give different results. Unsure when they plan to fix it.

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

    Thank you! I like to learn from you!

  • @Nieverton69
    @Nieverton69 6 місяців тому

    where did that blue normal vertex node come from? 4:38

    • @VisualTechArt
      @VisualTechArt  6 місяців тому

      Maybe you're referring to a named reroute node :)

    • @Nieverton69
      @Nieverton69 6 місяців тому

      @@VisualTechArt yes, but I haven't seen you using this redirect before

    • @Nieverton69
      @Nieverton69 6 місяців тому

      @@VisualTechArt aaaaaah, I forgot, I see

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

    Fantastic in depth explanation. I always learn a lot with your videos. Thanks, mate!

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

    I tried to apply UV rotation on EnnaPlanar but rotation is just stretching and skewing the texture. seems like it's not possible to get proper texture rotation. let me know if I am wrong.

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

      Once you generate the UVs you can simply apply some Rotator nodes there and it should work :)

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

    Terrific video, and I especially applaud you for showing the setbacks and the debugging process. Software development is almost never monotonically forward. :)

  • @CrowBiomes
    @CrowBiomes 2 місяці тому

    Hey man! Love your videos, it's like being in college all over again with all the math haha (still going through the video). At 2:54, if you do a frac right after the divide , (frac output goes to all the component masks) then invert G & B for the 'X' and just B for 'Y', all textures should be facing the same direction, no?

    • @VisualTechArt
      @VisualTechArt  2 місяці тому

      That's quite early in the video, keep watching ;)

  • @JohnnyTeststar
    @JohnnyTeststar 6 місяців тому

    Is there any way to make this work locally? For stuff like moving objects and such. I tried following along but plugging transformposition and transformvector to turn abs world space and world space into local ones but that didn't work. i have a completely differently-structured script that works fine for cube-like objects but anything round or slanted is just yikes, and I'm stuck trying to find a fix to that.

    • @VisualTechArt
      @VisualTechArt  6 місяців тому

      Just watch the follow-up video ;)

    • @JohnnyTeststar
      @JohnnyTeststar 6 місяців тому

      @@VisualTechArt Oh! I'll be sure to check that out later, lol. Thanks!

    • @JohnnyTeststar
      @JohnnyTeststar 6 місяців тому

      ​@@VisualTechArtit worked! One thing though, how would I put an offset on the tiling?

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

    Incredible, I can't wait for the follow up video

  • @jonahmcconnell4818
    @jonahmcconnell4818 2 місяці тому

    9:34 is me any time I'm using vectors lol. One time we had a someone filling in for our teacher in a Physics class, and they got mad at us for "sharing answers with each other". We asked them how, and they said we were communicating with hand motions haha.

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

    Out of all the videos I’ve watched on triplanar mapping, this is the best tutorial. I am eagerly awaiting Part 2 on the assets pipeline. Could you please let me know when you will release the video on that?

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

      Thanks, I'm working on it, few more weeks to wait I think :)

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

    9:30 ... Why is it so familiar?

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

      Multiple wrist and shoulder dislocations while trying to apply the right hand rule

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

      @@VisualTechArt I can draw the landscape visible from my window from memory...

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

    I wrote a quaternion based normal baker to just avoid the whole conversion step at the cost of needing to use rgba in the "normal" map
    Was a fun exercise in learning quaternion math to replace matrix transofrmations
    Cool to see the mat solution!

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

    Any ETA on how to use this with Models and not Landscape?

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

      Next video, few weeks to wait still :)

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

    Just discovered your channel, omg man you're godsent!
    You're an amazing teacher, thanks a lot!

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

    thank you very much, warlock!
    15:10 - apparently I didn't understand something. why can't you use swizzle? there is 'swizzle' node in materials. you can also change the order of channels through the 'break float' or 'split components' and 'make float' nodes :) yeah, it's not a one node and no so minimal and concise like a custom expression, but 'make float' will reduce some your 'append' blocks :)

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

      Let's say it was a little excuse to show a little bit of HLSL :)
      Plus I try to avoid using UE's MFs where I can, both to show how things are done and also because you mitigate the risk of getting your shader broken in the future because they removed something from the library :D

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

      @@VisualTechArt oh, ok, I understand :)

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

    Can you design a version where all 6 poles of the sphere will have an octagon instead of just 2?

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

      I could, I don't know if I will xD

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

    I remember struggeling so much a couple years ago with getting a triplanar brick texture with normalmap to look correctly. i never got it quite right. finally i understand why.

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

    Thank you. How performant is this (the extra instructions if we put your MF in many of our Mats)? Im already doing 3 layer Vertex Paint + Triplanar. So I think Id need your MF on every (3) Texture layer that blends in [the code of] each Material.

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

      It has more stuff going on of course, but don't stress too much about it (and measure the performance of it in your game to actually see if that needs to be addressed).
      When you use multiple instances of the same MF the compiler will recognise that many nodes are the same and all giving you the same output, so it will optimize them and run only once ;)

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

    Can this work with parallax occlusion mapping? I've done one before but it required 6 samplers. :\

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

      Well for the POM you have to raymarch, so of course you need to sample multiple times...
      I guess that since here we recompute the basis POM can work properly, not sure if you need to recompute everything at each step, which would make the shader super expensive :)

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

    You are amazing, this helped me out so much you have no idea!!!
    Amazing content!!!

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

    I dont get it. We can constantly see enormous stretching at the bottom of the sphere. How come you avoid adressing this?

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

      Because the landscape doesn't have a bottom part :)

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

      ​@@VisualTechArtyeah it crossed my mind thats no issue since its the terrain use case example. Really looking forward to the sequel

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

    Great stuff, thanks for the breakdowns!

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

    Thank you for your video, excellent explanation, I have a question about the Anisotropy (brushed metal) , it seems it is almost the same problem as the normal? how can we calculate the anisotropy in tri-planar? , wish you beautiful success with your chanell

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

      Thanks! :D
      Yes it does as it's based on the tangent vectors :)
      If you take the "Basis X" of the matrix in my shader you should already have them correct, not sure though, I would need to check

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

    But wait, is there a sharp transition between projections or not?

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

      On the single sample version, yes

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

      @@VisualTechArt if anyones interested, theres a video where guy blends it with SS dithering.. I wonder if one could blend it further using fwidth

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

    Amazing visualisations!

  • @Leo-Leus
    @Leo-Leus 11 місяців тому +1

    You, sir, are a sage and a saviour. Thank you very much!

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

    been working on a scene that's heavily dependent on triplanar, this is great!

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

    Ben Golus wrote a solid article about it

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

    Great breakdown!

  • @baudmarch3925
    @baudmarch3925 6 місяців тому

    For those who still don't have the right normal orientations :
    Here is a comment for people who may have an issue with the normal triplanar axis orientation as described in the tutorial : to be considered only once the projection problems are fixed (talking about the X and Y Nan check nodes added in the later version of the system which fixed everything for me not sure how).
    So for the axis orientation, here is what I did, because even with VTA's function, everything worked for me except the normal axis orientation, per face projection.
    (Beware the cross products, they must to be in the same order, an inverted cross order gives an inverted vector)
    X projection :
    - Z is VertNormal ✅
    - Y is VertNorm cross (ProjSign (Mask R) * WorldY) -> YNan -> Normalized (I just don't invert the ProjSigns) ❌
    - X is Y cross VertNorm -> YNan ❌
    Y projection :
    - Z is VertNormal ✅
    - Y is VertNorm cross (ProjSign (Mask G) * -1 * WorldX) -> XNan -> Normalized ❌
    - X is Y cross VertNorm -> XNan✅
    Z projection :
    - Z is VertNormal ✅
    - Y is VertNorm cross (WorldX * -1) -> XNan -> Normalized❌
    - X is Y cross VertNorm -> XNan✅
    Hope this helps some people !

  • @samuelb.9314
    @samuelb.9314 11 місяців тому +1

    Amazing content, thanks !

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

    UE has a hidden node called PerturbNormals. Could just use that at the end to convert a simple height map to normals instead of dealing with broken normals

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

      I don't know about this node but I didn't go too fancy with this and stick to the topic :D I did something similar in my previous video "The Only Texture a Game Needs" :)

  • @ethanwasme4307
    @ethanwasme4307 11 місяців тому +8

    How is that possible? Because people regurgitate the same tutorials xD
    You'll start to see your method leeched too :P

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

    Doing gods work

  • @rtea_academy
    @rtea_academy 11 місяців тому +7

    Ben Cloward explained this theme 3 years ago.. The great problem is when you´re using this triplanar projection in a model with animation and you must preskinned position to maintain the projection material in the right position.. I can´t explain more by here writting you but when you try apply this projection and you must correct after the texture the direction of the normals with preskinned materials and not with vertex normal ws then you´ll discover all the problems (not is valid work with vertex interpolator node) . Try this challenge dear guy and youll discover the problems when you´re working them).. THIS IS THE REAL CHALLENGE GUY.. Have you a technical solutions to this problem?.. I respect you but I would like watch you explaining solutions to other level. I follow during lot years I know that you´re a great profesional with a level similar to render bucket channel (with awesome contents). Answer me if you consider this hard question interesting.. (I must apologize you because not writte english right.) Thank´s you guy for your contents..

    • @VisualTechArt
      @VisualTechArt  11 місяців тому +15

      Ok but keep calm xD
      That will most likely be addressed in the follow up, where I'll show what needs to be done to fit the tech to assets :)

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

    Yeah the fact everyone gets it working in crazy

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

    Nice video!
    Your weights caculcation is way too complicated, just do contrast( abs( normals )), either smooth or straight contrast will do (demo is on shadertoy).
    Glad to see I'm not the only one suffering on the TBN Matrix.
    You can use a dithering to make the non blending transitions way smoother especally with TAA, which most have enabled anyway.

    • @VisualTechArt
      @VisualTechArt  11 місяців тому +4

      That would work, It would be like stopping before normalizing the weights, which is not mandatory, but I like to have them balanced as it can be useful for other things too :)
      And yeah, I could have added dithering but there was already too much stuff in the video and also adds all the annoyance of dealing with ghosting, maybe I can do a follow-up with that!

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

    bro looks like antony starr