Importing and configuring Normal Maps at runtime ?

Hi,

I’d like to know if it’s possible to import normal maps at runtime ?

Until now, I was importing all the textures I needed and configuring them in the Editor (selecting the right type of texture, adjusting the bumpiness value for the normal maps, etc). Is it possible to do it by code ?

Each texture has it’s own behavior and the bumpiness value isn’t always the same from one to another, so I have to set this parameter, but I don’t know if I can access it via script.

Thanks !

Why not just use proper normal maps instead of having unity create them via heightmaps and the bumpyness value?

i’ve tested runtime normal map generation here,

but its not really that good solution… (also those normal maps generated in runtime need modified shaders to make it work… check the link from that post for more details on that)

I managed to do what I want.

I created proper normalmaps from the heightmaps I had (as suggested by cmcpasserby) with CrazyBump. Then I created a custom Bumped Diffuse shader to handle non-NormalMaps textures. And now it works !

Thanks for the answers ! :slight_smile: