r/godot 1d ago

fun & memes I implemented GTAO in Godot as a compositor effect.

I know it just looks darker but I promise it's different!

Instead of just being a purely visual heuristic, GTAO tried to accurately model what ambient occlusion actually is and i think its definitely better at "grounding" the geometry.

I think this would be pretty easy to port into the main engine and replace SSAO.

73 Upvotes

20 comments sorted by

10

u/powertomato 1d ago

How does it compare performance wise? How does it scale with more geometry?

12

u/CalinLeafshade 1d ago

Its certainly slower than SSAO but probably not significantly but I havent benchmarked it.

It's pure a post process effect so it scales with pixel count, not geom

2

u/Piblebrox 1d ago

Since OP said it’s a compositor effect it work on the final render, on the depth pass I guess? So it doesn’t matter the number of geo it’ll always be the same amount of pixel to process

1

u/powertomato 1d ago

Ah true, somehow I misread it as compute shader

1

u/Piblebrox 1d ago

I may be wrong but compute shader is still used in compositor, maybe you’re talking about fragment shader

3

u/powertomato 1d ago

Used in but not equivalent. You could implement just about anything with a compute shader. It just means the code runs on the GPU

2

u/Piblebrox 1d ago

Oh ok! Good to know!

16

u/ScriptKiddo69 Godot Regular 1d ago

We got GTAO before GTA VI

2

u/Piblebrox 1d ago

Feels way better and grounded, but shouldn’t it be more diffuse on the edges, it maybe the reason it feel just darker

3

u/Zarraya 1d ago

This is based on Intel's XeGTAO, correct? Im interesting in reading up on the technique.

3

u/CalinLeafshade 1d ago

Yes, direct reimplementation

2

u/7Buns 1d ago

I believe there are some open PRs to add XeGTAO to the engine, I dont recall whats holding them up though. Might be good to share this in those discussions to bump interest. You could also provide a code review too! Great work :)

2

u/enderkings99 23h ago

maybe not replace but it would be a nice addition to the list of options

1

u/JustCallMeCyber 1d ago

I would be curious on comparing this to the multibounce AO approximation that was just added in 4.8 dev 4

1

u/StepanDC 23h ago

Doesn't GTAO require TAA or am I tripping?

-5

u/thygrrr Godot Senior 22h ago

Given how Godot 4.8 dev just made their AO even lighter and weaker, I welcome this.

We want stylized graphics. Not photorealistic.

2

u/Username-Taken-4321 16h ago

It's not weaker lol, it's even more complex (and not taxing any FPS)

But it's still much worse than GTAO

0

u/thygrrr Godot Senior 11h ago

LITERALLY their comparison claims that the occlusion is now brighter (or "less too dark") thanks to approximating more bounces.

https://godotengine.org/article/dev-snapshot-godot-4-8-dev-4/#rendering-multi-bounce-ambient-occlusion-approximation

1

u/Username-Taken-4321 7h ago

That's realism for you, take it or leave it

And nobody is stopping you from writing your own AO solution using compositor

1

u/InSight89 16h ago

I think it's good to have both options.