IPB Style© Fisana

Jump to content


Post-processing effects test (SSAO/HDR/Bloom)


  • Please log in to reply
1273 replies to this topic

#201 Wijitmaker

Wijitmaker

  • 0 A.D. Art Team

  • 0 A.D. Old Timer
    (9,451 posts)

Posted 13 June 2012 - 01:05 PM

To add to plumo's request, maybe a screenshot to show off AO with simply a plain pure white diffuse texture on 2 structures - one with AO and one without.
Jason Bishop [ aka Wijitmaker ]

Wildfire Games CFO, retired artist
Contact me: jason@wildfiregames.com

Support Wildfire Games!!!

#202 myconid

myconid

  • WFG Programming Team

  • Centurio
    (789 posts)

Posted 13 June 2012 - 02:09 PM

View Postk776, on 13 June 2012 - 04:41 AM, said:

Again, nice work! :-) Do you have a list of what is left before you can start cleaning it up for review and including into the game? Think I said this before, but would be nice to have these in Alpha 11.
The lightmaps/AO (the two patches in the last post) are ready for review, as they are independent from the earlier stuff. In fact, these two patches will be dependencies for the cleaned up version of the model normal/parallax/etc mapping.

I'll first clean up model mapping, then terrain mapping, then smooth LOS, then screen-space effects. I'll make each a separate patch, and hopefully some/all of them will make it into Alpha 11 (end of July?).

plumo and Wijitmaker, will something like this do? :)
http://imgur.com/a/8ezQj
Myconid
Wildfire Games Programmer
Contact me: myconid@wildfiregames.com

#203 Wijitmaker

Wijitmaker

  • 0 A.D. Art Team

  • 0 A.D. Old Timer
    (9,451 posts)

Posted 13 June 2012 - 02:22 PM

Yeah, that is great. Would it be difficult to give the engine have the ability to tweak the level of contrast in the AO map? Perhaps giving map designers the ability to save a deviation from the default setting in the map file?
Jason Bishop [ aka Wijitmaker ]

Wildfire Games CFO, retired artist
Contact me: jason@wildfiregames.com

Support Wildfire Games!!!

#204 myconid

myconid

  • WFG Programming Team

  • Centurio
    (789 posts)

Posted 13 June 2012 - 02:43 PM

View PostWijitmaker, on 13 June 2012 - 02:22 PM, said:

Yeah, that is great. Would it be difficult to give the engine have the ability to tweak the level of contrast in the AO map? Perhaps giving map designers the ability to save a deviation from the default setting in the map file?
It's possible, but it's the same thing as changing the contrast in the map itself, which is the right way to do it.
Myconid
Wildfire Games Programmer
Contact me: myconid@wildfiregames.com

#205 Wijitmaker

Wijitmaker

  • 0 A.D. Art Team

  • 0 A.D. Old Timer
    (9,451 posts)

Posted 13 June 2012 - 03:17 PM

I guess, the reason why I'm asking is because if there was some control - it might be visually advantageous to increase and decrease the intensity of the AO map. For example, in a wintery (lower light) fog atmosphere I would think the levels of the AO would be less intense. The human eye would dilated allowing you to see what is the shadows better than if it was a high noon on a bright sunny day, where the contrasts of the shadows would be much greater (which I especially notice now in age as my eyes are getting older).
Jason Bishop [ aka Wijitmaker ]

Wildfire Games CFO, retired artist
Contact me: jason@wildfiregames.com

Support Wildfire Games!!!

#206 myconid

myconid

  • WFG Programming Team

  • Centurio
    (789 posts)

Posted 13 June 2012 - 03:34 PM

View PostWijitmaker, on 13 June 2012 - 03:17 PM, said:

I guess, the reason why I'm asking is because if there was some control - it might be visually advantageous to increase and decrease the intensity of the AO map. For example, in a wintery (lower light) fog atmosphere I would think the levels of the AO would be less intense. The human eye would dilated allowing you to see what is the shadows better than if it was a high noon on a bright sunny day, where the contrasts of the shadows would be much greater (which I especially notice now in age as my eyes are getting older).
Ah, I see. I'm sort of forcing the AO onto all the model's lighting (diffuse + ambient), which isn't quite correct (always makes it too dark). It should really just affect the ambient light! If I do that, you can achieve what you're describing by fiddling with the ambient/sun colour settings in Atlas.
Myconid
Wildfire Games Programmer
Contact me: myconid@wildfiregames.com

#207 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,795 posts)

Posted 13 June 2012 - 06:54 PM

View PostWijitmaker, on 13 June 2012 - 03:17 PM, said:

I guess, the reason why I'm asking is because if there was some control - it might be visually advantageous to increase and decrease the intensity of the AO map. For example, in a wintery (lower light) fog atmosphere I would think the levels of the AO would be less intense. The human eye would dilated allowing you to see what is the shadows better than if it was a high noon on a bright sunny day, where the contrasts of the shadows would be much greater (which I especially notice now in age as my eyes are getting older).
I see this being mitigated by distance fog. Light gray/white in most biomes, light beige in desert biomes.
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#208 plumo

plumo

  • 0 A.D. Art Team

  • Centurio
    (800 posts)

Posted 14 June 2012 - 10:04 AM

Very nice comparison screenshot, myconid ! It is a real improvement over the original!

Start writing that article, Jeru :ph34r: :bye:
B. Guns [aka Plumo]
0 A.D. Community Liaison
Contact email: plumo@wildfiregames.com

#209 Jeru

Jeru

  • 0 A.D. Art Team

  • Orator
    (4,465 posts)

Posted 14 June 2012 - 01:54 PM

View Postplumo, on 14 June 2012 - 10:04 AM, said:

Very nice comparison screenshot, myconid ! It is a real improvement over the original!

Start writing that article, Jeru :ph34r: :bye:

I agree, it's beautiful. (Link for my reference)

Could you help explain what we see in each frame, with minimum technical jargon? And explicitly define all jargon you use?

Aviv Sharon [ aka Jeru ]

Wildfire Games 0 A.D. PR & Social Media Contributor
Contact me:
E-mail & Google Talk: aviv dot sharon at gmail dot com
MSN: lc_jerusalem at hotmail dot com
Facebook, Twitter, LinkedIn


#210 Wijitmaker

Wijitmaker

  • 0 A.D. Art Team

  • 0 A.D. Old Timer
    (9,451 posts)

Posted 14 June 2012 - 02:23 PM

Quote

It should really just affect the ambient light! If I do that, you can achieve what you're describing by fiddling with the ambient/sun colour settings in Atlas.
Sweet, yep I think we are on the same wavelength. Cool, that would do the trick.
Jason Bishop [ aka Wijitmaker ]

Wildfire Games CFO, retired artist
Contact me: jason@wildfiregames.com

Support Wildfire Games!!!

#211 myconid

myconid

  • WFG Programming Team

  • Centurio
    (789 posts)

Posted 14 June 2012 - 04:18 PM

View PostJeru, on 14 June 2012 - 01:54 PM, said:

Could you help explain what we see in each frame, with minimum technical jargon? And explicitly define all jargon you use?
I'll try to.

The second image is from the unmodified game. The third image is the pure "ambient occlusion" texture, as it was rendered offline with raytracing in Blender. The first image is that texture blended with the model's usual lighting.

Ambient occlusion is basically a measure of how much each part of the model is illuminated by indirect sunlight. That is, parts that are harder for ambient sunlight to reach, such as the areas inside the arches, are made darker, and that makes the model look much more natural. Another way to think about it is, AO determines how much each bit of the model's surface is exposed to the sky (Google for more explanation).

At the beginning of this thread, I showed how AO can be approximated at runtime using SSAO ("Screen Space AO"), a post-processing effect applied after the scene is rendered. Unfortunately, SSAO is a very crude approximation that can introduce unwanted "haloing" around objects and is not very good for RTS games, where you want to show as much detail as possible. Ykkrosh then suggested to precompute the AO, though he wanted to approximate the AO textures at loading time instead of raytracing them in 3d software.

The problem with bringing either kind of precomputed lighting to 0ad was that the texture mapping created by the artists reused parts of the same textures on different models and on different parts of the same models. This is a good thing, as it allows us to have better quality textures, but we can't use the same texture coordinates to implement something that varies from surface to surface and from model to model, such as lighting. That required the introduction of some code to allow additional sets of texture coordinates in the model files, so we can have a texture wrapping where each individual surface has its own unique bit of texture space.

The textures we use to modify the model's lighting, such as the AO texture, are called lightmaps. The two patches above let us to use lightmaps by:
  • allowing the engine to associate any number of textures with an object by putting them in the object's definition or by calling a function at runtime, and exposing them in the GLSL shaders
  • allowing the engine to load any number of texture coordinate sets from the models, and exposing them in the GLSL shaders
By creating a new kind of object material that tells the shaders to expect an extra texture and an extra texcoord set, the shaders know to use a new bit of code that combines those with the model to create any lighting effect we like. The example pic above uses a raytraced AO texture created in Blender, though Ykkrosh's idea is now also possible without other major modifications to the engine (though that's not a priority for me, as there are lots of other improvements I can work on).

So there you go. I hope all that made sense!

Edited by myconid, 14 June 2012 - 04:23 PM.

Myconid
Wildfire Games Programmer
Contact me: myconid@wildfiregames.com

#212 myconid

myconid

  • WFG Programming Team

  • Centurio
    (789 posts)

Posted 14 June 2012 - 05:30 PM

Some more pics :)
http://imgur.com/a/w6Aji
Myconid
Wildfire Games Programmer
Contact me: myconid@wildfiregames.com

#213 feneur

feneur

  • 0 A.D. Project Leader

  • Cartographer of imaginary worlds
    (7,062 posts)

Posted 14 June 2012 - 08:27 PM

Wow :o I don't think I've realized before how big difference it actually makes with AO until I saw those comparison screenshots you've just posted. Really great work (y)

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#214 Wijitmaker

Wijitmaker

  • 0 A.D. Art Team

  • 0 A.D. Old Timer
    (9,451 posts)

Posted 14 June 2012 - 09:17 PM

Yes, it is really noticeable on the stairs and the deep interior portions.
Jason Bishop [ aka Wijitmaker ]

Wildfire Games CFO, retired artist
Contact me: jason@wildfiregames.com

Support Wildfire Games!!!

#215 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,928 posts)

Posted 14 June 2012 - 10:16 PM

Agreed, this is a great demonstration (better than the Roman CC in my opinion): http://i.imgur.com/moHjah.jpg
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#216 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,795 posts)

Posted 14 June 2012 - 10:32 PM

View Posthistoric_bruno, on 14 June 2012 - 10:16 PM, said:

Agreed, this is a great demonstration (better than the Roman CC in my opinion): http://i.imgur.com/moHjah.jpg
A most excellent shot and illustrates AO perfectly. Perhaps I can post this to Moddb as a possible future visual enhancement?
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#217 Pureon

Pureon

  • 0 A.D. Art Team

  • Primus Pilus
    (3,220 posts)

Posted 14 June 2012 - 10:48 PM

What are the dimensions of the ambient occlusion textures you're using in those screenshots?
Pureon
0 A.D. Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com

#218 myconid

myconid

  • WFG Programming Team

  • Centurio
    (789 posts)

Posted 14 June 2012 - 11:01 PM

View PostMythos_Ruler, on 14 June 2012 - 10:32 PM, said:

A most excellent shot and illustrates AO perfectly. Perhaps I can post this to Moddb as a possible future visual enhancement?
If the question is directed at me, go right ahead. :)

View PostPureon, on 14 June 2012 - 10:48 PM, said:

What are the dimensions of the ambient occlusion textures you're using in those screenshots?
512x512. About 100k in png. Simpler models can do with less.

Oh, I should mention that the png loading code doesn't like greyscale images, which would make that about 15k.

Edited by myconid, 14 June 2012 - 11:06 PM.

Myconid
Wildfire Games Programmer
Contact me: myconid@wildfiregames.com

#219 Wijitmaker

Wijitmaker

  • 0 A.D. Art Team

  • 0 A.D. Old Timer
    (9,451 posts)

Posted 15 June 2012 - 01:05 AM

Maybe somebody could make this topic public. But, this is seven years in the making (made possible by myconid), and it is a beautiful thing to behold :) The two UV channels is such a huge advantage in comparison to that combined light/shadow and diffuse texture map previously used in that thread.
Jason Bishop [ aka Wijitmaker ]

Wildfire Games CFO, retired artist
Contact me: jason@wildfiregames.com

Support Wildfire Games!!!

#220 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,795 posts)

Posted 15 June 2012 - 01:33 AM

Old-school attempt (circa 2005):

Posted Image

With baked texture:

Posted Image
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users