TextureVariation Node - about Normals and Dithering

I’m trying to use the TextureVariation Node, but there are two issues that I don’t know how to approach:

  1. Normals are wrong: if I use the Shifted UVs output pin as input to my material normals’ Texture Sample the shading of the texture is wrong, just like it’s calculated before the normal texture is rotated inside the TextureVariation Node [see the shadows of the little spheres in the attached image, compared to the white sphere’s]
  2. Dithering is not working: the dithering between the variation islands is more a grey border, it doesn’t simply blend the islands as it’s supposed to do [you can clearly see what I mean in the attached image]

Any Ideas on how to work around these issues?

Obviously the texture I used in the material is for testing purposes only, just to make the issues more obvious to be spotted (the shadows in particular)!
I’m attaching the material blueprint screenshot too.


I -think- the main problem is it doesn’t work for normals. You can’t just rotate normals like you can textures. That’s why there’s quite often a separate node for normal operations, but not here.

This vid

covers calculating your own normals, I think at one point, using DDX and Y, maybe there’s something useful in there.

This guy

also covers this node in a lot of detail.

1 Like

Thank you for the infos and vids! I knew the second one (I made my blueprint after that) and the other is very interesting! I’ll try to apply those techniques to my case and I’ll share the result :slight_smile:

1 Like

You can swizzle a normal to change its rotation.

That means inverting the values of either U or V or both.

You could try and work out some way to apply this to the solution you have.

Nothing as simple as that to get any rotation that isnt 90deg though.
Youd have to calculate the normals - which is posssible and not necessarily expensice but it does open up a can of worms…

1 Like

I haven’t found a solution yet.
I’m still trying to modify the TextureVariation Node and I’ve found this node setup very useful.
I’m gonna try some different approach to the problem, in the meantime I will use the HeightToNormalSmooth as a temporary fix, but it is not optimal.
Thank you all for your advices!

1 Like

I finally managed to solve the problem with the not consistent normals alignment in TextureVariation node :slight_smile:

I had to modify the blueprint of the TextureVariation_RotateUV Material Function used inside the TextureVariation node with the code from the link I posted ( this one ):

The new function rotates the UV of the same amount as the original one, but it uses Rotator nodes for it and a different pivot point. It also has a new TextureObject input for the normal map and a new output for the realigned normals.

The TextureVariation node was modified to support the new TextureVariation_RotateUV function, simply adding an input node for the TextureObject to feed the rotation function with and the nodes to manage the its output:

Lacking a background in texturing theory, to try to figure out how to make all things work as desired has been a very frustrating process! I don’t even know how much reliable or well-performing my solution can be, and I would also like to extend it with triplanar projection.

Also, I still have to find a way - if there’s one - to make dithering work!!! :tired_face:
Any tip on the topic is welcome :slight_smile:

I hope my experience can be useful to someone else! And feel free to leave comments to improve my material :wink:

A bunch of screenshots with the outcome of the different techniques used.

Close-up of the tiling version of the material with no techniques applied:

Close-up of the material with the original TextureVariation node (notice the misaligned normals):

Close-up of the material with the modded TextureVariation node:

Far view of the tiling version of the material with no techniques applied:

Far view of the material with the original TextureVariation node (notice the misaligned normals):

Far view of the material with the original TextureVariation node (notice the misaligned normals):

1 Like

Great work! :slight_smile:

1 Like

Thanks :smiley:

1 Like