Virtual texture normal map issue

Hi all. I’ve faced with strange issue related to virtual texture.

I use simple material for landscape which writes to virtual texture:

and in objects what should be blended with landsape in material I read from RuntimeVirtualTextureSample.

It works as expected if I place object without rotation:

But once I rotate object at least by Z azis, normals are broken (and lighting incorrectly calculated):

I suppose I need to turn normals to world alligned? But idk how to do it.

Does anybody faced out with similar issue?

Thanks!

PS: The issue only appears with normal map. Base color works as expected no matter what rotation object has.

Use a transform node to, well, transform between different coordinate spaces.
image

Also on the details panel for the material itself (click off a node into the grid) there is a checkbox for tangent-space-normals. If you want the material to work in worldspace with normals, you can uncheck this.

2 Likes

Awesome, thanks! Transform solved the issue. Meanwhile I’ve found, that simple world aligned material is suitable for this as well and much cheaper, but it requires little overhead on maps creation stage. Need to compare results later, but anyway good to have 2 solutions rather than one broken.

Normals off the RVT are in worldspace, so just keep that in mind whenever you sample off it. Hence the worldspace normals would likely work out for you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.