Normal Map Generator (from diffuse maps)

Started by
18 comments, last by maxest 8 years, 4 months ago

I bet someone can make use of this :)

http://polish-game-developer.blogspot.com/2015/03/normal-map-generator-from-diffuse-maps.html

Advertisement

There are photoshop and gimp plugins for normal maps already. Also, normal maps should never be generated from diffuse maps directly. They always come out looking horrible because artistically it just highlights the contrasting parts of the diffuse and you get no actual surface representation. Same thing with specular, never just take a diffuse and make it grayscale. Both ways produce awful results.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Sometimes you simply don't have "curvature data" and want to have *any* normal maps :P.

Do these plugins work in command-line?


Do these plugins work in command-line?

Photoshop can operate in batch mode, and it's possible to trigger that from the command line, so... not really, but sort of.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Thanks. How does the result compare to for instance shadermap2 or crazybump? Which I both find give "clayish" resulting normals maps (unless I'm doing something wrong)

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Sometimes you simply don't have "curvature data" and want to have *any* normal maps tongue.png.

What I mean is, it is fine to take a picture etc and convert to a normal map. Just don't use the same source image as the basis for your D,S,N maps. They will have the same parts with the same contrast and it always looks awful. Use different images to generate all 3 if you are doing it that way.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

@cozzie: hard to tell since I dropped the idea of using crazybump as soon as I realized I would need to click over so many files. I think it's just best if you just try my tool's results against those from crazybump and see it for yourself :).

@swiftcoder: the downside of this solution is that, well, you need Photoshop in the first place :P. GIMP is a free alternative so probably that could work using it in batch-mode.

@dpadam: not sure what you mean. So as input I have one diffuse map. What do you mean by "use different images"?


@dpadam: not sure what you mean. So as input I have one diffuse map. What do you mean by "use different images"?
What he means is that a diffuse has no depth information, so when you generate a normal map from a diffuse map like this you aren't generating a normal map that actually conforms to the shape of the surface, but rather one that conforms to the shape of a surface whose depth is described by the areas of light and shadow within the diffuse map. So it's not quite right. If you use the same texture for diffuse that you also use to generate a normal map, then those "not quite right" normals correspond directly with the areas of light and shadow in the diffuse. With some textures, it can accentuate the "not quite right"-ness, because it becomes quite obvious that the normal map doesn't accurately represent the shape of the surface. So it can be helpful to generate the normal map from one photograph or diffuse texture, but to use it with another whose areas of light/dark do not correspond with the areas used to generate the normal map.
Programs like crazybump have options for shape recognition, which attempt to make a guess at the actual shape of the surface given the lightness/darkness of the diffuse. It's often not a very good guess, but given the right diffuse maps it can work okay.
I have seen descriptions of lighting rigs that operate by taking multiple photos of a given surface being lit from different directions, and using the different lighting angles to recreate an approximation to the actual normal of the surface being photographed. It requires some setup and work, but the result is quite a bit more realistic than just naively using a single lit diffuse map.

Well I am totally aware of the fact that normal map generated from just a diffuse map can be far from being correct but for a great deal of textures it will be just fine and players won't even notice it.

We're not living in idealistic or not-time-constrained world :P. I'm making a commercial game and *quickly* needed normal maps for some of the assets and the solution I came up with did the job for me :).

I'm making a commercial game

Then you should definitely swap a couple normal textures in game to see the difference it makes when sourcing different images, whether for this project or the next. It is a huge difference. I've never had a good result doing what you are suggesting, even though I did it for a while too.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement