1 registered members (TipmyPip),
18,574
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Better blur effect
[Re: MrCode]
#183444
02/15/08 08:19
02/15/08 08:19
|
Joined: Jan 2007
Posts: 1,619 Germany
Scorpion
Serious User
|
Serious User
Joined: Jan 2007
Posts: 1,619
Germany
|
just imagine a raster.  and now imagine a circle in it.. now add all coordinates of the quads, which are in that circle to the array. btw: a faster way to blur ist to blur h and v in diffrent passes...
|
|
|
Re: Better blur effect
[Re: Scorpion]
#183446
02/18/08 08:18
02/18/08 08:18
|
Joined: Mar 2007
Posts: 677 0x00000USA
MrCode
OP
User
|
OP
User
Joined: Mar 2007
Posts: 677
0x00000USA
|
Quote:
a faster way to blur ist to blur h and v in diffrent passes
How would I do this? I mean, how would I go about setting the values? Would I use a parametric trig function (x(t)= sin([pixel's x coord (t)] y(t)= sin([pixel's y coord (t)]) to get the values I need for the array(s)?
void main()
{
cout << "I am MrCode,";
cout << "hear me roar!";
system("PAUSE");
}
|
|
|
Re: Better blur effect
[Re: BoH_Havoc]
#183449
02/18/08 16:26
02/18/08 16:26
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Quote:
Before blurring you should also downsample the image to 1/4 of its original size. This way the shader is much faster and the result looks much more blurry.
How do you do that? 
|
|
|
Re: Better blur effect
[Re: Slin]
#183450
02/18/08 16:33
02/18/08 16:33
|
Joined: Jun 2004
Posts: 655 to your left
BoH_Havoc
User
|
User
Joined: Jun 2004
Posts: 655
to your left
|
just render the scene to a bmap 1/4 of the screenresolution. This could look like this for example:
VIEW* s_view_blurRender = {bmap = "#256x192x32";}
If you want to use this blurred image with other shaders (for example a Depth of Field shader), don't forget to rescale it to its original size. You can do that in the shader. This could look like this:
float4 rescaledBlur = tex2D(blurMap,texcoord/4);
[edit] heh, just noticed, i downsample by 1/16, not 1/4. sorry, my fault ^^
Last edited by BoH_Havoc; 02/18/08 16:35.
|
|
|
|