Jump to content
Sign in to follow this  
Miroslaw Kowalski

_as texture tutorial

Recommended Posts

Hey guys,

 

I was looking into how to create an _as texture for a weaon I've modelled and configged and I remembered that I watched a tutorial on it once but I don't remember how it was called. Does anyone know of a tutorial that could've been it?

 

Thanks in advance

Share this post


Link to post
Share on other sites

AS stands for Ambient Shadow but the standard name in most other applications is Ambient Occlusion map or AO map.

 

You bake it from your 3D models, either using modelling software capable of baking textures and materials (3DS Max, Maya, Blender, Modo etc.) or using external applications (such as xNormal which is free, or Knald which looks better but is not free). Baking AO is not something you can do in Object Builder and it would be very time consuming to manually paint an AO that matches the shadow projection from the 3D model, in Photoshop.

 

Example of Ambient Occlusion baking in XNormal:

 

Doing it properly you would create a high poly model and bake the smaller details from the high poly to your low poly to generate both the normal map and ambient occlusion (lots of tutorials about that online using the software I mentioned previously). However, I appreciate that not everybody has the means to bake from high poly sources like this, and will make use of 2D plugins to generate normal maps instead. But if you're generating the normal map, AO map etc. without baking from a high poly it's harder to get some of the small shadow details from surface objects to appear in your AS, and does require more manual work to enhance the shadow details missing in your low poly game model.

 

Some commercial software used to make normal maps from 2D sources (such as Quixel's nDo) have a feature where you can convert a normal map to something that works reasonably well as an AO. You can then multiply this on top of your xNormal's occlusion output from the low-poly model, without having to have made a high poly mesh.

 

You can also attempt to generate some shadow-like details from a normal map using xNormal's Cavity Map converter and overlaying that on your baked AO output to add enhanced details as well, but the results aren't as good:

http://www.donaldphan.com/tutorials/xnormal/xnormal_occ.html

 

If you're manually making the normal map though you can also generate some shadows for your AO by applying a Drop Shadow effect to the layers you're using to generate the height information for the normal map, and again; attempt to multiply these with the baked AO from xNormal.

  • Like 1

Share this post


Link to post
Share on other sites

Addendum

Doing it properly you would create a high poly model and bake the smaller details from the high poly to your low poly to generate both the normal map and ambient occlusion (lots of tutorials about that online using the software I mentioned previously).

You don't need the higher detail to bake the AO map. You can also use the lowpoly and render an AO map without highpoly. This will still be far superior to any 2D processing algorithm that pulls info from a normalmap.

Share this post


Link to post
Share on other sites

I know that - I indicated that you only need a low poly for a simple AO.

 

What I was saying there was that in order for the AO to have all the details that are contained within the normal map, you either need to bake both the AO and Normal from the same high poly source (the proper way), or manually convert details from your other 2D texture/materials to shading detail and add them on top of the AO you baked from the low poly.

 

For example here:

 

ocLKjtE.jpg

The blue/black parts are an AO I baked from a 3D model using xNormal (high poly to low poly in my case but for the sake of argument lets say it was a low poly to low poly). The real output material I'm applying to the model is baked @ 2048*2048 res.

 

After I baked the original AO texture I wanted to add some details to the normal map that didn't exist in the source mesh I used to generate the AO (details that I couldn't be arsed modelling in the high poly mesh): So I used 2D software to generate a normal map for these parts.

 

Because I have nDo2 to generate normal map details from 2D, I was able to convert these parts of the normal map directly to an approximate AO for the details that my 2D-sourced normal map was emulating. I then used Photoshop to multiply this converted 2D-sourced AO (shown in red) on top of my baked (blue) AO map in order to generate the final AO that contains details from both my source 3D model, and the normal map enhancements I made.

 

Without nDo2 I'd have had to manually generate the parts shown in red somehow, or just settle for the AO missing some details that might enhance the shading of the model ingame.

 

Final model with this enhanced AO applied looks like this in 3Do/Marmoset and like this in Arma 3. You can see that the additional occlusion shadows in the killflash mesh really bring out the detail of the normal map there, and allowed me to easily generate details in the diffuse/albedo/colour texture and specular+gloss.

Share this post


Link to post
Share on other sites

If you just save it as _AS.tga, the imageToPAA tool should automatically discard the information from RGB channels it doesn't need when it converts the _AS.tga to _AS.paa. If you write the stage in the .rvmat as _AS.tga, it will convert the material file to .paa when you view the model in buldozer and change file references from .tga to .paa in the .rvmat when you binarise the .pbo - the whole process is quite well automated.

 

_SMDI textures are pretty much the only ones where you need to do some manual channel tweaking to get the right results ("specularity" in G channel, "glossiness" in B channel, plain white in the R channel).

 

Buuuut, if you wanted to manually format it the channel information for the _AS rather than let the conversion tools do it:

 

Fill in the Red and Blue channels with white and just leave the greyscale information in the Green channel - Easy way to do this in Photoshop is to paste your AO bake on to a white background then in FX\Blending Options\ for the AO layer, uncheck the R and B channel boxes.

Share this post


Link to post
Share on other sites
class StageTI {
	texture = "#(argb,8,8,3)color(0.1,0.1,0.1,0.5,CA)";
};
ambient[] = {1.0, 1.0, 1.0, 1.0};
diffuse[] = {1.0, 1.0, 1.0, 1.0};
forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0};
emmisive[] = {0.0, 0.0, 0.0, 1.0};
specular[] = {0.5, 0.5, 0.5, 1.0};
specularPower = 85.0;
PixelShaderID = "Super";
VertexShaderID = "Super";

class Stage1 {
	texture = "PATH_TO_NOHQ.tga";
	uvSource = "tex";
	
	class uvTransform {
		aside[] = {1, 0, 0};
		up[] = {0, 1, 0};
		dir[] = {0, 0, 0};
		pos[] = {0, 0, 0};
	};
};

class Stage2 {
	texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
	uvSource = "tex";
	
	class uvTransform {
		aside[] = {1, 0, 0};
		up[] = {0, 1, 0};
		dir[] = {0, 0, 0};
		pos[] = {0, 0, 0};
	};
};

class Stage3 {
	texture = "#(argb,8,8,3)color(0,0,0,0,MC)";
	uvSource = "tex";
	
	class uvTransform {
		aside[] = {1, 0, 0};
		up[] = {0, 1, 0};
		dir[] = {0, 0, 0};
		pos[] = {0, 0, 0};
	};
};

class Stage4 {
	texture = "PATH_TO_AS.tga";
	uvSource = "tex";
	
	class uvTransform {
		aside[] = {1, 0, 0};
		up[] = {0, 1, 0};
		dir[] = {0, 0, 0};
		pos[] = {0, 0, 0};
	};
};

class Stage5 {
	texture = "PATH_TO_SMDI.tga";
	uvSource = "tex";
	
	class uvTransform {
		aside[] = {1, 0, 0};
		up[] = {0, 1, 0};
		dir[] = {0, 0, 0};
		pos[] = {0, 0, 0};
	};
};

class Stage6 {
	texture = "#(ai,64,64,1)fresnel(1,0.7)";
	uvSource = "none";
};

class Stage7 {
	texture = "a3\data_f\env_land_co.paa";
	uvSource = "tex";
	
	class uvTransform {
		aside[] = {1.0, 0.0, 0.0};
		up[] = {0.0, 1.0, 0.0};
		dir[] = {0.0, 0.0, 0.0};
		pos[] = {0.0, 0.0, 0.0};
	};
};

_NOHQ = Stage 1,  _AS = Stage 4, _SMDI = Stage 5

 

if you don't have a _smdi you can make a procedural one replacing the texture line with texture = "#(argb,8,8,3)color(1,0,1,1,SMDI)";

 

Keep the Red value as 1 but you can tweak the Specular Intensity with adjusting the Green value between 0 and 1, and Blue to adjust the Specular Power (glossiness). Though since the procedural produces a flat uniform colour, if you leave the blue at 1 you can adjust the overall glossiness by changing the master value at the top: specularPower = 85.0; The _SMDI's Blue channel is a per-pixel scalar for this master value.

Share this post


Link to post
Share on other sites

Shading errors more likely - your shadow LOD must be triangulated, closed geometry, with all sharp edges

Additionally it needs to be slightly smaller then the resolution LOD, otherwise it will permanently shadow the weapon. If you use max, use the push modifier to shrink the LOD down by ~1-2 mm

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×