При чем здесь полигоны? У спрайта их и так двое + в семантике шейдеров есть такая штука как PSIZE - специально для спрайтов
так почему же не получается?
Handle sprite = xCreateSprite();
Handle sha = xLoadFXFile("shaders//exp.fx");
xSetEntityEffect(sprite, sha);
texture diffuseTexture : TEXTURE_0; //текстура
//описываем сэмплер:
sampler diffuseSampler = sampler_state
{
Texture = <diffuseTexture>; //привязываем текстуру
//устанавливаем адресацию координат
AddressU = WRAP;
AddressV = WRAP;
AddressW = WRAP;
//устанавливаем фильтрацию
MinFilter = ANISOTROPIC;
MagFilter = ANISOTROPIC;
MipFilter = ANISOTROPIC;
//устанавливаем уровень фильтрации
MaxAnisotropy = 4;
};
struct PSInput
{
float2 texCoords : TEXCOORD0;
};
struct PSOutput
{
float4 color : COLOR;
};
//пиксельный шейдер
PSOutput PSMain (PSInput input)
{
PSOutput output;
output.color.rgba = tex2D(diffuseSampler, input.texCoords).rgba;
output.color.a = 0.1f;
//output.color.rgb = (output.color.r + output.color.g + output.color.b) / 3;
output.color.rgb = (0.0f, 0.0f, 0.0f);
return output;
}
technique MainTechnique
{
// Sequence of technique passes. This passes will performs on stage.
pass p
{
AlphaBlendEnable= 1;
PixelShader = compile ps_3_0 PSMain();
}
}
так можно ли как-нить закинуть шейдер на спрайт?
_____UPD__________________________________________________ _______________________________________
Аууу....))) Налипать текстурки весело, а с шейдерамы еще веселее)))))))