Author Topic: Mapping a texture using a normal map or height  (Read 109 times)

Has anyone figured out a way or seen any type of graph or pixel processor that can map textures using a normal map? I want to create a filter that inputs a texture and normal map, then morphs the texture based on the normal map in a way that makes it appear to "wrap" around the normals. Something similar to overlaying a texture onto 3D geometry.

I honestly don't have a good reason to do this, except that I think it would make a cool filter that could be used to do some neat things. I've tried projecting the texture pixels using the normal vectors in a pixel processor, but can't seem to come up with anything that looks good. The texture pixels end up too distorted. The problem is that you can't compensate for any stretching you do in one pixel at another pixel because of how the pixel processor works. EG, if you shrink one, you can't expand it somewhere else to make up for it.

Anyone come up with something that does anything neat? Anything that maps texture over height or normals would be interesting. I'm not asking for a graph, just some advice.

Thanks!
Last Edit: April 01, 2019, 05:44:24 pm

You could convert the normal map into a height field, and then use a triplanar node to map your texture onto it.

You could also split the split out the R + G channels of the normal map, and warp your texture using the R channel, and then the G channel. 

This second approach would only distort the input texture in 2 directions (I.e. up and right, not up + down + left + right).  For a more sophisticated approach, you could split each channel in half again, mapping values 0-128 into one warp node, and values 128-256 in another with the angle set to opposite direction.

Hope these outlines make sense - can put together some visual examples if they don’t.