Shaders

From WiCWiki

Jump to: navigation, search

Contents

Shaders Introduction

  • All objects are mapped with the principle of 256 pixels per 6 meter of a model. In other words, if you have a box with 6 meter sides, each side would require a 256x256p part of texture size.
  • Specular maps should be half of the original size of the diffuse texture. Same goes for Environment maps. This means that a 1024x1024 building should have no more than a 512x512 specular. And if that building has a 512x512 window texture, the Environment map alpha for that window should be 256x256.
  • Baked radiosity textures or Secondary UV sets are to be max half of the original texture, less is even better. These texture maps are used on objects that rely heavily on a tiled UVset (because they are huge). To get good shading and to avoid having the model look “tiled” and unshaded, we add a second UVset with totally unique and untiled coordinates in Modo or Lightwave modeler.

Image:UVset2_Pic1.jpg

This second UV set is used to create proper shading and bigger details, like dirt spots and similar. In other words it’s not for high resolution details. This second UV set is created to get an untiled look so remember to unwrap everything so that parts don’t share texture space. When you have made your second UV set to your model, you will us it to bake out an ambient occlusion map / radiosity map,

Image:Radbaked.jpg

and then apply this rendered image to your model in the Translucency channel.

Image:UVset2_Pic2.jpg


Explanations of Common Shaders

Explanation of the common shaders in the showbox:

The most common shaders used in the showbox (there are some others that are explained in different sections, like wrecks, cars etc)

are the Normalmap units, Normalmap specular bump rad (ground col), and environment map alpha.

All surfaces are explained in the right segment under the surface file tab in the showbox. Here you also have the instructions stating if you have to have specialselections in the options selection box.

Image:Surfacestab_showbox.jpg

Image:Surface_colors.jpg


Normalmap Specular Bump RAD (ground col)

(Note color coding is just for explanation, colored brackets are not shown in the showbox)



Colormap(Blue):

In Showbox In the right field, beside the texture chosen, you can see info about it. In this case, Color map (alpha=mask).

In Modo or Lightwave you apply the colormap in the color tab, if you apply the .PSD in Lightwave first the showbox will find your .DDS file automatically (if you made a DDS with an identical filename in the same folder). Apply your DDS file directly to your model if you are using Modo.

Image:Colormap.jpg


Height map(Green):

(No need to apply this in Lightwave or Modo before the showbox, push the tab to add it in the showbox)

This one is where you put your file which controls the bump. You can put in a unique texture in greyscale to be used, but you can also use your original colormap and then control/mask out which parts are going to be bumped or not by using the alpha in the specular map.

If you are using a unique Height map, skip the part with using the specular map as a controller since a unique map will give you the ability to create it just the way you like. 255 255 255(RGB) is Positive bump/height and 128 128 128(RGB) equals no bump, and lastly 0 0 0(RGB) value will make a negative bump. It’s gradient in between so play around with the values for desired effect.

Specular map (Yellow):

(No need to apply this in Lightwave or Modo before the showbox, push the tab to add it in the showbox)

Here you assign the specular map, and as an option you can control which parts are going to be masked out in the Height map channel.

You can control the height maps bump strength by using a gradient scale in the alpha of the specular map; where 128=No bump, 0=inverted bump).

Specular maps can be colorized so use colors in your specular maps if you want to.

Amount of specular: Values go from 255 255 255(RGB) (max spec/white) to 0 0 0 (RGB) (No spec)

Remember it’s gradient so play around with values to get your desired effect, and color influence if you want that.

Specular lookup ramp (Red)


Only in showbox:

This is the file saying how much the specular effect is spread over an area. You can make a unique map for any object.

Radiosity texture (Orange) :

In Showbox, you assign the baked lights map here.

Image:UVset2_Pic1.jpg


In Modo or Lightwave:

  • These texture maps are used on objects that rely heavily on a tiled UVset (because they are huge). To get good shading and to avoid having the model looking “tiled” and unshaded, we add a second UVset with totally unique and untiled coordinates in Modo or Lightwave modeller.

Image:UVset2_Pic1.jpg

  • This second UV set is used to create proper shading and bigger details like dirt spot and similar. In other words it’s not for high resolution details. When you have made your second UV set to your model you will use it to bake out an ambient occlusion map / radiosity map, and then apply this to your model in the Translucency channel.

Image:UVset2_Pic2.jpg

Then apply your texture in the Radiosity tab in the showbox.

Bonus info on Radiosity and UVset2

Radisoity or UVset 2 textures (explained previously): This texture is basically a gradient map with baked shadows in either Modo or Lightwave. These textures are behaving in a multiple fashion, think of it as a multiple layer in Photoshop. So in other words, used for shadows and creases and darker details.

Note that on small houses with a large amount of untiled area this in generally not needed (on an object having only uniquely mapped polygons this feature is pointless). In those cases you should make a radiosity map with the original UV set and then add this on your texture file.

When you have done your secondary UV set, and generated a Radiosity/ambient occlusion map from that secondary UV set, you need to add the rendered file to the objects Translucency surface. The function of the radiosity is mostly to get proper shading/shadows, but you can also add color to this map, a thing to keep in mind is that the surface is added similar to Multiplied layers in Photoshop. So you can’t “bright” up things.

Radiosity/UVset2 textures should never be as large as the original files, and should be as small as possible. Let’s say our original texture is a 1024x1024, then the

Radiosity map should be a maximum of 512x512, but try to keep it as low as possible. If you really don’t care about performance and want high detail you could of course make it just as large as the original map. If you mostly want to use the texture as a plain ambient occlusion map, it’s quite possible to have it as simple as 128x128 on a main map of 1024x1024 resolution.

Normalmap Specular Bump (ground col)

In the showbox: Use the same principles as above, but use this shader when you aren’t using a Radiosity/Second UV set!

Modo or Lightwave/Photoshop:

If you want the radiosity look, simply bake a radiosity map/ambient occlusion map with the UV map, then simply import your baked texture into a layer in the Main texture as an Multiply layer. Shift+drag the Rad file into the Main texture layers to get it to match the coordinates in Photoshop (make sure they have the same texture size)

NOTE! Only use the radiosity in the main texture on objects with none to very little tiling.

Image:Bakedrad.jpg

Normalmap Units

First of all assign the colormap, in your alpha in that map you control the bump values of the model. (greyscale bump in alpha, 0=Minimum bump/255=Maximum bump)

The second slot is where you assign your specular map.

UVSET2 on units and Rand textures are explained in the “How to create a Unit”

Environment map alpha

Assign the Color map, where the alpha channel defines transparency. 255 255 255 is totally opaque, and 0 0 0 is totally transparent. Play around with the alpha values until you get the desired amount of transparency.

Then, assign your Environment filter, which is a new texture, greyscale, 255 is max environment influence 0 is No environment influence.

Choosing shaders in the showbox

NOTE! I have only listed a few common ones here but there are several others that follow the same principle and have explanations in the showbox!

Image:choosingshaders.jpg

Check them out and see the different aspects. Normal Specular Bump and Normal specular Bump rad are the most common surfaces we use on props and buildings.

DXT formats, saving your file in Photoshop

DXT formats, saving your file in Photoshop:

Note! Remember to have the correct DXT format on your DDS file so you don´t get unwanted results in the showbox!

Note! DDS Plugin(for Photoshop) is available at http://developer.nvidia.com/object/photoshop_dds_plugins.html

All files are saved as *.dds to be read in the game engine. You create your .dds files in Photoshop.

Files having No gradient alpha/or no Alpha is to be saved as DXT1 (no alpha) or DXT1 (1 Bit alpha) (all DXT1 files "cost" the same in the game engine).

Textures having gradient alphas are saved as DXT5 (interpolated alpha) files.

DDS setting box appears when you save your .DDS file in Photoshop.

Image:alpha.jpg

Texture versions of the same object

Note! Texture versions of the same object have to be scripted into the system before it works in game. Read the Juicemaker documentation to learn how!

Note 2!

The engine supports up to 11 versions of the same texture, *_v2-*_v11


An object in the game has the ability to use texture alternatives to make the same object appear as a different object, to achieve this you can add an underscore followed by a version number ( _v*) to your texture. So lets say your object texture name is: Building_01.dds, then you would add a second version by naming it: Building_01_v2.dds. For a third version it would be: Building_01_v3.dds.


The same goes for your specular, radiosity/UV2, window and environment maps. All maps are capable to have a Texture version. So let’s say

our building object has an ordinary diffuse map, specular map, UVset2 map, window and window environment map, it would look like this:

Building_01_v2.dds

Building_01_spec_v2.dds

Building_01_Rad_v2.dds

Building_01_Win_v2.dds

Building_01_Win_Env_v2.dds

The important thing is that the texture maps should always end with _v* (*=Version nr).

If you only do, let’s say a spec map with texture name v*.dds, and don’t do the other ones, all of the other dds files, except the spec map will use the original version of the dds files. Sometimes you don’t have to redo the radiosity maps, for example, when the object remains the same. And in other cases you may want to keep a Specular map to use on all versions. So you aren’t obligated to do versions for all the different surfaces if you don’t want to.

All texture versions have to remain in the same folder structure as the original texture file.

Remember! Texture versions of the same object have to be scripted into the system before it works in game. But Winter and Desert variations are enabled by default as long as it’s on the default texture. No scripting! Winter and Desert Variations


Winter and Desert variations

By default a texture is used on all terrain types unless you have specifically named a texture with a "tag". A specifically "tagged" texture overrides the original file. Let’s say we have our example again, and want to make specific textures for winter and desert maps. Then the files would look like this:


Building_01_winter.dds

Or/and

Building_01_Desert.dds


You can use the same version system on these textures as well:

But then it will look like this(remember _v* textures need to be scripted first in this case too):


Building_01_v2_winter.dds

Or/and

Building_01_v2_desert.dds

Personal tools
User Created Content