Material - Tree: Difference between revisions

From Bohemia Interactive Community
Category: Arma 2: Editing
m (Text replace - "{{enHeader}}" to "")
m (Some wiki formatting)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Shader for trees in {{arma2}} which instead of diffused and ambient attenuation uses lightmap from alpha-channel of MC map.
Contrary to other shaders its diffuse component will always be used, not just only until fadeaway of casted shadows.
RGB values from MC map - macromap thus second colormap wihtin 2UV set are here multipled with main diffuse (CO) map within 1.UV set.
=== Example of such material ===
<syntaxhighlight lang="cpp">
ambient[] = { 1.000000, 1.000000, 1.000000, 1.000000 };
diffuse[] = { 1.000000, 1.000000, 1.000000, 1.000000 };
forcedDiffuse[] = { 0.000000, 0.000000, 0.000000, 0.000000 };
emmisive[] = { 0.000000, 0.000000, 0.000000, 1.000000 };
specular[] = { 0.501961, 0.274510, 0.109804, 1.000000 };
specularPower = 120.000000;
PixelShaderID = "Tree";
VertexShaderID = "TreeNoFade";


class Stage1 // Normal map
{
texture = "ca\plants2\Tree\data\t_fagus2s_0_NO.tga";
uvSource = "tex";
class uvTransform
{
aside[] = { 1.000000, 0.000000, 0.000000 };
up[] = { 0.000000, 1.000000, 0.000000 };
dir[] = { 0.000000, 0.000000, 0.000000 };
pos[] = { 0.000000, 0.000000, 0.000000 };
};
};


Shader for trees in ARMA 2 which instead of diffused and ambient attenuation uses lightmap from alpha-channel of MC map.
class Stage2 // Light mapa
Contrary to other shaders it's diffuse component will be used always not just only until fadeaway of casted shadows.
{
RGB values from MC map - macromap thus second colormap wihtin 2UV set are here multipled with main diffuse (CO) map within 1.UV set.
texture = "CA\plants2\Tree\Data\t_fagus2s_koruna_1lod_MC.tga";
uvSource = "tex1";
class uvTransform
{
aside[] = { 1.000000, 0.000000, 0.000000 };
up[] = { 0.000000, 1.000000, 0.000000 };
dir[] = { 0.000000, 0.000000, 0.000000 };
pos[] = { 0.000000, 0.000000, 0.000000 };
};
};
</syntaxhighlight>


===Example of such material===


ambient[]={1.000000,1.000000,1.000000,1.000000};
{{GameCategory|arma2|Editing}}
diffuse[]={1.000000,1.000000,1.000000,1.000000};
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
emmisive[]={0.000000,0.000000,0.000000,1.000000};
specular[]={0.501961,0.274510,0.109804,1.000000};
specularPower=120.000000;
PixelShaderID="Tree";
VertexShaderID="TreeNoFade";
class Stage1 // Normal map
{
  texture="ca\plants2\Tree\data\t_fagus2s_0_NO.tga";
  uvSource="tex";
  class uvTransform
  {
  aside[]={1.000000,0.000000,0.000000};
  up[]={0.000000,1.000000,0.000000};
  dir[]={0.000000,0.000000,0.000000};
  pos[]={0.000000,0.000000,0.000000};
  };
};
class Stage2 // Light mapa
{
  texture="CA\plants2\Tree\Data\t_fagus2s_koruna_1lod_MC.tga";
  uvSource="tex1";
  class uvTransform
  {
  aside[]={1.000000,0.000000,0.000000};
  up[]={0.000000,1.000000,0.000000};
  dir[]={0.000000,0.000000,0.000000};
  pos[]={0.000000,0.000000,0.000000};
  };
};

Latest revision as of 19:06, 25 February 2026

Shader for trees in Arma 2 which instead of diffused and ambient attenuation uses lightmap from alpha-channel of MC map. Contrary to other shaders its diffuse component will always be used, not just only until fadeaway of casted shadows. RGB values from MC map - macromap thus second colormap wihtin 2UV set are here multipled with main diffuse (CO) map within 1.UV set.

Example of such material

ambient[] = { 1.000000, 1.000000, 1.000000, 1.000000 };
diffuse[] = { 1.000000, 1.000000, 1.000000, 1.000000 };
forcedDiffuse[] = { 0.000000, 0.000000, 0.000000, 0.000000 };
emmisive[] = { 0.000000, 0.000000, 0.000000, 1.000000 };
specular[] = { 0.501961, 0.274510, 0.109804, 1.000000 };
specularPower = 120.000000;
PixelShaderID = "Tree";
VertexShaderID = "TreeNoFade";

class Stage1 // Normal map
{
	texture = "ca\plants2\Tree\data\t_fagus2s_0_NO.tga";
	uvSource = "tex";
	class uvTransform
	{
		aside[] = { 1.000000, 0.000000, 0.000000 };
		up[] = { 0.000000, 1.000000, 0.000000 };
		dir[] = { 0.000000, 0.000000, 0.000000 };
		pos[] = { 0.000000, 0.000000, 0.000000 };
	};
};

class Stage2 // Light mapa
{
	texture = "CA\plants2\Tree\Data\t_fagus2s_koruna_1lod_MC.tga";
	uvSource = "tex1";
	class uvTransform
	{
		aside[] = { 1.000000, 0.000000, 0.000000 };
		up[] = { 0.000000, 1.000000, 0.000000 };
		dir[] = { 0.000000, 0.000000, 0.000000 };
		pos[] = { 0.000000, 0.000000, 0.000000 };
	};
};