I did what you said Esper, so I just need to know how to create a dynamic view light?
Its sad I couldnt get my version to work. I know it can work because the "rain_drop" shader on the wiki uses the same method im looking for! In fact, I was using the raindrop shader as the base for my shader, but I just couldnt get the image to fill the screen. I figured someone here would be able to tell me how to do that...
The example I showed was just me disabling the refraction. With the refraction enabled, it looks like this...
As you can see, the effect is working, it just needs to be scaled properly.
For anyone interested, heres the shader I am working with...
texture TargetMap;
texture mtlSkin1;
sampler postTex = sampler_state
{
texture = (TargetMap);
MinFilter = linear;
MagFilter = linear;
MipFilter = linear;
AddressU = Wrap;
AddressV = Wrap;
};
sampler bumpTex = sampler_state
{
texture = (mtlSkin1);
MinFilter = linear;
MagFilter = linear;
MipFilter = linear;
AddressU = Wrap;
AddressV = Wrap;
};
float4 PS_RainDrops(float2 tex0 : TEXCOORD0) : COLOR
{
float2 temp;
temp.x = tex0.x;
temp.y = tex0.y;
float2 pixel = tex2D(bumpTex,temp).rg*5;
temp.x = (tex0.x + pixel.x * 0.01f);
temp.y = (tex0.y + pixel.y * 0.01f);
return float4(tex2D(postTex,temp*(1-pixel.x * 0.01f)).rgb,1.0);
}
technique tech_00
{
pass pass_00
{
PixelShader = compile ps_2_0 PS_RainDrops();
}
}
technique fallback { pass one { } }