Texturing with Blender (for CineMut Opaque shader and La Grande noodle)
Let us begin with Blender materials. Each material index, in Blender, has 3 RGBA colors, called Diffuse, Specular and Mirror. We'll be using the color channels in a different way from what was intended:
Diffuse <= "Albedo"
R = albedo red G = albedo green B = albedo blue A = not used (left at 1.0 default)
Specular <= "Specularities"
R = Specular/Diffuse balance G = Dielectric Blend B = Dielectric Constant A = not used (doesn't exist)
Mirror <= "Miscellaneous"
R = shininess G = detail blend B = not used (vacant slot; leave at 0.5 if you want) A = not used (doesn't exist)These three colors are already set up for each material in the library. You just import a material you want from the library, select polygons you want to paint with that material, and assign it to them. Some materials, such as paints, are only given in a handful of colors, and it is up to you to adjust the base color to your needs or liking.
Once all materials are assigned (and assuming we've already done a UV unwrapping of the model), we can simply bake the materials to textures. As of this writing, Blender doesn't have a means to bake specular color or mirror color to a texture; but that is easy to get around. Be sure to save first, as we will modify the materials to do the bakings, and then discard the .blend file.
Saved? Okay.
- Render bake texture-only and save, targa format, as “albedo_in.tga”.
- Hit F5 to go to the materials panel. Go through all the materials, hitting the specular color. In the popup, you'll see a hex number at the top. Click on it and Ctrl-C to copy. Close the popup and hit the diffuse color. In the popup hit the hex number at the top and Ctrl-V to paste. Once you've done this for all materials, render-bake texture-only and save as “specular_in.tga”.
- Do the same as in (2) above, but this time copying the Mirror color to Diffuse. Render-bake texture-only and save as “glow_in.tga”.
- Exit Blender without saving the file.
So, from Blender we do 3 material bakes, and save them to textures named albedo_in.tga, specular_in.tga and glow_in.tga. You might ask, why not .png? Well, tga is a lot faster to write and load, and you'll need in the vecinity of a few *GIGS* of disk space to use LaGrande, anyways, because LaGrande will save and load a lot of intermediate textures, and for them it uses Open EXR format, which uses 16 or 32 bits per channel for higher precision, and a 2k x 2k texture takes up 32 or 64 megs on disk. And you might ask “why so much precision?”. Well, because LaGrande does a lot of work with the textures; –many, many math operations and blendings and whatnot, and does it all at 32-bit precision–, but if we saved all the intermediate textures in standard 8-bit per channel format we'd lose precision to quantization at each step along the chain, and end up with more artifacts than intended features.
And, by the way, I've mentioned this before, but might as well mention it again: The way to work in texturing is to work at 4x the final resolution. For a fighter, final resolution should be 512, so we should be working at 2048. The final LaGrande noodle in the chain will do the scaling down for you. All textures are reduced to 25% of the working size, except the normalmap, which is reduced to 50%.
Before you say that 512 is not enough for a fighter, take a look here:
PU's Demon (mesh by Brad Mick and chuck_starchaser; texture by chuck_starchaser).
![]() demon_shader.jpg | ![]() demon_shader2.jpg | ![]() final1.jpg | ![]() final2.jpg | ![]() final3.jpg |
![]() final4.jpg | ![]() final5.jpg | ![]() final6.jpg | ![]() final7.jpg |
That's with 512 x 512 textures and a 1024 x 1024 normal map. So, 512 is enough; isn't it? Before this craps
out into a long discussion, let me list the reasons why we want to keep texture sizes down:
- The most important thing about texturing is getting the materials right, rather than detail size.
- Most of the time you see ships swooping past at high speed, or at a comfortable viewing distance.
- Most people worry about polygon count; but today's videocards have ample geometry capabilities. What slows down videocards is texture sizes.
- We are using 5 textures plus detail texture plus environment map, and all textures except the environment map have alpha channels stuffed with extra info. What we lose in resolution we gain in per-texel info.
- We are using a detail texture, which adds graininess at far down the sub-texel level, which masks away any pixelation at close range.
- Most games fail to convey the relative sizes of things, which is partly due to a lack of modesty when it comes to texturing: Modelers and texturers alike are misled to believe that texture size is a secondary factor to performance, so they insist on larger textures. In the end, every model, be it 20 meters or 20 kilometers, end up having textures of roughly the same size. Ideally, we'd have a universal standard texel size, such as 2 inch by 2 inch at model scale. Such a standard is not realistic, though, in the sense that even at 512 for a fighter, some ships are so large they would need 16k by 16k textures to have equivalent texel sizes. So, the next compromise down is to at least have an ad-hoc standard: Small ships are 512. Medium ships are 1024. Large ships are 2048. Space stations use 4096 textures. Thus, the argument that we [i]could[/i] use 1024 for fighters just “because the videocard [i]can[/i] do it” is not a valid argument: Can the videocard do 8192 for space stations? NO? Then it cannot do 1024 for fighters. There needs to be at least a monotonic correspondance between texture size and actual object size, to convey the relative scale (size) of objects.
As for why is the normalmap twice the size of the other textures, that's because the normalmap *needs* twice the resolution. Take the case of a rivet, for instance: One texel is enough in specular to show that the rivet is shiny, for instance; but the normalmap needs four normals to show its curvature. Besides, by its very nature, the normalmap shows us detail as luminosity modulations and interplays. Our eyes see more detail in luminosity than they see in chromaticity. This is an old trick used in VHF/UHF TV signaling: The video signal is split into luma and chroma; and luma gets twice as much bandwidth as chroma. That is, the color you see on color TV is actually pretty blurry; it's the brightness modulation that contributes image sharpness. So we have a lot to gain from using higher resolution in the normalmap; but much less to gain from using higher resolution in the other textures.
I would strongly recommend for someone getting started with the new shaders and LaGrande to start small: Pick a small fighter for your first job. First time around, you'll make A LOT of mistakes, and you don't want to wait all night for the bakes, only to find you forgot something. After you've done two or three fighters, try a medium-sized ship, like a corvette, and so on. If so, then you'll be working at 2048, and your final texture size will be 512, –except the normal map: 1024.
And, why work at 4x the final resolution? Simple answer: The quality of the result. No comparison. Look, our eyes and brains can actually “make-out” finer detail than we actually see. We pick up the most subtle hints and reconstruct stuff that isn't even there. We do that all the time when we watch TV or look at pics on the net or in magazines and newspapers. Our visual abilities are remarkable. If you do a good job at 2048, with a lot of detail, the 512 reduction will look a lot more realistic than you could possibly achieve working at 512 resolution. Besides, a lot of the LaGrande transformations use non-linear math nodes and blending modes; so the result of averaging 16 pixels into one and putting that through the pipeline is not the same as putting 16 pixels through the pipeline and then averaging the result. So, we get much better antialiasing. Trust me: When you work at a higher resolution and then reduce the final texture, the result *looks* like it comes from much higher resolution (perhaps infinite; –i.e. photo of a real object?) and makes the texture all the more believable.
The 3 material texture bakes are certainly not the only bakes you'll need from Blender… You'll need to, first of all, add Multires modifier and have a higher subdivision version of the mesh. First and most obvious use for that is baking a normalmap, to smooth the artifacts of Gouroud interpolation. But this high poly mesh is also the one you use to bake the ambient occlusion, damage ao, frontal bake and static lightmap radiosity baking. VERY important. Do NOT waste your time radiosity baking onto the coarse mesh. The baking will look all polygonated. You also need to bake a simple uv_mask_in.tga by making all materials white and the background black, and bake texture only with 0 (zero) padding (for all other bakes use maximum padding of 32). And besides bakes, you'll need to supply textures of your own making, including a height-map and rust masks. Once you're ready for LaGrande, LaGrande will be ready for you.













