I make cloud shader and model, but i have dark areas on screen. What a my mistake?
float4x4 WorldMatrix : World;
float4x4 View : View;
float4x4 Projection : WorldViewProjection;
float4 AmbientColor = float4(1, 1, 1, 1);
float AmbientIntensity = 0.1;
float3 DiffuseLightDirection = float3(1, 0, 0);
float4 DiffuseColor = float4(1, 1, 1, 1);
float DiffuseIntensity = 1.0;
float Shininess = 200;
float4 SpecularColor = float4(1, 1, 1, 1);
float SpecularIntensity = 1;
float3 ViewVector = float3(1, 0, 0);
float Transparency = 0.5;
texture ParticleTexture <string Name="";>;
sampler2D texSampler=sampler_state
{
texture = <ParticleTexture>;
};
float2 Size;
float3 Up; // Âåêòîð êàìåðû Up
float3 Side; // Âåêòîð êàìåðû Side
float AlphaTestValue = 0.5f;
float AlphaTestGreater=0.1;
struct VertexShaderInput
{
float4 Position : POSITION0;
float2 UV : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 Position : POSITION0;
float2 UV : TEXCOORD0;
};
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
VertexShaderOutput output;
//output.Position = mul(input.Position, mul(View, Projection));
output.Position = mul(input.Position, Projection);
//output.Position = output.Position + float4( ( input.UV - 0.5 ) * 4, 0.0, 0.0);
output.UV = input.UV;
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
float4 color = tex2D(texSampler, input.UV);
if (color.r<0.3) discard;
//color.a = 0.2;
color.a = clamp(color.a - 0.5, 0, 1);
return color;
}
technique Technique1
{
//cullmode = none;
pass Pass1
{
cullmode = none;
AlphaBlendEnable = TRUE;
DestBlend = INVSRCALPHA;
SrcBlend = SRCALPHA;
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
zzz!