Wijitmaker Posted June 13, 2012 Report Share Posted June 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
myconid Posted June 13, 2012 Author Report Share Posted June 13, 2012 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 Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted June 13, 2012 Report Share Posted June 13, 2012 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? Quote Link to comment Share on other sites More sharing options...
myconid Posted June 13, 2012 Author Report Share Posted June 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted June 13, 2012 Report Share Posted June 13, 2012 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). Quote Link to comment Share on other sites More sharing options...
myconid Posted June 13, 2012 Author Report Share Posted June 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 13, 2012 Report Share Posted June 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
plumo Posted June 14, 2012 Report Share Posted June 14, 2012 Very nice comparison screenshot, myconid ! It is a real improvement over the original! Start writing that article, Jeru Quote Link to comment Share on other sites More sharing options...
Jeru Posted June 14, 2012 Report Share Posted June 14, 2012 Very nice comparison screenshot, myconid ! It is a real improvement over the original!Start writing that article, Jeru 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? Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted June 14, 2012 Report Share Posted June 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
myconid Posted June 14, 2012 Author Report Share Posted June 14, 2012 (edited) 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 shadersallowing the engine to load any number of texture coordinate sets from the models, and exposing them in the GLSL shadersBy 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 June 14, 2012 by myconid Quote Link to comment Share on other sites More sharing options...
myconid Posted June 14, 2012 Author Report Share Posted June 14, 2012 Some more pics http://imgur.com/a/w6Aji 1 Quote Link to comment Share on other sites More sharing options...
feneur Posted June 14, 2012 Report Share Posted June 14, 2012 Wow 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 Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted June 14, 2012 Report Share Posted June 14, 2012 Yes, it is really noticeable on the stairs and the deep interior portions. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted June 14, 2012 Report Share Posted June 14, 2012 Agreed, this is a great demonstration (better than the Roman CC in my opinion): http://i.imgur.com/moHjah.jpg Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 14, 2012 Report Share Posted June 14, 2012 Agreed, this is a great demonstration (better than the Roman CC in my opinion): http://i.imgur.com/moHjah.jpgA most excellent shot and illustrates AO perfectly. Perhaps I can post this to Moddb as a possible future visual enhancement? Quote Link to comment Share on other sites More sharing options...
Pureon Posted June 14, 2012 Report Share Posted June 14, 2012 What are the dimensions of the ambient occlusion textures you're using in those screenshots? Quote Link to comment Share on other sites More sharing options...
myconid Posted June 14, 2012 Author Report Share Posted June 14, 2012 (edited) 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. 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 June 14, 2012 by myconid Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted June 15, 2012 Report Share Posted June 15, 2012 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. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 15, 2012 Report Share Posted June 15, 2012 Old-school attempt (circa 2005):With baked texture: Quote Link to comment Share on other sites More sharing options...
myconid Posted June 15, 2012 Author Report Share Posted June 15, 2012 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.Glad I could help. Quote Link to comment Share on other sites More sharing options...
wraitii Posted June 16, 2012 Report Share Posted June 16, 2012 The last comparison screenshots really show the difference well. Great work. Quote Link to comment Share on other sites More sharing options...
Shield Bearer Posted June 16, 2012 Report Share Posted June 16, 2012 How hard do you think it would be to fix this? Quote Link to comment Share on other sites More sharing options...
wraitii Posted June 16, 2012 Report Share Posted June 16, 2012 If Myconid tackles shadows, he might as well try to fix this too. Quote Link to comment Share on other sites More sharing options...
plumo Posted June 16, 2012 Report Share Posted June 16, 2012 What can't he do? MyconidI hope all of this makes it into the SVN soon.And it hurts my eyes not seeing the 0 AD development team banner on his profile Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.