Commit 6e375558 authored by Harmonikater's avatar Harmonikater
Browse files

Initial commit

parents
*.max filter=lfs diff=lfs merge=lfs -text
*.exe filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.dll filter=lfs diff=lfs merge=lfs -text
*.dds filter=lfs diff=lfs merge=lfs -text
*.vms filter=lfs diff=lfs merge=lfs -text
BF2 3dsmax tools changelist
September 21, 2005:
- BundledMesh shader now allows not having a normal map (Thanks Andy)
- New material technique overide option
Name a material with || in its name and everything after || will be used as final technique name in the mesh file
Example: myMaterial||ColormapGloss will result in a technique name "ColormapGloss"
If you are using alpha or such, put that seperate as everything including and after the || is not used in generating the mesh file (it is put in afterwards)
myMaterial_alpha||AlphaColormapGloss
Be sure to check out the /_BF2Help/ folder for documents on all the techniques used by the game
- Fixed staticmesh export for objects with DX9 "BF2_StaticMesh_A.fx" applied
Note: You can use a filename called none.dds to tell the expoter to skip that texture slot
31, August 2005:
\ No newline at end of file
# 3P Animation System
## Deriving Systems from existing templates
## Creating new templates
\ No newline at end of file
# Animations
## Import
## Export
## Animation Tools and Helpers
\ No newline at end of file
# BundledMeshes
## Materials, Textures and UVs
## Export
## Import
## Usage
### PlayerControlObject (PCO)
#### Tracked Vehicles
### Handheld Weapons
\ No newline at end of file
# Lightmapping
## Why lightmap in 3dsMax instead of BF2Editor?
## Full-Auto Lightmaps
## Custom Import Settings
## Manual Lightmap Settings
### Terrain Import
### Lights Import
### Statics Import
### Overgrowth Import
### Lightmap Sizes
### Static Test Render
### Static Full Render
### Terrain Test Render
### Terrain Full Render
### Converting Render Output
\ No newline at end of file
# Skinned Meshes
## Materials, Textures and UVs
## Skeletons
## Skin Weights
## Usage
### Soldier
### Kits
### AnimatedBundle
\ No newline at end of file
# Static Meshes
## Materials, Textures and UVs
### Base Layer
### Detail Layer (+DetailBump)
### Dirt Layer
### Crack Layer (+CrackBump)
### Alpha Channels
### Lightmap UVs
## Export
### Hierarchy
### LODs
### COLs
## Import
## Usage
### SimpleObject
### Bundle
### DestroyableObject
\ No newline at end of file
<
//////////////////////////////////////////////////////////////
// BF2 Interactive Shader Preview
// StaticMesh
// Modified by ProfessorDred to allow Normal Maps in Viewport
// Special thanks to Rexman and [BG]Smig
//////////////////////////////////////////////////////////////
float4x4 World : WORLD; // World or Model matrix
float4x4 WorldIMatrix : WorldI; // World Inverse or Model Inverse matrix
float4x4 mvpMatrix : WorldViewProj; // Model*View*Projection
float4x4 worldViewMatrix : WorldView;
float4x4 viewInverseMatrix : ViewI;
//////////////////////////////////////////////////////////////////////////////////////////////
float4 k_d <
string UIName = "Sun Color";
> = float4( 1.0f, 1.0f, 1.0f, 1.0f );
float4 lightMult <
string UIName = "Ambient";
> = { 0.15f, 0.15f, 0.15f, 0.0f };
// light intensity
float4 I_d = { 1.0f, 1.0f, 1.0f, 1.0f }; // diffuse
float4 lightDir : Direction <
string UIName = "Light Direction";
string Object = "TargetLight";
int RefID = 0;
> = {-0.577, -0.577, 0.577,1.0};
///////////////////////////////////////////////////////////
texture diffuseTexture : DiffuseMap<
string name = "color.dds";
string UIName = "Color";
int Texcoord = 0;
int MapChannel = 1;
>;
texture detailTexture : DetailMap<
string name = "detail.dds";
string UIName = "Detail";
int Texcoord = 1;
int MapChannel = 2;
>;
texture dirtTexture : DirtMap<
string name = "dirt.dds";
string UIName = "Dirt";
int Texcoord = 2;
int MapChannel = 3;
>;
texture crackTexture : CrackMap<
string name = "cracks.dds";
string UIName = "Crack";
int Texcoord = 3;
int MapChannel = 4;
>;
texture nDetailTexture : nDetailMap<
string name = "detail_nm.dds";
string UIName = " NDetail";
int Texcoord = 1;
int MapChannel = 2;
>;
float bumpHeight
<
string UIType = "MaxSpinner";
string UIName = " Detail Bump Height";
float UIMin = 0.0f;
float UIMax = 100.0f;
> = 5.0f;
texture nCrackTexture : nCrackMap<
string name = "cracks_nm.dds";
string UIName = " NCrack";
int Texcoord = 3;
int MapChannel = 4;
>;
float bumpHeightC
<
string UIType = "MaxSpinner";
string UIName = " Crack Bump Height";
float UIMin = 0.0f;
float UIMax = 100.0f;
> = 5.0f;
///////////////////////////////////////////////////////////
struct AppData {
float4 Position : POSITION; //in object space
float4 Normal : NORMAL;
float2 Tex0 : TEXCOORD0;
float2 Tex1 : TEXCOORD1;
float2 Tex2 : TEXCOORD2;
float2 Tex3 : TEXCOORD3;
float2 Tex4 : TEXCOORD4;
float2 Tex5 : TEXCOORD5;
float3 T : TANGENT; //in object space
float3 B : BINORMAL; //in object space
};
struct VS_OUTPUT {
float4 Position : POSITION; //in projection space
float2 Tex0 : TEXCOORD0;
float2 Tex1 : TEXCOORD1;
float2 Tex2 : TEXCOORD2;
float2 Tex3 : TEXCOORD3;
float2 Tex4 : TEXCOORD4;
float2 Tex5 : TEXCOORD5;
float4 Light : COLOR0;
};
struct f2fb {
float4 col : COLOR;
};
////////////////////////////////////////////////////////////////////////////////////////////
sampler2D diffuseSampler = sampler_state
{
Texture = <diffuseTexture>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
MipMapLodBias = 0;
};
sampler2D detailSampler = sampler_state
{
Texture = <detailTexture>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
MipMapLodBias = 0;
};
sampler2D dirtSampler = sampler_state
{
Texture = <dirtTexture>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
MipMapLodBias = 0;
};
sampler2D crackSampler = sampler_state
{
Texture = <crackTexture>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
MipMapLodBias = 0;
};
sampler2D normalSampler = sampler_state
{
Texture = <nDetailTexture>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
MipMapLodBias = 0;
};
sampler2D normalCrackSampler = sampler_state
{
Texture = <nCrackTexture>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
MipMapLodBias = 0;
};
/////////////////////////////////////////////////////////////////////////////////////////
VS_OUTPUT vsBase(AppData IN)
{
VS_OUTPUT OUT = (VS_OUTPUT)0;
// pass texture coordinates for fetching
OUT.Tex0 = IN.Tex0;
OUT.Tex1 = IN.Tex1;
OUT.Tex2 = IN.Tex2;
OUT.Tex3 = IN.Tex3;
float3 L = lightDir;
float3 P = mul(IN.Position,(float4x4)World); // position (view space)
float3 N = normalize(mul(IN.Normal,(float3x3)World)); // normal (view space)
float3 R = normalize(2 * dot(N, L) * N - L); // reflection vector (view space)
float3 V = normalize(P); // view direction (view space)
OUT.Position = mul(IN.Position,mvpMatrix); // position (projected)
float4 Diff = lightMult + I_d * k_d * max(0, dot(N, L));
OUT.Light = Diff;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetail(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
OUT.col = base * detail;
OUT.col = OUT.col * IN.Light;
OUT.col.a = 1.0;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetailNDetail(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
float4 bumpNormal = (2 * (tex2D(normalSampler,IN.Tex1)-0.5));
bumpNormal.xy = bumpNormal.xyz * bumpHeight.xx;
bumpNormal = normalize(bumpNormal);
float3 lightVector = 2 * (IN.Light);
lightVector = normalize(lightVector);
float4 bump = dot(bumpNormal.xyz,lightVector.xyz);
OUT.col = detail * base * bump * (IN.Light * 2.5);
OUT.col.a = 1.0;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetailDirt(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
float4 dirt = tex2D(dirtSampler, IN.Tex2);
OUT.col = base * detail * dirt;
OUT.col = OUT.col * IN.Light;
OUT.col.a = 1.0;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetailDirtNDetail(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
float4 dirt = tex2D(dirtSampler, IN.Tex2);
float4 bumpNormal = (2 * (tex2D(normalSampler,IN.Tex1)-0.5));
bumpNormal.xy = bumpNormal.xyz * bumpHeight.xx;
bumpNormal = normalize(bumpNormal);
float3 lightVector = 2 * (IN.Light);
lightVector = normalize(lightVector);
float4 bump = dot(bumpNormal.xyz ,lightVector.xyz);
OUT.col = detail * base * dirt * bump * (IN.Light * 2.5);
OUT.col.a = 1.0;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetailCrack(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
float4 crack = tex2D(crackSampler, IN.Tex3);
float4 color = base * detail * (1-crack.a);
color.rgb = crack.rgb*crack.a + color.rgb;
OUT.col = color * IN.Light;
OUT.col.a = 1.0;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetailCrackNDetailNCrack(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
float4 crack = tex2D(crackSampler, IN.Tex3);
float4 bumpNormal = (2 * (tex2D(normalSampler,IN.Tex1)-0.5));
bumpNormal.xy = bumpNormal.xyz * bumpHeight.xx;
bumpNormal = normalize(bumpNormal);
float4 bumpCNormal = (2 * (tex2D(normalCrackSampler,IN.Tex3)-0.5));
bumpCNormal.xy = bumpCNormal.xyz * bumpHeightC.xx;
bumpCNormal = normalize(bumpCNormal);
float3 lightVector = 2 * (IN.Light);
lightVector = normalize(lightVector);
float4 bump = dot(bumpNormal.xyz ,lightVector.xyz );
float4 bumpC = dot(bumpCNormal.xyz, lightVector.xyz);
float4 color = detail * base * (1-crack.a) * bump *(1- bumpC) * (IN.Light * 5.5);
color.rgb = crack.rgb * crack.a + color.rgb;
OUT.col = color * (IN.Light);
OUT.col.a = 1.0;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetailDirtCrack(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
float4 dirt = tex2D(dirtSampler, IN.Tex2);
float4 crack = tex2D(crackSampler, IN.Tex3);
float4 color = base * detail * dirt * (1-crack.a);
color.rgb = crack.rgb*crack.a + color.rgb;
OUT.col = color * IN.Light;
OUT.col.a = 1.0;
return OUT;
}
////////////////////////////////////////////////////////////////////
f2fb psBaseDetailDirtCrackNDetailNCrack(VS_OUTPUT IN)
{
f2fb OUT;
float4 base = tex2D(diffuseSampler, IN.Tex0);
float4 detail = tex2D(detailSampler, IN.Tex1);
float4 dirt = tex2D(dirtSampler, IN.Tex2);
float4 crack = tex2D(crackSampler, IN.Tex3);
float4 bumpNormal = (2 * (tex2D(normalSampler,IN.Tex1)-0.5));
bumpNormal.xy = bumpNormal.xyz * bumpHeight.xx;
bumpNormal = normalize(bumpNormal);
float4 bumpCNormal = (2 * (tex2D(normalCrackSampler,IN.Tex3)-0.5));
bumpCNormal.xy = bumpCNormal.xyz * bumpHeightC.xx;
bumpCNormal = normalize(bumpCNormal);
float3 lightVector = 2 * (IN.Light);
lightVector = normalize(lightVector);
float4 bump = dot(bumpNormal.xyz ,lightVector.xyz);
float4 bumpC = dot(bumpCNormal.xyz, lightVector.xyz);
float4 color = detail * base * dirt * (1-crack.a) * bump * (1-bumpC) * (IN.Light * 6.5);
color.rgb = crack.rgb * crack.a + color.rgb;
OUT.col = color * (IN.Light);
OUT.col.a = 1.0;
return OUT;
}
//////// techniques ////////////////////////////////////////////////////////////////////
technique BaseDetail
{
pass p0
{
VertexShader = compile vs_1_1 vsBase();
PixelShader = compile ps_2_0 psBaseDetail();
}
}
technique BaseDetail_NDetail
{
pass p0
{
VertexShader = compile vs_1_1 vsBase();
PixelShader = compile ps_2_0 psBaseDetailNDetail();
}
}
technique BaseDetailDirt
{
pass p0
{
VertexShader = compile vs_1_1 vsBase();
PixelShader = compile ps_2_0 psBaseDetailDirt();
}
}
technique BaseDetailDirt_NDetail
{
pass p0
{
VertexShader = compile vs_1_1 vsBase();
PixelShader = compile ps_2_0 psBaseDetailDirtNDetail();
}
}
technique BaseDetailCrack
{
pass p0
{
VertexShader = compile vs_1_1 vsBase();
PixelShader = compile ps_2_0 psBaseDetailCrack();
}
}
technique BaseDetailCrack_NDetail_NCrack
{
pass p0
{
VertexShader = compile vs_1_1 vsBase();
PixelShader = compile ps_2_0 psBaseDetailCrackNDetailNCrack();
}
}
technique BaseDetailDirtCrack
{
pass p0
{
VertexShader = compile vs_1_1 vsBase();
PixelShader = compile ps_2_0 psBaseDetailDirtCrack();
}
}
technique BaseDetailDirtCrack_NDetail_NCrack
{
pass p0
{