• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Prune

Do you apply SSAO to rendered image or to ambient light term only?


8 posts in this topic

While it seems to me SSAO shouldn't affect direct lighting, I've seen examples where it's just done as a post-process and multiplied to the final color buffer. I'm guessing one reason is convenience, at least with forward rendering, since if you don't have the depth buffer from a Z-prepass, then you can't sample the SSAO until after rendering. In terms of looks, in scenes mostly lit by direct lighting, I guess the SSAO would have little effect, which is the downside of using the more realistic ordering.

Edited by Prune
0

Share this post


Link to post
Share on other sites

In terms of looks, in scenes mostly lit by direct lighting, I guess the SSAO would have little effect, which is the downside of using the more realistic ordering.

 

That's not a downside, it means it's being more accurate. Light with strong directionality should only be occluded by blockers found in that direction. SSAO (and other forms of ambient occlusion) will darken areas with high overall occlusion, even if the light can perfectly hit those areas based on the location of the light. A good example would be a crease in the corner of a room: SSAO will make the crease dark, but if you shine a flashlight right on the crease it's actually quite bright. Thus you achieve more "correct" results by only applying ambient occlusion to the ambient term, since typically the ambient term consists of lighting from many directions.

Trust me: you really don't want your game looking like someone outlines your characters with a permanent marker. It's not a good look. tongue.png

2

Share this post


Link to post
Share on other sites

It probably depends how you interpret the ambient occlusion. it's not a mathematical or logically defined tech, it's rather a cheat to fake lighting effects that are hard to do in real time. while you can make assumptions on what 'would be correct', you should apply it in the way it looks best, 'cause that's what really matters in the end. if your direct lighting is "correctly" not affected bei AO, but looks totally plain, then try to tweak your AO to make it look better.

 

if you look at the original ssao http://en.wikipedia.org/wiki/Screen_space_ambient_occlusion you also see they don't just do darkening of corners, but brightening on edges. while some say this is 'wrong' it gives plain ambient (shadow) areas some kind of "lighting" instead of just one boring ambient color intensity with dirt in the corners. (and they were for sure not just too stupid to make a "saturate(intensity*2)" in shader to remove the brightening effects.)

 

so, do what looks best and if you make a pool for the decision, then show us some screenshots so we could compare what looks nicer to our humble eyes ;)

0

Share this post


Link to post
Share on other sites

Applying SSAO only to ambient is a correct way to go, but it also requires an interesting and strong ambient term. In last game I did something in between those solutions. I just scaled SSAO strength depending on the lighting strength. This way SSAO was stronger in shadows, but less visible when light was shining directly on the surface.

0

Share this post


Link to post
Share on other sites

 

it's not a mathematical or logically defined tech

 

AO is very clearly defined, mathematically-speaking. Lambertian diffuse is computed by integrating lighting * occlusion * cos(theta) for all directions about the hemisphere, and AO approximates this by integrating the lighting and occlusion factors separately and then combining afterwards. The fact that it's an approximation doesn't mean that we can't reason about when it makes sense to apply it, and what will produce results that best simulate real physical phenomena. 

 

you define Lambertian lighting, by using occlusion and say occlusion is defined? I think that's not the way definitions work in math.

 

but you are right, AO approximates occlusion, and that was my point also. if you had a specific light source, you could separate lighting from occlusion (in that case it's commonly called shadow or radiosity map) and we'd all follow well defined algorithms.

and if there would be a clear definition of AO, then every tool should generated the same results, but the results of AO baking (and even in interactive rendering) varies a lot.

if you'd just go for the generic occlusion (aka not per light), indoor would be always just black. that's why baking tools usually have some tweaking values to set the range you sample the occlusion and in what way the angle/distance/density will be mapped to 0-1 and depending on how you apply those baked maps, artist will tweak the maps in a different way.

It's even more vague in screen space effects.

 

that's why I'm suggesting to go for the optically most wanted results than for some theoretically most convincing argument that looks inferior. We can somehow define what we want to achieve, but we strive into approximations, into theories and it ends in a pool about what most think would be best in theory. what if the 'best' we vote looks worst in the game he makes?

 

That's why I suggest to vote for the visually nicest results and he should post the 3 versions (probably just a change of 3 lines of shader code).

0

Share this post


Link to post
Share on other sites

just stumbled across it, interesting real world reference regarding the correctness of AO and SSAO, IMHO, so I thought I'd share it:

http://nothings.org/gamedev/ssao/

Fantastic link--thanks! I think directional AO methods like SSDO would probably show more realistic results. But the main take-away for me is that the reason SSAO makes things look good even though it's not realistic (as shown by this article), is simply that it adds more shading detail, which is still lacking in real-time renders. Until we have fully dynamic GI that is not just low frequency, as is the case with current real-time methods, the SSAO fills in for the the high frequency GI, the finer details, even though it's unrealistic.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0