Jump to content
  • Advertisement
Sign in to follow this  
abdellah

normal map generating

This topic is 1339 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

There are tools which generate normal maps for example, NVIDIA photoshop plugin. 

 

If the original image is a height map then it is possible to generate a normal map from it. 

 

I'd suggest looking for existing tools on the google instead of creating your own code. 

 

Cheers!

Share this post


Link to post
Share on other sites


This is very possible.

 

This has been discussed in some other topic.

It is possible but it won't be real normal map. You'll just end up with some fake effect which most likely be on a scale from bad to terrible.

Share this post


Link to post
Share on other sites

It IS possible, but it is also by no means a simple function.

 

Such a program would have to detect edges and work out the lighting in the image to recreate its original geometry based on that flattened information.  To do it well, it would also have to recognize common shapes and structures in images based on machine learning.  We're talking bleeding edge AI and image processing here.

 

If you need this, go to MIT or Berkeley, graduate with a degree in some advanced field of computer science, become a doctoral student, and create it for your thesis along with a large team and all of the Intellectual resources the university has to offer.

On the plus side, you could then license the technology for potentially several million dollars.

 

 

Alternatively, hire an artist to turn your texture into a height map, and use a simple plugin to convert the height map into a normal map (which is easy and readily available).

A straight image, at this time, can't be converted into anything resembling a decent or remotely accurate normal map without human intervention.

Share this post


Link to post
Share on other sites

i wan it programmaticaly

what is the algorithm?

 

(in software , i use gimp but i want the algorithm)

Edited by abdellah

Share this post


Link to post
Share on other sites
Seriously,

Q: Is your original image a height map?

If so, you just need to read the surrounding pixels, and determine the the normal of that pixel. You can do this to varying degrees of fidelity.

Once you have the normal, convert it into RGB. A straight normal (right out of the texel) is 127,127,127. This is your default.

Tilting left and right (if you picture it on your screen) is lower and higher Red respectively, down to 0 for pointing left and up to 255 for pointing right.
Tilting up and down is lower or higher Green (working the same way as the Red).

If you want something really crude:

Just fetch one channel (height), from the left, right, up and down pixels relative to the one you're writing the normal for, should range from 0 - 255

R = right
L = left
U = up
D = down

Blue = 127
Red = 127 + (L/2) - (R/2)
Green = 127 + (U/2) - (D/2)

Share this post


Link to post
Share on other sites

ok, i have just one pixel, (for example), what is the math or algorithm operation to obtain the normal map (normal pixel) without consider that the original image it is a height map or regular map?

 

i know that RGB(127, 127 ,127) or RGB(0.5,0.5,0.5) means the GRAY color so this type of color (after applying that color to a regular map) gives no results???

Edited by abdellah

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!