Announcement

Collapse
No announcement yet.

World Aligned XYZ Material without Texture Objects?

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

    World Aligned XYZ Material without Texture Objects?

    I'm currently working on a material that uses several detail textures that need to be tiled in XYZ world coordinates. The problem is, all of the default functions require me to input a texture object. The detail textures I'm using are DXT5 normals with Roughness and Greyscale Albedo maps packed into the Blue and Alpha channels. This obviously wouldn't work if I converted them to texture objects.

    Ideally, I would be able to project texture samplers into XYZ world coordinates. Any ideas?

    #2
    Originally posted by nickgalope View Post

    Ideally, I would be able to project texture samplers into XYZ world coordinates. Any ideas?

    That is not how texture samplers work. When you look up a texture sample, you only have access to the value of the texture at the specified UV for the pixel being currently rendered. If you want to look up another location, that requires another lookup. Because triplanar mapping uses 3 planes, this means you need 3 samples. And the UVs need to be specified correctly for each sample. Texture Objects are required since they pass a reference to the texture and the function can perform the lookups it needs.

    There should be nothing wrong with doing channel packing using world aligned textures. Just do a component mask at the end and extract your channels as usual, and pretend the world aligned part is not there. Make sure to check UseFloat4 if you need alpha.
    Ryan Brucks
    Principal Technical Artist, Epic Games

    Comment


      #3
      Yep, that did the trick. Thanks for the quick response!

      Comment


        #4
        I am looking for an answer to the above question, but I do not quite understand RyanB's answer. If you have resolved this issue, can you show a screenshot of the node?

        Comment


          #5
          I have found the solution to this by just messing around long enough. What you want to do is: Instead of a TextureSample, you'll have TextureObject>WorldAlignedTexture>ComponentMask. I assume you would just use multiple component masks if you needed separate color outputs. Screenshot attached of how I replaced my TextureSample with this.

          Comment

          Working...
          X