The Fur effect is great, and I already know how to make the effect itself transparent, but I was hoping to make the whole thing transparent.
So, here's the Fur script I'm using:
//--------------------------------
// VERTEX FUR
//--------------------------------
// By Evolved
// http://www.vector3r.com/
//--------------------------------
//--------------------------------
// un-tweaks
//--------------------------------
matrix WorldVP:WorldViewProjection;
matrix World:World;
//--------------------------------
// tweaks
//--------------------------------
float4 FurColor = {0.34f, 1.0f, 0.34f, 0.52f};
float FurHeight = 0.5f;
float4 LightPosition = {0.0f, 50.0f, -100.0f, 1.0f};
float4 LightColor = {1.0f, 1.0f, 1.0f, 1.0f};
float LightRange = 125.0f;
float4 Ambient = {0.3f, 0.3f, 0.3f, 1.0f};
float U = 1.0f;
float V = 1.0f;
//--------------------------------
// Textures
//--------------------------------
texture FurTX
<
string Name="";
>;
sampler2D Fur = sampler_state
{
texture = <FurTX>;
};
//--------------------------------
// structs
//--------------------------------
struct Input
{
float4 Pos:POSITION;
float2 UV:TEXCOORD;
float3 Normal:NORMAL;
};
struct Output
{
float4 OPos:POSITION;
float2 Tex:TEXCOORD0;
float4 Diffuse:COLOR0;
};
//--------------------------------
// vertex shader
//--------------------------------
Output VS(Input IN,uniform float Dir)
{
Output OUT;
float4 VPos;
VPos.xyz=IN.Pos+(IN.Normal*(Dir*FurHeight));VPos.w=IN.Pos.w;
OUT.OPos=mul(VPos,WorldVP);
OUT.Tex=IN.UV*float2(U,V);
float3 WNor=mul(IN.Normal,World); WNor=normalize(WNor);
float3 WPos=mul(IN.Pos,World);
float3 LPos=LightPosition-WPos;
float4 Light=max(saturate(0.025f+mul(LPos,WNor)*0.025f),0);
float Dis=max(saturate(1-(length(LPos)/LightRange)),0);
OUT.Diffuse=(Ambient+(Light*Dis*LightColor))*FurColor;
return OUT;
}
//-----------------
// techniques
//-----------------
technique VFur
{
pass p0
{
vertexShader = compile vs_1_1 VS(0);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
SRCBLEND = SRCALPHA;
DESTBLEND = ZERO;
ALPHABLENDENABLE = TRUE;
BLENDOP = ADD;
}
pass p1
{
vertexShader = compile vs_1_1 VS(1);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
SRCBLEND = SRCALPHA;
DESTBLEND = ONE;
ALPHABLENDENABLE = TRUE;
BLENDOP = ADD;
}
pass p2
{
vertexShader = compile vs_1_1 VS(2);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
pass p3
{
vertexShader = compile vs_1_1 VS(3);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
pass p4
{
vertexShader = compile vs_1_1 VS(4);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
pass p5
{
vertexShader = compile vs_1_1 VS(5);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
pass p6
{
vertexShader = compile vs_1_1 VS(6);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
pass p7
{
vertexShader = compile vs_1_1 VS(7);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
pass p8
{
vertexShader = compile vs_1_1 VS(8);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
pass p9
{
vertexShader = compile vs_1_1 VS(9);
Sampler[0] = <Fur>;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
}
}
But, like the script below, I was hoping to make it totally transparent, not just the fur, which is set in "float4 FurColor = {0.34f, 1.0f, 0.34f, 0.52f};" the last number is the alpha channel for the Fur. (transparent color)
Here's a totally transparent effect:
//
// Fast Bone
//
/************* UNTWEAKABLES **************/
float4x4 WorldIT : WorldInverseTranspose;
float4x4 WorldViewProj : WorldViewProjection;
float4x4 World : World;
float4x4 View : View;
float4x4 ViewInv : ViewInverse;
/*********** DBPRO UNTWEAKABLES **********/
float4x4 boneMatrix[60] : BoneMatrixPalette;
/************* SURFACE **************/
float4 lhtDir < string UIDirectional = "Light Direction"; >;
float4 LightPos : Position
<
string UIObject = "PointLight";
string Space = "World";
> = {100.0f, 100.0f, -100.0f, 0.0f};
float4 LightColor
<
string UIType = "Color";
> = {0.75f, 0.75f, 0.75f, 1.0f};
float4 AmbiColor : Ambient
<
string UIName = "Ambient Light Color";
> = {0.01f, 0.01f, 0.01f, 1.0f};
float4 SurfColor : Diffuse
<
string UIName = "Surface Color";
string UIType = "Color";
> = {1.0f, 1.0f, 1.0f, 1.0f};
/************* TEXTURES **************/
texture colorTexture : DiffuseMap
<
string Name = "default_color.dds";
string type = "2D";
>;
sampler2D colorSampler = sampler_state
{
Texture = <colorTexture>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
/************* DATA STRUCTS **************/
struct appdata {
float3 Position : POSITION;
float4 UV : TEXCOORD0;
float4 Normal : NORMAL;
float4 Blendweight : TEXCOORD1;
float4 Blendindices : TEXCOORD2;
};
/* data passed from vertex shader to pixel shader */
struct vertexOutput {
float4 HPosition : POSITION;
float4 TexCoord : TEXCOORD0;
float4 Col : COLOR;
float Fog : FOG;
};
/*********** vertex shader ******/
vertexOutput mainVS(appdata IN)
{
vertexOutput OUT;
float3 netPosition = 0, netNormal = 0;
for (int i = 0; i < 4; i++)
{
float index = IN.Blendindices[i];
float3x4 model = float3x4(boneMatrix[index][0], boneMatrix[index][1], boneMatrix[index][2]);
float3 vec3 = mul(model, float4(IN.Position, 1));
vec3 = vec3 + boneMatrix[index][3].xyz;
float3x3 rotate = float3x3(model[0].xyz, model[1].xyz, model[2].xyz);
float3 norm3 = mul(rotate, IN.Normal);
netPosition += vec3.xyz * IN.Blendweight[i];
netNormal += norm3.xyz * IN.Blendweight[i];
}
float4 tempPos = float4(netPosition,1.0);
netNormal = normalize(netNormal);
float3 worldSpacePos = mul(tempPos, World).xyz;
OUT.TexCoord = IN.UV;
OUT.HPosition = mul(tempPos, WorldViewProj);
float3 L = -lhtDir;
float4 gogo;
gogo = 300;
gogo.w=1;
OUT.Col = gogo;
float4 cameraPos = mul( float4(worldSpacePos,1), View );
OUT.Fog = (1000-cameraPos.z)/(1000-0);
return OUT;
}
float4 PS(
float4 Diff : COLOR0,
float2 Tex : TEXCOORD0) : COLOR
{
return tex2D(colorSampler, Tex) * Diff * float4(0.2,1,0.2,0.40);
}
/****** technique *******/
technique dx9textured
{
pass p0
{
Sampler[0] = (colorSampler);
VertexShader = compile vs_2_0 mainVS();
PixelShader = compile ps_1_0 PS();
}
}
If someone has a tip on how I can "merge" the two, please, let me know.

Thanks!
www.William-K.com
www.Wusik.com