playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.66k stars 1.35k forks source link

Post-processed Ambient Occlusion #1136

Closed ImmanuelSamuel closed 3 years ago

ImmanuelSamuel commented 6 years ago

Would love to see this feature. Maybe there are better real time algorithms for AO (SSAO) or real time GI (I know that the traditional GI is really computationally expensive but recent versions seems to be able to do this in real time may not be possible given GLES2).

The following is from 2009. Highly likely that there are better algorithms now. https://www.youtube.com/watch?v=8bRkyG3R-eI

ImmanuelSamuel commented 6 years ago

Any progress on this? Its very hard to get the aesthetic look right for really large scenes without AO. The sense of geometry takes a hit. Also is it easy to port some post-effects from other webgl engines (like SSR - the planar reflections are very resource heavy - and God-rays)?

willeastcott commented 6 years ago

Can't you just bake AO maps for your scenes? That's way more efficient (and often nicer looking) than doing SSAO.

ImmanuelSamuel commented 6 years ago

My project involves procedurally generated scenes. I already have AO maps for individual objects but when I am constructing a building in game with user generated layouts it gets complicated. Also I am going for a space look and without AO object geometry in a sci-fi genre is ok but would be a lot better. Another major thing is Screen space reflections. I cant get the feeling that people are looking at a metallic finish without some form of SSR. I have discussed this before here and was suggested to use planar reflections but that would work for specific cases very nicely but to model that into every object in the scene (especially like scifi genre where every object has reflection) its hard. Yeah I can get some cube maps from specific points in the scenes and use them in the cube map reflections but its not as convenient and is cumbersome. Don't get me wrong the PBR stuff brings a lot to realism but for a scifi genre where geometry (SSAO) reflections (SSR) and the space dust (god rays) are important to get that sense of immersion its hard to model each and everything into the game. For example, god rays - I can do transparent planes to mimic it but it looks so cheesy, compared to something I can get from threejs. But I like the playcanvas engine a lot and would like to make something visually pleasing. Putting them in the plugins like the posteffects are now would ensure that the engine remains fast while giving the users option to make visually pleasing scenes. Sorry for the essay but thats a genuine thought that I keep having whenever I see other gameplays and then start working on my project to get a similar aesthetic. The engine is FAST no doubt, I would like it to shine in some post-effects too. Right now I am working on polishing the core mechanics based on user feedback but I was almost tempted to spend some time on porting the post effects from other engines but since that would take too much time I thought I would first post here since the experts here might be able to quickly take existing code and port them quickly than myself ( I would think that the algorithms for something like SSAO, SSR and light shafts which are heavily used in most engines are already optimized so would probably not need too much tweaking ). Excited for the future of PC!

slodge2 commented 5 years ago

Is there any progress on this or alternatively an estimation on when we may expect SSAO in playcanvas? The only hint I was able to find is a post back from 2015 saying its on its way.

So.. is it?

willeastcott commented 5 years ago

No progress in this particular area, no. Currently, the core engineering team is focused on areas like performance and the UI system. But if anyone wants to submit a PR for new post effects, they'd be very welcome.

yarpskendaya commented 4 years ago

Any update on this? It is very much required for projects we are working on, and people have been wanting to migrate somewhere solely because of this missing feature. Postprocessing would be an amazing addition to the PlayCanvas arsenal

willeastcott commented 4 years ago

@yarpskendaya Have you check out the Ermis Special Effects by @highvrahos?

If anybody wants to add an AO post effect to the engine, PRs are always welcome! 😄