Announcement

Collapse
No announcement yet.

Bump Offest with world aligned Texture

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Bump Offest with world aligned Texture

    Is there a way to add bump offset with world aligned texture?
    Attached Files

    #2
    Yes, but you'll have to do it for each axis in the world aligned texture function.

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	283.4 KB
ID:	1082188


    You can do it with the bumpoffset node or by multiplying your height by camera vector and adding that to the UVs.
    Both yield the same result.

    Comment


      #3
      Originally posted by Santewi View Post
      Yes, but you'll have to do it for each axis in the world aligned texture function.

      [ATTACH=CONFIG]48966[/ATTACH]


      You can do it with the bumpoffset node or by multiplying your height by camera vector and adding that to the UVs.
      Both yield the same result.
      Sorry I'm new to unreal, how did I connect this to my World Aligned Texture now ?

      Comment


        #4
        Originally posted by Xosh project View Post
        Sorry I'm new to unreal, how did I connect this to my World Aligned Texture now ?
        You don't, this would replace the world aligned texture node.

        Comment


          #5
          Originally posted by Xosh project View Post
          Sorry I'm new to unreal, how did I connect this to my World Aligned Texture now ?
          I'd suggest you to take a look inside the world aligned texture function. You can easily just blend between the 3 projections (apply the bumpoffset to each) without the function.

          If you want use the function, add the bumpoffset between the worldpos->mask->divide and the texture sample. Look in the world aligned texture fcuntion, it should have something similar, just without the bumpoffset and heightmap.

          Comment


            #6
            I apologize for bringing this thread back to life. Indeed i am running into the same problem at the moment.

            The approach: I used a shader suggestion from Erik Ketchum (UE4 Answerhub) for an advanced Ice Material.
            https://answers.unrealengine.com/que...ed-in-ue4.html
            It works wonderful! I even managed to enhance the material that the normal maps are going across multiple objects (ground tiles > walls > slopes, etc)

            Click image for larger version

Name:	caHTVbO.png
Views:	1
Size:	945.3 KB
ID:	1094838

            The problem: I want to use the same world-tileable look on the icey cracks and ice depth clouds, under the surface (the effect works through the bump-offset)
            Well..as the OP, i am quite new to certain advanced materials, functions etc. I tried to use the solution/idea that was shown in this thread.

            This is how Erik's bump-offset solution looks like:

            Ice Depth Clouds:

            Click image for larger version

Name:	fPiffPm.png
Views:	1
Size:	220.0 KB
ID:	1094839

            Ice cracks: (Don't wonder, i already tried something on the lower nodes but that wasnt working. In original, it looks like the first node structure)

            Click image for larger version

Name:	JIBI1Na.png
Views:	1
Size:	354.9 KB
ID:	1094840

            Call me stupid, i don't get it at all.
            I tried the first idea mentioned above. Working partly..it somehow works on XY (ground) but a) not in XYZ and b) world position seems to do it different than the world align function, not really looking seamless.
            I know > i need to convert it to work on XYZ. So..I duplicated the world texture align function (safety first) and tried to replace/enhance the function with the same stuff from above
            but i am stuck what i could do now since the function itself ends up being a node..and i really tried for hours now (barbarian 3d artist trial and error headbangs, elephant running through swarovski shop)
            figuring out how to merge the bump-offset into the world align function + getting a node where i can use the same parameter instances from the original (rotation, scale, coloring, brightness, etc).

            I am not giving up on this (posting solution if i figuring something out) but if any UE4 material pro might have an idea, any help/suggestion would be pretty cool.
            gives me a node without any big in/outputs i need for
            Last edited by Kajiisan; 12-10-2015, 11:47 PM.
            Tobias Löffler
            Senior 3D Artist

            Comment


              #7
              Click image for larger version

Name:	4JSGH25.png
Views:	1
Size:	354.9 KB
ID:	1094841

              Partly working, its not really world align the texture on real XY / XYZ. Long story short, by changing the ice crack scale for example, textures are acting weird.

              Will update this thread with Material BP prints if i figure out something.
              I hope it will be useful in the future.
              Last edited by Kajiisan; 12-10-2015, 11:58 PM.
              Tobias Löffler
              Senior 3D Artist

              Comment


                #8
                Warning that BumpOffset assumes you are in tangent space. The above XY only bumpoffset may appear to work if your ground geometry orientation matches the default XY directions but will be wrong if the mesh or UVs get rotated or twisted anywhere.

                I suggest rolling a custom BumpOffset function for this purpose. There is already a "Bumpoffset_Advanced" that you could base it upon but I am not sure what it does. The concept behind bumpoffset is very simple though.

                It is really just UV + Heightmap*(CameraVector * Height).

                The 'custom' part is that normally cameravector gets transformed into tangent space.

                For the XY, you can just use raw camera vector since it will match the world orientation.

                For the XZ, I think you will need to swizzle the camera vector from XYZ to XZY. For the YZ I believe you need to swizzle from XYZ to YZX.

                One additional note, the CameraVector.XY should also be multiplied by the "height" value. This squashes the ray to fit the height.

                For extra correctness (even more correct than the 'bumpoffset') you can get more accurate values by dividing the CameraVector by it's Z component. That will project it to hit the bottom of a virtual floor, whreas bumpoffset actually doesn't do that and will offset less at sharp viewing angles as a result. I believe bumpoffset made that choice intentionally though since there can be more artifacts at glancing angles with full offset.
                Ryan Brucks
                Principal Technical Artist, Epic Games

                Comment


                  #9
                  I am looking for some assistance on this aswell. I have a functioning Material Layer which makes use of the WorldAlignedTexture function node but want to adapt it to support bump offset in all axis however after 3 days if trial and error my brain is fried!

                  Any help would be appreciated!

                  I don't fully understand where I am wanting this bump offset to be inserted into the worldalignedtexture function. I have copied it and am attempting customise it but my brain, please, send help. Haha

                  Comment


                    #10
                    https://gyazo.com/81a7f77862bafa5546291a30322abd75

                    Comment


                      #11
                      is this tri planar thing worked

                      Comment


                        #12
                        Originally posted by RyanB View Post
                        Warning that BumpOffset assumes you are in tangent space. The above XY only bumpoffset may appear to work if your ground geometry orientation matches the default XY directions but will be wrong if the mesh or UVs get rotated or twisted anywhere.

                        I suggest rolling a custom BumpOffset function for this purpose. There is already a "Bumpoffset_Advanced" that you could base it upon but I am not sure what it does. The concept behind bumpoffset is very simple though.

                        It is really just UV + Heightmap*(CameraVector * Height).

                        The 'custom' part is that normally cameravector gets transformed into tangent space.

                        For the XY, you can just use raw camera vector since it will match the world orientation.

                        For the XZ, I think you will need to swizzle the camera vector from XYZ to XZY. For the YZ I believe you need to swizzle from XYZ to YZX.

                        One additional note, the CameraVector.XY should also be multiplied by the "height" value. This squashes the ray to fit the height.

                        For extra correctness (even more correct than the 'bumpoffset') you can get more accurate values by dividing the CameraVector by it's Z component. That will project it to hit the bottom of a virtual floor, whreas bumpoffset actually doesn't do that and will offset less at sharp viewing angles as a result. I believe bumpoffset made that choice intentionally though since there can be more artifacts at glancing angles with full offset.
                        Thanks. This solved it for me. Using it for floors only so only did your first step so can't comment on XZ and YZ.

                        Comment

                        Working...
                        X