TUTORIAL SULLE NORMAL MAP E IL PLUG-IN DELLA NVIDIA PER POHOTOSHOP.
In questo tutorial cercherò di spiegare come creare delle Normal Map precise, partendo da un oggetto 3D reale, creato con il 3DSMAX.
Cosa serve:
1. Il 3DSMAX o un programma di modellazione 3D qualsiasi che possa salvare in formato .RLA e visualizzare il rendering nel canale Z.
2.Il Photoshop
3.Il filtro Nvidia per Photoshop.
INIZIAMO:
La prima cosa da fare è crearsi la propria superfice in 3D, rispettando le altezze dei veri elemnti che si vorranno vedere più o meno in rilievo.
I materiali, i colori, le ombre e le luci, non hanno nessuna importanza, possiamo dunque tralasciare ogni particolare di questo tipo.
Teniamo sempre a mente che dovremmo cattuarare l'immagine frontale della nostra superficie e che sarebbe opportuno renderla perfettamente quadrata e tenerla al centro della nostra FRONT VIEW.
Passiamo al rendering il nostro oggetto.[/u]
Scegliamo di renderizzare in formato .rla.
Questo formato ci rende possibile visualizzare la "parte Z", ovvero la profondità in scala di grigi, prefettamente omogenea e pronta da usare per un bump mapping classico.
Ricordiamoci di selezionare una dimensione adeguata al rendering perchè le normal Map devono avere le classiche dimensioni "potenza di 2".
Nel nostro caso abbiamo scelto la dimensione 512x512.
Premendo su "Setup" potremo scegliere quali caratteristiche salvare alla nostra immagine.
Teniamo selezionata la casella "Z".
Possiamo ora procedere con il rendering.
Una volta renderizzato l'oggetto avremo la possibilità di visualizzare la parte "Z" della nostra immagine.
Ora, dovremmo "catturare" questa immagine.
Salvare con il classico tasto nel Max non è corretto, perchè non avremmo salvato "l'immagine Z" in scala di grigi che ci interessa, ma semplicemente il rendering normale.
Dobbiamo dunque catturare l'immagine con un qualsiasi "cattura schermo" o semplicemente con il tasto "stamp" della tastiera.
Salvata la nostra immagine in scala di grigi, possiamo ora aprirla con il Photoshop.
Ora andremmo a crare il canale alpha della nostra immagine per poter usare il filtro Nvidia su di essa.
Teniamo selezionati tutti i canali e ricordiamoci che l'immagine deve essere "flatten", cioè non deve avere layer dovrapposti.
Ora gingilliamoci con i parametri del filtro e aggiustiamoci le configurazioni come più ci aggrada.
E walà!
Questa quì sotto è un esempio di normal map per i personaggi/oggetti vari.
Entrambe le capoccione hanno 420 triangoli(è la stessa mesh), quella a destra però ha una normal map applicata (anche se ancora molto grezza). La differenza si nota.
Ciao!
---------------------------------------- ------------------
Incollo quì sotto parte di un topic del forum "cgtalk.com" che contiene svariati link a risorse, trucchetti e tools vari:
======================================== ========= FREE TOOLS
Nvidia has a Photoshop filter plugin to convert a grayscale bitmap to a normal map. Works OK, but geometry gives much better results, which it doesn't handle. The plugin has a helpful previewer, and many options. The normal map converter is also bundled in with their DDS exporter, if you wish to go that route.
http://developer.nvidia.com/object/...lm apfilter.html
ATI also has a 2D bump map generator, to convert images into normal maps, similar to the Nvidia tool.
http://www.ati.com/developer/sdk/ra...ol sPlugIns.html
ATI’s normal mapper generates normal maps from geometry and bump maps, works OK, is free, and is also open source. Comes with a handy previewer too. Lots of options. Comes with max3, max4, and max5 exporters to get your geometry into the tool. Now has a GUI too.
http://www.ati.com/developer/tools.html
Mike Bunnell’s modification of ATI’s tool that uses OBJ files instead of ATI’s NMF format. Optionally creates a sub-division surface for you. Creates displacement maps. Supports 16-bit TIFF. Etc.
http://subd.4t.com/normalmapper/
ORB is another normal map generator, converts 3D models into normal maps. Also generates displacement maps, diffuse maps, vertex-color maps. Imports ASE/OBJ/LWO formats. Previewer included.
http://www.soclab.bth.se/practices/orb.h tml
Discreet's utility plugin Normal Render works OK, but requires a similar UV layout between the low-res and high-res objects. This can be quite limiting. Not many options in the tool. Works with max4 and max5. Free registration is required to download the file.
http://sparks.discreet.com/download...fm ?f=2&wf_id=83
Ben Lipman’s gNormal plugin goes in the bump channel of a material, allowing you to use your normal map in the 3ds max renderer.
http://www.maxplugins.de/max5.php?search =gnormal
Ben Lipman mentioned on the Discreet forum that John Burnett's NormalTexture plugin can be used with max5’s Render To Texture to make normal maps. Not sure how this works, haven’t tried it.
http://www.footools.com/plugins/Doc...ur e_README.html
Texporter can create a normal map from high-res geometry, as long as the UVs are there. Although I should point out it is a world-space normal map, thus you shouldn’t rotate or deform the final model that has the normal map on it, because the shading will be horrible. World space normals are best for static objects in your game.
http://www.cuneytozdas.com/software/#Tex porter
Nvidia has a tool they're about to release called Melody. It can create the low-res model automatically (seems pretty good, as far as auto-LOD is concerned, but of course never as good as manual) and they wrap the whole thing in a GUI.
Some opinions here:
http://dynamic.gamespy.com/~polycou...TM L/002595.html
Peter Watje’s Object Texture plugin generates a normal map from geometry and places it in a material, so you can render it with the max renderer. However, the map is tied to actual geometry in the scene, or cached in the material, but it cannot be exported into a bitmap. I just thought I’d provide a link anyhow, since it comes with full source code.
http://www.max3dstuff.com/max4/matO...xt ure/help.html
======================================== ========== COMMERCIAL TOOLS
Polybump generates normal maps from geometry, optionally including height-map bump maps. Includes 3ds max and Maya plugins. Includes code for integrating the effect into your real-time 3D engine. Includes standalone viewer.
http://www.crytek.de/polybump/index.php? sx=polybump
Mankua's Kaldera is the best so far in my opinion. Not just because I helped them develop and test it, but because it is so flexible and works right in max. Lots of control over how the normals are generated. Bakes several channels at once… diffuse, lit, lighting only, normals, height, alpha, etc. Bakes multiple objects into one, including atmospherics. Comes with a handy normal map texture plugin, for using normal maps in the bump channel with the scanline renderer (also works in Brazil a friend tells me).
http://www.mankua.com/kaldera.cfm
======================================== ========== HOW TO VIEW NORMAL MAPS
Using the default viewport shader:
1. You need a graphics card that supports pixel shaders in DirectX.
2. Set the viewport to use Direct3D.
3. Set the Viewport Manager rollout of your material to use Metal Bump, and enable it.
4. Load your normal map in the Normal slot.
5. Set the viewport to Smooth.
6. The Metal Bump shader doesn't work on poly objects, must be mesh. Collapse to Editable Mesh or else add a Turn To Mesh modifier on top of the modifier stack.
7. I found the MetalBump shader also displays the normal map as the color map, at the same time. To stop this, I place a white bitmap in the Texture1 slot.
8. Can’t remember but I think this process also works in max 4.
Using a Cg viewport shader:
Ben Cloward explains how, and provides a sample shader...
http://www.monitorstudios.com/bclow...rm al_maps1.html
In the 3ds max 5 scanline renderer:
1. Gnormal is a freeware texture plugin. Put it in your Bump channel and load your map.
or
2. Kaldera is a commercial package that includes a texture plugin. Same process.
Steve Green mentioned on the Discreet forum that Mankua's plugin provided slightly sharper results than Ben Lipman's, when he compared them using with the same material settings. Ben may have modified his plugin based on this, not sure.
======================================== ========== ATI VS. NVIDIA
ATI and NVIDIA each use different normal map formats with their graphics chips.
Basically ATI expects the green channel to point the normal upwards, while NVIDIA expects it to point downwards.
The MetalBump shader in 3ds max uses the NVIDIA method.
Mankua’s Kaldera has the option to output either ATI or NVIDIA format. I’m not sure about the other tools.
One sure-fire method to fix a map that’s incompatible with your viewer is to simply invert the green channel in your image editor of choice. By inverting I mean the black pixels should be white, and the white pixels should be black.
======================================== ========== TIPS AND TRICKS
Ben Cloward posted a strong full-featured normal mapping tutorial on his site. It also has a lot of software-agnostic information.
http://www.monitorstudios.com/bclow...rm al_maps1.html
Gary Pate (a.k.a. Ionized) has a great tutorial using 3ds max and ATI's normal mapper.
http://www.ionization.net/tutsnorm1.htm
James Hastings-Trew describes normal maps in plain language, with tips on creating them in Cinema 4D.
http://members.shaw.ca/jimht03/normal.ht ml
Polycount thread containing tips about painting/editing normal maps.
http://dynamic.gamespy.com/~polycou...TM L/002497.html
Polycount thread explaining World Space vs. Object Space vs. Tangent Space.
http://dynamic.gamespy.com/~polycou...TM L/001876.html
Polycount thread dissecting Doom III’s use of normal mapping.
http://dynamic.gamespy.com/~polycou...TM L/000441.html
Digital Sculpting Forum threads about normal mapping/displacement extraction.
http://cube.phlatt.net/forums/spira...c. php?TopicID=9
http://cube.phlatt.net/forums/spira...ph p?TopicID=395
http://cube.phlatt.net/forums/spira...ph p?TopicID=581