World-Aligned Textures - UE4 Materials 101 - Episode 22

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ต.ค. 2024

ความคิดเห็น • 63

  • @kickheavy8982
    @kickheavy8982 8 หลายเดือนก่อน

    Dude!!! Thank you so freaking much! I'm new to Unreal. I created an ice growth simulation that I imported into Unreal and couldn't figure out how to create an ice texture that wouldn't pop and slide all over the place as the ice was growing and the vertices were moving around! I struggled for HOURS last night, couldn't find a solution and went to bed in frustration. Woke up and searched youtube, The WorldAlignedTexture node was the answer to that problem! I just tried this and fired off a path traced render. IT LOOKS PHEMONENAL! I'm so freaking happy man lmao. You have no idea how much this unlocks for me. I can create exactly what i want now. I'm so hyped i'm gonna scream

  • @adamplechaty
    @adamplechaty 3 ปีที่แล้ว +3

    I love the little anecdotes from your work, it really helps to frame these topics and put them into the right perspective. The motivation behind these shaders is so important. Awesome!

  • @WellImNuts
    @WellImNuts 4 ปีที่แล้ว +32

    Good to know: WorldAlignedTexture's 'TextureSize' is in UE units, aka cm. Setting it to 100 = it tiles every 1 meter.

    • @BenCloward
      @BenCloward  4 ปีที่แล้ว +7

      Thank you very much for clarifying that! Would have been good to mention that in the video, but hopefully people will read your comment!

    • @shaezbreizh86
      @shaezbreizh86 3 ปีที่แล้ว +1

      @@BenCloward Hi, i was curious about if yu could point me a tuto that would allow to get a rock texture being displayed so the top is always on top and bottom of texture always on bottom based on z axis.
      I've some erosion in the rock texture that i would like to keep going in negativ z direction
      The closest i've been is mixing random try with yur layered rock tuto but whatever i try it fail xS

  • @BIGTTSNORLAX
    @BIGTTSNORLAX 3 ปีที่แล้ว +1

    Every time I come across something I'm currently struggling with, I'm blown away by the techniques because I can really understand why they are so good. So I guess, once all of your videos have this effect on me my basic training will be complete!

  • @hellomate639
    @hellomate639 4 ปีที่แล้ว +2

    Man, your tutorials are world-class.

    • @torgath5088
      @torgath5088 3 ปีที่แล้ว +1

      world-aligned-class

  • @MonsterJuiced
    @MonsterJuiced 2 ปีที่แล้ว +1

    Lol I'm so stupid. I spent ages scanning the comments and your other videos looking for procedural noise textures thinking the next two texture objects were generated Perlin noise when all along they were just the default slate textures that come with unreal. duh hahaha also I'm glad Ken Perlin was recognised for such an incredible contribution. Thanks for the lesson! :)

  • @ElisabethMilaRose
    @ElisabethMilaRose 3 ปีที่แล้ว +1

    Thank's !! My game "Nature Hunter" needed that !
    I was stuck in my research because I did not know the existence of the "WorldAlignedNormal" and the normals were doing anything right ^^'

  • @Den69699
    @Den69699 2 ปีที่แล้ว +1

    This saved me after 2 years thanks

  • @mirrorunreal3675
    @mirrorunreal3675 3 ปีที่แล้ว +1

    Fantastic Ben. Thanks

  • @Vemrah
    @Vemrah 4 ปีที่แล้ว

    This channel is a treasure ..

  • @abilalp9104
    @abilalp9104 3 ปีที่แล้ว +1

    Thank you Mr. Ben, perfect lesson.

  • @sassuskrassus3166
    @sassuskrassus3166 ปีที่แล้ว +1

    hell yea
    good tutorial

  • @Piru2000
    @Piru2000 3 ปีที่แล้ว +1

    Great Tut, Ben thank you, very much, There was another node, that accomplish something similar to World-Aligned, It is called ObjectScale, but for some reason, it does not work anymore with UE4.25

  • @esk6a
    @esk6a ปีที่แล้ว

    Hello Ben! I have a question. Im trying to do something similar on the inside of a sphere (sky dome) where I want to project one cloud and move it around if needed. The problem is that it gets projected on X,Y,Z axis and I only want a single cloud without repetition. Is there a way to do that? Thank you for the amazing tutorials BTW!

  • @Latvian3Dman
    @Latvian3Dman ปีที่แล้ว +1

    Thank You for video.

  • @vajaga4624
    @vajaga4624 2 ปีที่แล้ว

    Do world alligned Textures work at all, with the texture compression method that was showed in earlier episodes? I am trying to get my CR and NOH textures to work in world space.
    I have a cliff, and I would like the texture to be mapped horizontally. Any help would be much appreciated.

  • @DragonSephi87
    @DragonSephi87 ปีที่แล้ว

    say i use this,is it some how possible to change the material to something else the further down a player goes? e.g. going from soil to rock as the cave goes deeper?

  • @RV-bc9yi
    @RV-bc9yi หลายเดือนก่อน

    I know the subject is a bit old!
    I hope this message will be read. I've tried it on my project with a brick texture but it doesn't work because the mesh has a 45 degree rotation on Z and that creates a" Shear" type deformation. Even with a simple cube! Is this a limitation?
    For 90-degree angles works just fine.
    If you have any ideas !

    • @BenCloward
      @BenCloward  หลายเดือนก่อน

      Yes, it's a limitation of the way the world aligned textures work. They're aligned to the X, Y, and Z axis of the world - so 45 degree angles don't work.

  • @3DArtAR
    @3DArtAR 3 ปีที่แล้ว

    That's so cool but I'm trying to use this technique with some environment modular kits so I have a question, How can I use height maps with WorldAlignedTexture?

    • @BenCloward
      @BenCloward  3 ปีที่แล้ว

      I'm not clear on what you're asking. Can you describe what you're trying to do with more details?

    • @3DArtAR
      @3DArtAR 3 ปีที่แล้ว

      ​@@BenCloward
      When we used the "ParallaxOcclusionMapping" node in episode 8, we connected the output "Parallax UVs" to the "UVs" input of the other texture samples "Basecolor, Roughness, etc." and it's done.
      Now I want to use the "WorldAlignedTexture" node with "ParallaxOcclusionMapping".
      My question is how can I manage this?
      I hope that I could explain enough.
      Thank you very much.

    • @kenalpha3
      @kenalpha3 2 ปีที่แล้ว

      @@3DArtAR Did you get an answer? I need help setting up the other textures... Roughness, Heightmap, and ambient Occlusion

  • @sutixela
    @sutixela 2 ปีที่แล้ว

    Any way to combine Parallax Occlusion Mapping with world aligned texture?

  • @nerophesis
    @nerophesis 4 ปีที่แล้ว +1

    Love your content!

  • @turalmemmedov3648
    @turalmemmedov3648 4 ปีที่แล้ว +1

    Hi and thanks for another great video. This looks cool but the instruction already more than 200. So if we add roughness, AO, detailed normal etc, it looks like it really will get out of control. So, is there anything we can do for this, or it is what it is, and we must pay that cost. And how costly can it really be? For example, how often can we use this technic?

    • @BenCloward
      @BenCloward  4 ปีที่แล้ว +4

      You'll have three projected textures for each material at most. One for color, one for normal, and one for the combined AO, roughness, and whatever else you want to pack together. I would do the detail normal using UV space instead of projecting it.
      World space texture project on all three axes can get quite expensive - yes. There is a way to do it more cheaply - using just one texture sample instead of three. There are some links in the video description that show how to do that. However, the downside is that you'll get hard seams instead of blending between the top, front, and sides.
      I would also caution against purely using instruction count as a performance measurement. The best way to tell how fast something is is to run it on your target hardware. Instruction count can be pretty inaccurate.

    • @turalmemmedov3648
      @turalmemmedov3648 4 ปีที่แล้ว

      @@BenCloward Oh I found it. Thank you very much. )))

  • @BIGTTSNORLAX
    @BIGTTSNORLAX 3 ปีที่แล้ว

    Ben I have a question about the noise being in 3d world space: I know you said there are slices of the noise layered on top of one another to create a kind of 3d texture. Is it possible to create a 3d volume texture manually, out of any arbitrary number of textures layered on top of one another? How many 'slices' are needed to create a realistic volume? And also I don't quite understand how the information is extracted out of the 3d noise and applied properly to each pixel. I know this video is old, but if anyone could point me in the right direction I'd appreciate it!

    • @BenCloward
      @BenCloward  3 ปีที่แล้ว

      It is possible, yes. Here's the documentation:
      docs.unrealengine.com/en-US/Engine/Content/Types/Textures/VolumeTextures/index.html
      Extracting the data is similar to sampling a 2D texture map, but it's in 3d instead of 2d. So with a regular texture map, you use the UV coordinates and find the pixel on the texture that matches the coordinates. Well, with a volume texture you use 3d world space and find the space in the volume that match that position in space. Does that help?

  • @lz4090
    @lz4090 4 ปีที่แล้ว

    Good day sir, can this simple material be used for the voxel plugin? They have their own materials but I want to start with a simple one to grasp the basics. Thank you

  • @KiwiHawk-downunder-nz
    @KiwiHawk-downunder-nz 4 ปีที่แล้ว

    This is neat, SO what the trick for making this a Master for an instance that can have the texture's changed as needed please?

    • @markrennie86
      @markrennie86 4 ปีที่แล้ว +2

      Convert all the texture objects to parameters and create an instance of the whole thing - Done.

  • @musoke65
    @musoke65 2 ปีที่แล้ว +1

    Hello! What is the most simple explanation for the difference between a texture sample and a texture object?

    • @BenCloward
      @BenCloward  2 ปีที่แล้ว +4

      A texture sample takes a texture object and UV coordinates and gives you a color - so it's output is an RGBA value. A texture object is just the texture itself. It's not something you can use in the shader without passing it into a sampler. The thing that might be confusing is that texture samplers have texture objects built into them, so texture objects aren't necessary in most cases and you can use texture samplers by themselves. The case were texture objects become useful is if you need to use the same texture and sample it multiple times with different texture coordinates. So you can add one single texture object and then pass it into multiple texture samplers. I hope that makes sense. Ask me more questions about it if you need more.

    • @musoke65
      @musoke65 2 ปีที่แล้ว

      @@BenCloward Thank you for your explanation. Do you have a video or series were "functions" are covered in particular?

  • @shakaama
    @shakaama 2 ปีที่แล้ว

    um so i was trying this for my carpet.
    WHAT I WANTED
    - seamless carpet
    - with dirt and grime
    - with puddles
    WHAT I GOT
    - all of that
    - but the puddles are BLUE

  • @TheNetwork
    @TheNetwork 3 ปีที่แล้ว

    I am trying to follow this but want to create a rock strata effect like in a canyon with multiple colored bands of colors across all the strata. would you be able to do a tutorial for this???

    • @BenCloward
      @BenCloward  3 ปีที่แล้ว +2

      Is this what you're looking for: th-cam.com/video/cGmWa-gETzU/w-d-xo.html ?

  • @medmel2160
    @medmel2160 4 ปีที่แล้ว

    Can I use this technique to blend a World Aligned texture to itself?
    I explain, I want to use World Aligned texture to avoid stretching on sharp cliffs. But textures applied on rounded part of the cliff overlap and don't blend naturally (specially at 45°)

    • @BenCloward
      @BenCloward  4 ปีที่แล้ว +2

      Yes, you can project a texture top-down (on the Z axis) and another projected front/back (along the Y axis) and lerp between the two of them using the normal angle.

    • @medmel2160
      @medmel2160 4 ปีที่แล้ว

      @@BenCloward I'll try this, thank you sir !

  • @tbunreall
    @tbunreall ปีที่แล้ว

    could you please show us how to use parallax occlusion mapping with world aligned textures?

    • @BenCloward
      @BenCloward  ปีที่แล้ว +1

      I don't recommend doing that. Each of those features requires doing multiple texture samples. This is important because texture samples are the most expensive thing that a shaders does and shader performance scales linearly with the number of samples the shader does. World aligned textures require 3 texture samples per texture and one additional sample for the height map. So if your material uses a color, normal, and mask texture, you'd need 10 samples for it. That's kind of expensive on its own - but doable.
      If you add parallax occlusion mapping on top of that, you're multiplying the 3 samples per texture by anywhere from 5 minimum to up to 32 or more - so your material could end up using an insanely high sample count (over 300 texture samples) - which isn't possible to render at real-time frame rates on today's hardware. For that reason, I've never actually tried to figure it out - because I know that (currently at least) the hardware won't be able to handle it. It is technically possible to do, but I don't think it can be rendered fast enough to be useful.

    • @tbunreall
      @tbunreall ปีที่แล้ว

      @@BenCloward oh wow. Thank you for the insight. So I guess we're stuck with just normal maps for now? Slightly disappointing. Thanks for the reply!

  • @hasanshafy_
    @hasanshafy_ 3 ปีที่แล้ว

    I applied this function to my plane to create a seamless tile rather than stacking one plane next to each other. But when I rotate it from z axis the whole material gets disoriented. Any idea why?

  • @robojackmu
    @robojackmu 4 ปีที่แล้ว

    cant use instancing for world aligned normal, once i change normal texture in the instance, the whole world normal mess up

  • @marcinesa1336
    @marcinesa1336 2 ปีที่แล้ว

    how add WorldAlignedTexture's with paralax ??

  • @FF-FAN9999
    @FF-FAN9999 3 ปีที่แล้ว

    what if u want to offset the textures (panners etc) using this technique?

  • @TheHoinoel
    @TheHoinoel 3 ปีที่แล้ว

    Could you have used this WorldAlignedTexture node for projecting your rain drips texture to the sides using the XY output?

    • @BenCloward
      @BenCloward  3 ปีที่แล้ว

      Maybe? I’d need to try it and see. There are some fairly specific things that the drip function does that may not work with this node. Not sure.

    • @TheHoinoel
      @TheHoinoel 3 ปีที่แล้ว

      @@BenCloward Cool, thank you for the answer. I am loving the tutorials by the way! Thank you for making them :)

  • @just_lord_and_master
    @just_lord_and_master ปีที่แล้ว

    👌

  • @plasid2
    @plasid2 4 ปีที่แล้ว

    Can I use this to Landscape material as seamless texture?

    • @BenCloward
      @BenCloward  4 ปีที่แล้ว +1

      Yes, you can use this technique on landscapes. I don't recommend using it on all of the materials in the landscape, but if you have one that you know will especially be on vertical surfaces, this would be a good solution for that.

    • @shaezbreizh86
      @shaezbreizh86 3 ปีที่แล้ว

      @@BenCloward hi, i've try what yu said for rock surface, in order to keep the rock texture going the same top/down direction i've aligned rock to XY and that fine but i've not been able to get the bump offset working with aligned texture and the advanced bump node is more or less working (mostly less) but the render is pretty not great, is that even possible to combine bump offset and world aligned texture correctly ?
      I feel like it would require more height projection paramater but then is the combination of bump and aligned node cheap for a landscape texture ?
      As every tuto mostly do their landscape with only landscape coord without any combination with world aligned texture for thing like rock, erosion etc i feel like it doesn't worth it for them ( in perf ?) while it actualy make the rock, erosion, etc render twice better xS

  • @kenalpha3
    @kenalpha3 2 ปีที่แล้ว

    Please help, ty. I was almost able to finish my custom material.
    1) But how to I TINT my main color texture? I can't connect a “Float” to the TextureObject node of the WorldAlignedTexture object (Cant connect Float to “Texture 2d”.)
    My old Tint method was to connect my COLORed texture (TextureSample object) and a 3variable color TINT to a Multiply > to a CheapContrast_RGB > to Base color. But I can't connect that to result (a Float) to the WorldAlignedTexture object. My code is posted at
    BlueprintUE … /blueprint/vs9hwlyu/
    2) How do we setup the matching textures for Metal, Roughness, ambient Occlusion, and Height - so they are also seamless? I've been watching texture tutorials for weeks, and it's frustrating because no one ever shows the steps to make a complete Material with the 5 texture pieces - if it's using the advanced effects I want of Triplaner or Blended vertex paint. (They only show main color and Normal - then say you are able do the rest [Triplaner] but we won't show that here.)

    • @BenCloward
      @BenCloward  2 ปีที่แล้ว

      1 - I recommend tinting the result coming out of the WorldAlignedTexture node after the texture sampling has happened.
      2 - Have you seen my videos on texture packing? You should not have a separate texture for metal, roughness, ao, etc. Instead, you should put one of those in the alpha channel of the color texture and the others into the normal map. This video explains it: th-cam.com/video/m5bP-xc6Sgs/w-d-xo.html The problem is that doing the triplanar projection requires 3 texture samples per texture map, so if you have color, normal, metal, roughness, ao, and height (6 of them!), that's 18 texture samples - which is way too expensive. (texture samples are one of the most expensive operations on the graphics hardware). But if you pack all of that data into just two textures, you're getting the same results with just 6 samples instead of 18.

    • @kenalpha3
      @kenalpha3 2 ปีที่แล้ว

      @@BenCloward Thanks for the reply. 1) Ty.
      2) You're correct, but I got my texture from someone else. So ill learn how to Pack textures, per your advice. Ty for the link.
      3) I've had to remake my texture/Material 10 times from finding better code of what I want to do. You're the expert so can I get your advice of what is performance possible - then I'll ask for help:
      3 Requirements: i) a 3 layer Material so I can Vertex paint (to produce different looks for the same static meshes = 20 of the same platforms and rocks).
      #1 The bottom texture set is Crystals. #3 The top texture is dirt.
      #2 And the middle uses the same crystal texture as #1, but at a different scale and tint. But it's connected to the Emission node - to produce a cool offset glow that I made on accident.
      ii) Triplaner XYZ.
      iii) Heightmap Lerp - for Vertex painting that reveals the bumpiest (highest) crystal first - when erasing the bottom dirt material.
      [I have the code and can get 2 of the 3 in a single Material, but having trouble combining all 3 in a single Material code - or to know if it's too expensive to try?]
      4a) So is 3 layers (3 sets of Material textures) of Triplaner calculations too expensive if I used your advanced texture Pack?
      Or if too expensive, should I just manually paint 4 texture variations (painted in Photoshop not UE Vertex paint) > then apply that to 4 different meshes?
      Here are my stats so far, do I cite the highest number as the “instructions” count?
      Base pass shader: 279 instructions
      Base pass shader with Surface Lightmap: 306 instructions
      Base pass shader with Volumetric Lightmap: 353 instructions
      Here is the code: BlueprintUE … blueprint/su5629br/
      4b) Or is there a way to for me to use only 2 sets of textures (like how your video shows), by combining my Layer #1 (crystals) and #2 (with an offset) -
      - before the LERP with the top Dirt layer#3 -
      - but still able to extract my layer 1 to go to Base color node, and layer 2 to go to Emission node? Idk how to code this interception then split - while Lerping to layer #3.
      4c) Or is it cheaper to try another method of [3] Layered Materials Setup (using the “Material Layer” actors) - then add Triplaner code to that? [v=I9w9sT1doRc] Thanks for your time!