Hi
I would like to modify this effect to create anew effet named :
"Drop Isometric Shadow".
The effect will be :
Normal Dropshadow :
<img src="http://blendman.free.fr/ark/construct/dropShadowNormal.jpg">
IsoDropShadow :
<img src="http://blendman.free.fr/ark/construct/dropShadowIso.jpg">
Modification of the shadow :
In fact, it seems to be easy : just to have a parameter which allow you to change the size of the shadow (in X, and Y).
In my example, I have just change the size of Y of the shadow :
normal 1:1
iso 1:3 (1/3)
So how can I do that with your code ? I have tried to do that , but it doesn't work.
Here is the test I have made (buggued). I have add 2 news parameters :
Size Y : it should change the Y size of the shadow, but in my code, it's buggued.
Alpha-effect (of the original image, not for the shadow, which has opacity) : this effect allow you to change the alpha or add some effect to the image (not the sahdow)
// Dropshadow isometric blurred
// David Clark (edited by Louis Ferina, Jorge Fuente-Alba,)
// PS 2.0
//#CROSS-SAMPLING : reads pixels it may be writing.
//#BORDER-MODE : samples pixels outside bounding box
//#PARAM float offsetX 5.0 : X Offset: X offset of dropshadow.
//#PARAM float offsetY 5.0 : Y Offset: Y offset of dropshadow.
//#PARAM float sizeY 5.0 : Y Size: Ysize of dropshadow.
//#PARAM float alpha 1.0 : alpha - effect: alpha effect of dropshadow.
//#PARAM float blur 2.5 : Blur : Blur amount of dropshadow.
//#PARAM float opacity 0.5 : Opacity : Opacity of dropshadow.
// Foreground texture
texture ForegroundTexture;
// Foreground sampler
sampler2D foreground = sampler_state {
Texture = (ForegroundTexture);
MinFilter = Point;
MagFilter = Point;
MipFilter = Point;
};
// Parameter variables
float offsetX;
float offsetY;
float sizeY;
float alpha;
float pixelWidth;
float pixelHeight;
float blur;
float opacity;
// Effect function
float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
{
// Add the front and back pixels
float2 Tex2 = Tex;
float2 Tex3 = Tex2;
Tex2.x -= offsetX * pixelWidth;
Tex2.y -= offsetY * pixelHeight;
float4 here = tex2D(foreground, Tex2.xy)*0.25;
float4 left = tex2D(foreground, float2(Tex2.x - (pixelWidth*blur), Tex2.y*sizeY))*0.1875;
float4 right = tex2D(foreground, float2(Tex2.x + (pixelWidth*blur), Tex2.y*sizeY))*0.1875;
float4 top = tex2D(foreground, float2(Tex2.x, Tex2.y*sizeY - (pixelHeight*blur)))*0.1875;
float4 bottom = tex2D(foreground, float2(Tex2.x, Tex2.y*sizeY + (pixelHeight*blur)))*0.1875;
float4 result = (here + left + right + top + bottom)* opacity;
float4 src = tex2D(foreground, Tex.xy)*alpha;
result.rgb = 0;
return result * (1-src.a) + src;
}
// ConstructEffect
technique ConstructEffect
{
pass p0
{
VertexShader = null;
PixelShader = compile ps_2_0 EffectProcess();
}
}
[/code:3jw42yfp]
Thank you for help