Rotate mesh to nornal

by dotminic   Last Updated July 11, 2019 20:13 PM

I have some instanced geometry (basic tube meshes) laid out in a grid, and I have a noise texture (normal map) that I want to use to rotate my instances with. So head pixel in my texture is a normal and I want to rotate each instance with the corresponding normal in a shader. How can I achieve that in a shader only? Unless I am mistaking, there should only be a rotation around the x and z axes.

Thanks.



Related Questions


Updated September 01, 2017 16:13 PM

Updated April 23, 2015 22:05 PM

Updated April 23, 2015 22:05 PM

Updated April 05, 2015 16:05 PM

Updated April 27, 2015 23:05 PM