Variable size blur

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Mon May 25, 2009 4:48 am

stack the effect for more quality. Most commercial games do more than one blur pass.

However, if you stack any effect more than 2 times, construct crashes.
I've been meaning to report that bug but I have no freaking time for anything these days.
Will do. Next week.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri May 29, 2009 7:20 am

[quote="Ashley":2gkx1gd8]Yeah, fair enough. True blurs can be done faster by downsampling, blurring the smaller image, then linear filtering the small image up to the original size again, but the rendering engine in the runtime can't support this right now - it'll be included in 2.0 though.[/quote:2gkx1gd8]
I just read this can be done sampling with tex2Dbias(s, t), where s is a sampler. t is a 4D vector. The mip level is biased by t.w before the lookup takes place.
I'll give it a whirl later, I'm just putting it up here so I don't forget :P
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Jun 30, 2009 8:05 am

tex2Dbias made no difference.
Does Construct use mipmaps? if it doesn't, I guess it makes sense that it looks the same.

On a side note, I found this which could be helpful for other newcomers (like me) to DirectX HLSL and shaders in general:
[url:1pj9m42z]http://msdn.microsoft.com/en-us/library/bb509611(VS.85).aspx[/url:1pj9m42z]
So I couldn't do preblurring based on mip.
Next up: texture-based blurring.

Can anyone explain how to do two-pass effects?
I see this p0 pass in the effect code, but how would I do two (or more) passes?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Jun 30, 2009 5:12 pm

Multipass effects arent supported in Construct - I couldn't get them working with the D3DX library. Also, Construct does use mipmaps, but not for rendertargets (like canvas objects or layer effects).
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Jul 01, 2009 6:24 am

but it uses mipmaps for sprites? 'cause that is what I was sampling.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Aug 06, 2009 6:32 pm

Any chance of a variable blur mask?
The available mask's work pretty good, but variable would be awesome for depth of field.
You could probably pull something off with an animated spite, but vram would shoot through the roof.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Aug 06, 2009 7:05 pm

[quote="newt":4ukwald6]Any chance of a variable blur mask?
The available mask's work pretty good, but variable would be awesome for depth of field.
You could probably pull something off with an animated spite, but vram would shoot through the roof.[/quote:4ukwald6]

The blur mask already supports variable blur based on the red channel of the image. The more red the blurrier it is.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Aug 06, 2009 11:10 pm

[quote="linkman2004":2sxgupxz]The blur mask already supports variable blur based on the red channel of the image. The more red the blurrier it is.[/quote:2sxgupxz]

Yest that's what I was talking about when I said an animated sprite. Also it says COLOR0, so I'm assuming its based on any color, or more appropriately the absence of it. In other words contrasts.
Therefore you can also use opacity to effect it, which helps, but still thats across the whole image.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Aug 06, 2009 11:58 pm

what would you use it for?
I couldn't come up with an use that would justify writing it :P
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Aug 07, 2009 1:53 am

Like I said, depth of field
[url:1l9cnx13]http://dl.getdropbox.com/u/666516/dof.cap[/url:1l9cnx13]

The opacity setting in the cap approximate what it could do. You just don't have as much control with opacity. In theory you could use a color filter for this, but we don't have decent controls for changing hue and contrast vs, just plain color. You could use the image manipulator, but it would be very slow.

Which reminds me, there might be a drawback given that this is a blur, so the drawbacks may out weigh the benefits entirely.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

PreviousNext

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests