Ambient Occlusion?

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

Post » Mon Aug 24, 2009 11:07 pm

Hi,

I was wondering if anyone is capable of making an fx shader performing an ambient occlusion post process effect.

Basically, ambient occlusion is this:


or [url:1k0nr62c]http://www.independentdeveloper.com/images/ambient-occlusion.jpg[/url:1k0nr62c]

What the shader should do is something like "desaturate the initial image, blur it, and output the image in multiply or adding blend i think, with an intensity", so more intensity less opacity and viceversa.

Would someone please make it for me, since i'm not able to do it?

And it can also be added to the Construct default FXs.

Thanks in advance.
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Tue Aug 25, 2009 12:06 am

This really wouldn't be possible without 3D geometry and there's no effective - or efficient - way to simulate it.
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Tue Aug 25, 2009 12:23 am

Then, can be made something just remotely similar?
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Tue Aug 25, 2009 10:55 am

Ambient Occlusion is not a post-process effect, it's complex 3d light calculations, and is for 3d renderers only. It's never used in real time because it's very cpu intensive. There's no way to do this to a 2d picture.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Tue Aug 25, 2009 11:02 am

It needs a 3D model, yes.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Aug 25, 2009 3:01 pm

Actually these days they're finding ways to do ambient occlusion in realtime.

http://news.developer.nvidia.com/2008/0 ... -upda.html

Even though it requires a 3d model, you could probably do what you described (blur, multiply, etc.) via a canvas and pixel shaders.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Tue Aug 25, 2009 3:13 pm

Hmm... what about the height map? It could be merged into actual image to simulate shadows. A hacky solution, but hey, it works.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Aug 25, 2009 5:38 pm

Yeah, you could do that with preprocessed images, hardly worth attempting real time as you would need multiple maps for multiple positions. Not to mention what it would cost in processing power.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Aug 25, 2009 9:43 pm

Yeah I know the ambient occlusion in real time thing, also most next gen games and 3d engine feature it (saints row, crysis..). Anyway I know there's the need of 3D models, because of the Z Depth Map i think..
No problem, I was just wondering if something similar could've been done in real time in 2D.

p.s.: Because I played Crysis Wars just after I got this idea :P
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Fri Aug 28, 2009 9:59 pm

the 2D equivalent of screen space ambient occlusion is..... drop shadow!

so just do a drop shadow. Maybe a drop shadow .fx would be nice?
Edit: I think there is one already.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 1 guest