Jack Skieczius Posted May 22, 2010 Report Posted May 22, 2010 It has come to my attention a thread just as this is much needed for our community of developers. It is very important that we all know the tools at our disposal and how to use them properly to better our products.Normal maps and Specular maps have recently been added to our set of tools we can use as of X-plane version 9.41. For some these two things may seem very unfamiliar and I hope to help everyone reading this better understand what these are and how to use them.X-Plane uses combined normal and specular level maps in a single texture. This means, one image map, separate from the color maps we are all familiar with, uses the Red,green, and blue(RGB values from the image to make up the normal map and the alpha channel(transparency) for the specular maps. We have 3 types of maps now at our disposal, a color, normal and specular maps, all of which if combined right give a greater effect of realism to our airplanes.Now what is a normal maps? Simple put a normal map is similar to a bump map but goes beyond using only 8 bit color(black to white) to give depth, but instead it uses full RGB to give each pixel on the surface of a polygon a direction to point in without adding more geometry. Unlike bump maps, normal maps don't use brightness values to define depth but use a color system to define the angle at which the polygon reflects light. If this explanation did not help you understand a normal map then please visit http://www.bencloward.com/tutorials_normal_maps1.shtml where you can find a bit more in depth explanation.Here is a bit of extreme example of what a normal map might look like.Normal maps can be very useful in making rivets and aluminum deformations pop out as the light or shine casts over the mesh in sim. Any kind of dent that you don't want to add in as geometry you can do easily with a normal map. To give you another example, here is a link to the normal map I am using for the back half of my Q400. http://dl.dropbox.com/u/3449179/_FuseBack_NML.jpg Notice, its not as extreme as the first example. Subtly is the key, we don't want the rivets popping out like they are gashing holes in the fuselage. More on this later.Specular maps, are the maps we use to control the specular highlight or shine spot on any given spot of the object. With them we can make scratches stand out with a larger shine and we can make dirty smudge marks look less specular. These maps use the alpha channel of the normal map, using 255 values to tell the in game rendering engine what pixels have to be given a harder shine and what not to have any shine at all. For the values 255, all white, means it will shine 100% were a value of 1 almost black, will gives it almost no shine at all.Though not completely true, a specular map could be thought to be similar to a reflection map. When making them, one would think what pixels should be shinier then others, etc.Now you may be thinking, geez, how do I even go about making normal maps. Do I bake them? Do I need a fancy normal map generator? Do I need to make a high rez mesh? Fact is, none of those seem to be the best for our situation. I have tried a ton of different ways in making normal maps already, and for the most part i have found only one way that is both simple, and very effective.Start by making a bump map. yes that's right, we use a bump map to make a normal map.We start by making a simple map that uses a neutral color, 128,128,128 is the most neutral color you can get. then we paint on in which ever way we want the highs and lows of our texture. If the panel you want to pop out pops out, then take a white color or any value greater then our neutral gray and paint it on as such. And if that panel is suppose to sink in then make it a dark color.When done a bump map may look similar to the one I used on the back half of my Q400 linked here:http://dl.dropbox.com/u/3449179/_FuseBack_Bump.pngAs you can see, its subtle. Not everything is all white nor all black.Now for the tricky part. We need to convert this bump map we have made into a normal map. I do this by using the Photoshop plugin made by Nvidia found here:http://developer.nvidia.com/object/photoshop_dds_plugins.htmlGimp also has a normal map plugin for those who don't have Photoshop. Gimp is pretty cool and can be found here:http://www.gimp.org/Note: if you have the 64 bit version of Photoshop, the Nvidia plugin wont work for it, but thankfully it will work with the 32bit version which should also have been installed with Photoshop.These are the settings I used in my normal maps but you can test out several options and see what works best for you:This is the end result:Since Version 9.50 we have not had to flip any normal maps around at all so the end result here works fine right inside the sim. This has been a big time saver for me and surely everyone else using them.Now if you followed that ok you are probably now wondering how do I make specular maps and how do I fit them into the normal maps texture.First, we start similarly to how we made our normal maps. We need to think how specular the paint is on our planes. I used between 60%and 70% on mine. So we take out our calculator and find what value between 0 and 255 makes up 70%, or whatever value you wish. we take 256 and times it by .7 to get a result of 179ish. So this tells me I want the value of the specular map to site around 179,179,179 color value.I can set my canvas to a matte 179,179,179 and start paint now my scratches and smudge marks in. Make dirty, worn, smudges areas a darker gray and any scratch marks a brighter color.My specular map before i applied it to my normal map looked something like this:Now time to make both the normal and specular maps into one map.We start by opening both our images in photoshop, and dropping our specular map into our normal map as a second layer. So in our layer window we have the purplish normal map below our specular map.hide the normal map layer and select our specular map layer. Go up top to our menu bar and go to the "select" pull down and click "Color Range"Use the settings in this image then press ok.You will end up with a selection with the values of your spec map.Now we need to apply that to a layer mask. Hide the spec layer and make the normal map visible again and select it. Now click the Add layer mask button on the bottom of the layers area.Now we should have a layer mask out of our spec map that will make the normal map partly transparent.Now it would be nice to say we are done but we have one more step. We need to make sure there is no black values in our layer mask. To do with we simple select the mask(not the image, but the box that is the mask) and go to menu "Image" -> "Adjustments" -> "Levels..." and in that window under the "output levels" under the black side change the 0 to a 1 and press ok.If we did not do this last step some of our normal map values may be lost, this is just a thing Photoshop dose and may be different if you are using a different program.Now the very last thing we need to ensure is to go into out obj file in a text editor(notepad works fine) and edit the shine settings.go to the bottom of the text file and find the command, if you have one that reads ATTR_shiny_rat and makes the numbers after it be 1.0This will set the scale of the shine to what we desired from out specular map. 1.0 being 100%. if we set it to .9 we should get 90% of the spec map, and so forth.further reading on normals maps can be found in the X-plane wiki here:http://wiki.x-plane.com/Normal_MapsThanks for reading, and i hope this has helped anyone who reads it in understand these two maps a bit more. 1 Quote
WombatBoy Posted May 22, 2010 Report Posted May 22, 2010 Thanks for this I was really confused before. This will be of much help Quote
alxunru Posted May 23, 2010 Report Posted May 23, 2010 Great little read. Glad to see that you came to the same conclusions in the creation of normal maps that I came to for our purposes. I must be doing something right after all It really does add a new dimension to aircraft rendering in the sim. Thanks for sharing!Alex Quote
garrettm30 Posted May 23, 2010 Report Posted May 23, 2010 Just for fun, I would be interested to see this on a plane, or even a comparison of with/without the normal/specular map. Is that possible without much trouble? Quote
alxunru Posted May 30, 2010 Report Posted May 30, 2010 Garrettm30,Check this out.http://www.xpjets.com/2010/05/30/so-what-the-big-deal/We go into comparison of with vs without normal / specular maps and try to show some of the ways that the effects can be used to enhance the appearance of an aircraft CheersAlex Quote
garrettm30 Posted May 31, 2010 Report Posted May 31, 2010 Wow, I didn't expect such a thorough explanation. Many thanks. The extra detail looks really good, and I'm sure it will look even better when we can see it in live 3D. All those details will really pop out. It also helps that the modeling and texturing already look SO good. Quote
samen Posted July 24, 2010 Report Posted July 24, 2010 OKay I know old topic but, My A330 has normal maps etc and I have all the specific texture files included. What should I name the texture file containing the maps and should I just drop it into the objects folder or something like that? Quote
Leen de Jager Posted October 6, 2010 Report Posted October 6, 2010 Just a smal question.Reading the tutorial I get the impression the max value of the shiny rat setting is 1.0.I made several paints having a very shiny varnished propellor with metal edges.For this I used the value 3.0 with great succes.Making a bare metal plane with this setting would result in a plane as painful for the eyes as a real aircraft in the tropics.So for me I think 100% can be shiny rat 3.0 ( I did not try a higher number)All parts wich cannot use such a high value ( e.g tires) can be infulenced by the specular in the normal file.This way its even possible to have non glossy tires on polished and glossy hubs with dito brakedisks.Best regards and a big thank you for the tutorial.Leen de Jager Quote
Jack Skieczius Posted October 6, 2010 Author Report Posted October 6, 2010 Just a smal question.Reading the tutorial I get the impression the max value of the shiny rat setting is 1.0.I made several paints having a very shiny varnished propellor with metal edges.For this I used the value 3.0 with great succes.Making a bare metal plane with this setting would result in a plane as painful for the eyes as a real aircraft in the tropics.So for me I think 100% can be shiny rat 3.0 ( I did not try a higher number)All parts wich cannot use such a high value ( e.g tires) can be infulenced by the specular in the normal file.This way its even possible to have non glossy tires on polished and glossy hubs with dito brakedisks.Best regards and a big thank you for the tutorial.Leen de JagerInteresting, i had not thought of this before hand, so i thank you for brining this to our attention. i will test this myself a bit and see what values i can get and how it looks. Quote
Leen de Jager Posted March 17, 2011 Report Posted March 17, 2011 Please tell me what was the result?RegardsLeen de Jager Quote
Jack Skieczius Posted March 17, 2011 Author Report Posted March 17, 2011 It seems as though, and this would make sense, that the shine rat is just a multiplier variable. 1.0 would be 100% or at least 100% in the mind of OpenGL.Like many variables you are not limited by 100%, in fact you can go to 500% and more if you like.What is important to know if you will only get 100% with a shine rat of 1.0 if the image is NML file is purely opaque in the image, or rather at 0% transparent. so at 50% transparent, or grey, you would get 50% of a total shine rat setting.When i say 100% in the mind of OpenGL i mean, OpenGL was programed for a specific look to be applied at 100% specularity. Its not a definite look and can change based on other variables. What is important is it is up to the artist to decide where they want to set their Specularity.hope that helps. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.