Amplifying your potential.

height to normal, or rotating tangent space normal maps

Your feedback is very important to us. We are listening.
6 posts • Page 1 of 1

height to normal, or rotating tangent space normal maps

Postby Turchik » Wed Feb 13, 2019 6:08 pm

Hi, I'm working on a project with really simple decals. They are just flat planes mapped to textures. We have tangent space normal maps that are created for them. We are using uv rotation rather than local object rotation, ( not my call), and the normal maps don't update. I've seen some normal map update "solutions" but generally on teh same thread i see people saying they don't work I've attempted a few but couldn't get it to work.

For our simple project it would seem to make sense to instead use a height map rotate that and convert it to normal after rotation. The provided Normal Create function seems to be what I want to use but I'm not sure how to pass/convert the data to it in sampler 2d form, or if i could use a different data type to achieve the same thing.

Thank You,
Attachments
normal_convertt.jpg
normal_convertt.jpg (236.99 KiB) Viewed 95 times
Turchik
 
Posts: 3
Joined: Wed Feb 13, 2019 5:54 pm

Re: height to normal, or rotating tangent space normal maps

Postby Amplify_Borba » Fri Feb 15, 2019 11:50 am

Hello, thank you for getting in touch and for your support!

Rather than modify the NormalCreate Shader Function, I'd recommend that you copy its contents and either create a new function, or adapt them to your shader.

I believe that you could try to use Texture Samples set as Reference to the Heightmap sampler with custom UVs in this situation:

Image

It would turn out into something like this:

Image

Please let me know if this helps.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: height to normal, or rotating tangent space normal maps

Postby Turchik » Tue Feb 26, 2019 7:37 pm

ah... ok i think i see the flaw in my logic the uvs are being rotated not the texture map itself. so the texture map will always render the same. I was thinking I was rotating a height map and it would be recalculated in 2d space

I found "solutions" to normal map rotations but not sure if they actually work.
https://forums.unrealengine.com/develop ... ormal-maps

Thank you
Turchik
 
Posts: 3
Joined: Wed Feb 13, 2019 5:54 pm

Re: height to normal, or rotating tangent space normal maps

Postby Amplify_Borba » Fri Mar 01, 2019 12:06 pm

No problem! In regards to the post you've shared, we do offer a Rotate About Axis node that should help you accomplish that.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: height to normal, or rotating tangent space normal maps

Postby Turchik » Fri Mar 01, 2019 5:18 pm

Ya I saw the Rotate About Axis node but unfortunately I'm not currently skilled enough to figure it out. There were doubts as well on the other post. I know I've heard of some a games using a world space normal maps and they are then converted to tangent space in the shader.
https://polycount.com/discussion/101157 ... normal-map

Thanks
Turchik
 
Posts: 3
Joined: Wed Feb 13, 2019 5:54 pm

Re: height to normal, or rotating tangent space normal maps

Postby Amplify_Borba » Thu Mar 07, 2019 12:21 pm

As an example on how to use the Rotate About Axis node, you first need to go to your Output node properties, hit the Vertex Output dropdown and select the Absolute option as we will be setting absolute vertex positions on the Output node.

Then you can use the Rotate About Axis node to perform the rotation over the vertex position as it performs a rotation on a given position about a specified axis.

You can also specify a pivot point to where the rotation will occur.

In the example below we are doing a rotation on the current vertex position about the object local y axis:

Image

One other thing to take into consideration is that the vector you supply as the rotation axis must be normalized.

If its not, you can either normalize the axis vector through a Normalize node before connecting it to the 'Normalized Rotate Axis' input port, or you can go to the Rotate About Axis node parameters and enable "Normalize Axis".

You can do the exact operation over the vertex normals, simply use the Rotate About Axis with the Vertex Normal instead and connect it to the Local Vertex Normal input port over the Output node
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


6 posts • Page 1 of 1

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron