Hi everyone… does anyone know how to make the GLSL bump mapping script use just a normal map without requiring a height map… the reason is I’ve been messing about with the sculpt tool designing a simple pillar… I then render out the normal map… apply it to the low resolution version of the model…
So I would like to be able to have a colour map, a lightmap, a baked normal map with the height set via the script?.. because I dunno how you would make a heightmap out of a modelled normal map…or if you even need to have one? It might take the depth values from the image for all i know?
Here’s a picture that I hope illustrates the normal map I want to use. Even some comments in the GLSL script would be helpful…
also what I how would you make the GLSL script use different UV’s now that blender has them… made using preview14
i’m trying to do the same thing your doing, and I dont think a height map is necessary, but I cant write GLSL scripts and i barely know any python so i’m kinda stuck too at the moment
You only need a height map for parallex mapping, a standard normal map shader just needs a normal map - check the “bump map” demo in the 2.42 graphics demos. To add your lightmap, you’ll need to add another uniform sampler and multiply the final light colour with the lightmap sample.
Also, note your baked normal map isn’t going to work there unfortunately. The current render baking doesn’t bake tangent space normals, which you need here, hopefully it won’t be too long before that’s possible.
prianiac I thought all normal maps used tangent space normals and that parrallelax and normal bump mapping where the same thing?..so what’s the difference?
Normal mapping uses normals encoded in a normal map when calculating the lighting per pixel, rather than using the interpolated vertex normals - parallax mapping is an extension to this where parts of the texture appear to actually occlude other areas. So if you look at a stone wall from a shallow angle, some of the stones sticking out will block other parts of the wall. Parallax mapping fakes this by distorting the texture coordinates using the height and normal map. Basic normal mapping just shades the surface as if those stones were sticking out, but doesn’t actually block any part of the texture.
With regards to your normal map: lighting is calculated in view space, so the surface normals from rendering are also in view space. Unfortunatly that makes them only correct from that particular view, so you need to convert them
into some other space to store them, and that’s tangent space. In tangent space the normals are relative to the underlying surface, that way you can convert them into any view space for lighting and they’ll be correct.
You can see roughly whats happening, the Z axis (which is stored in the blue component) points directly out from the surface so the map should be mostly blue in tangent space.
Wow, sorry for the wordy reply, hope that makes some kind of sense!
Do you know how to convert the map from view space to tangent space…? I think the Nvidia plugin might do it… plus you can use it to make the height maps… anyway I’m trying to find a way of doing the conversion…