Jump to content

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


Recommended Posts

How hard do you think it would be to fix this?

Really easy. The shadowmap needs to be passed into the water shader, and the water shader can just draw shadows on the water surface.

If Myconid tackles shadows, he might as well try to fix this too.

historic_bruno already gave you the answer to that. I'd recommend to change the default depth bias to something like 0.005 when the GPU supports 32bit depth buffers.

And it hurts my eyes not seeing the 0 AD development team banner on his profile :ph34r:

It's a pretty banner, though I'm just in it because I like the hacking. ;)

Link to comment
Share on other sites

Can I say? Oh, no.. Anyways, I'll say it out and loud:

I LOVE YOU MAN!

Seriously! This is amazing! You know, bump, spec and AO maps are almost a MUST in today's AAA engines and games, and you making it happen in 0.a.d., and Open-Source... It just blows my mind away.

Thank you from the bottom of my heart! :)

Link to comment
Share on other sites

Thank you from the bottom of my heart! :)

You're very welcome! :)

Now trying to get the mapping stuff cleaned up. Here's a peek (NB: automatically generated normal/height maps are pretty bad, but hopefully you get an idea about what's possible).

VK5nV.jpg

Edit: I know about the seam. I must have broken something while cleaning up the normal mapping. Will look into it.

Edit2: Never mind. I win the stupid mistake prize.

Edited by myconid
  • Like 1
Link to comment
Share on other sites

Final patch for model normal/parallax/specular/emissive mapping should be dropping tomorrow. I somehow managed to mess up my git-svn setup, so the patch will also include patches #1493 and #1497, sorry! :oops:

Testing specularity now. Here are a couple more pics: The first one uses greyscale specularity to model the marble, the second uses colour specularity to model the metallic parts on the columns. They look better in motion...

ZLdxj.jpg

jbK4o.jpg

  • Like 1
Link to comment
Share on other sites

Very nice :)

At the moment, we want to review patches for http://trac.wildfire...com/ticket/1493 and http://trac.wildfire...com/ticket/1497 which I believe are prerequisites for some of the enhancements.

Thanks. Yes, those need reviewing, though don't commit them just yet because they'll also be included in this patch (without changes AFAIK).

Edited by myconid
Link to comment
Share on other sites

PATCH: Normal, parallax, specular, emissive and lightmapping (AO etc)

The attached archive contains the "final" patch/files for all the above. It's here and not on Trac because of Trac's 512k size limit.

I decided to generate the diff manually, to avoid including the two other patches in this one. While they are not explicitly included, they are still prerequisites.

The instructions to patch everything are a bit longish, and maybe it would have been easier if I wrote a script for it, but it's a one-off thing so I couldn't be arsed. Here goes:

1) Extract the patch archive to $patdir

2) cd to the 0ad/ directory

First we apply #1493 and #1497.

3) patch -p0 -i $patdir/cpp/dependencies/multicoord.diff

4) patch -p0 -i $patdir/cpp/dependencies/multitexture2.diff

5) copy UPDATEACTORS.sh into your 0ad/binaries/data/mods/public/art/actors directory and run it from there.

Then we apply the new patch.

6) patch -p0 -i $patdir/cpp/modelmapping.diff

7) Copy $patdir/cpp/graphics and $patdir/cpp/renderer into the 0ad source directory to merge the new files in the right directories.

Then we copy over the new shaders.

8) Copy $patdir/glsl into 0ad/binaries/data/mods/public/shaders/glsl, replacing the old files.

And finally, the config file.

9) Copy $patdir/config/default.cfg to 0ad/binaries/data/config, replacing the old file.

Update workspaces and compile. Here you need to run the game to copy over the config. If everything goes correctly, the game should run and nothing should look different than usual.

To start using the new features, go into your local.cfg file and set preferglsl and gentangents to true. (At the end of the file you'll also notice a materialmgr.quality setting. The version of the material that is loaded depends on the materialmgr.quality setting in the config (which is out of 10, float). For instance, parallax is only enabled if the config setting is >= 8. If it's smaller, the material redirects to a simpler version of itself that only contains normal mapping, which redirects to the completely basic material if the quality setting is not >= 3).

The archive contains a "demo" folder, which has some test files you can try. Copy the $patdir/demo/art directory over the game's 0ad/binaries/data/mods/public/art directory and merge them.

This will add a new model called "mars_temple2", found under "Actors (All)" in Atlas.

That's pretty much it. Good luck ;)

modelmappingpatch.zip

Link to comment
Share on other sites

Sure. The game compiled fine, and it looks just like it did before. I guess that's a good thing?

I'm having trouble noticing any of the new effects. I guess an artist needs to come in after this is added and add heaps of new effects for each building?

Link to comment
Share on other sites

Ok, now it's my turn to say thank you!

Everything here looks amazing, and it's really good to see a lot of development that is not planned, but contributed.

From this discussion I also learned alot, so the benefit is double! Sorry for not being able to compile and test, but I really want to see these changes in the next alpha (or the alpha after that, no rush).

I do have a thechnical question, that I'm not shue if it was answered before:

If the AO is "burned" into the texture itself, dosn't it ruins the texture for future use? A "burned" texture is just a modified, or "photoshoped" picture, Is'nt there a programatic way to do this? Or will it be to complicated for the CPU?

And really, thank you for your effort. :)

Link to comment
Share on other sites

Sure. The game compiled fine, and it looks just like it did before. I guess that's a good thing?

I'm having trouble noticing any of the new effects. I guess an artist needs to come in after this is added and add heaps of new effects for each building?

Definitely a good thing! There are some instructions about how to get a test model in the game, right after the patching instructions. You need to copy across some files, and you'll have a test model available in Atlas, which you can add to maps or whatever.

Ok, now it's my turn to say thank you!

I do have a thechnical question, that I'm not shue if it was answered before:

If the AO is "burned" into the texture itself, dosn't it ruins the texture for future use? A "burned" texture is just a modified, or "photoshoped" picture, Is'nt there a programatic way to do this? Or will it be to complicated for the CPU?

You're welcome! Regarding your question, the AO texture is held separately from the base colour texture, and they are only combined together (really fast by the hardware) while they are being drawn to the screen. This way, there only needs to be a low-quality AO texture that is unique for each model, while the high-quality colour texture can be reused.

Edited by myconid
Link to comment
Share on other sites

I'm getting a segfault when trying to load the mars_temple2 model in Atlas, and also when loading certain scenario maps although not always. For example if I first try loading "Acropolis 2" then 0AD crashes, however if I load a map which doesn't crash, such as "Savanna Ravine", before loading "Acropolis 2", then "Acropolis 2" won't crash either.

I've attached the call stack generated by gdb after reproducing the crash in Atlas.

0ad_atlascrash_modelmappingpatch_callstack.txt

Link to comment
Share on other sites

I'm getting a segfault when trying to load the mars_temple2 model in Atlas, and also when loading certain scenario maps although not always. For example if I first try loading "Acropolis 2" then 0AD crashes, however if I load a map which doesn't crash, such as "Savanna Ravine", before loading "Acropolis 2", then "Acropolis 2" won't crash either.

I've attached the call stack generated by gdb after reproducing the crash in Atlas.

Ah thanks, this is the sort of testing I'm talking about! :)

Looks like it could be an Nvidia incompatibility (the exception is in the driver), though it's hard to tell which of the 3 patches is at fault here. Edit: It's probably my fault, of course..

Please check if setting the materialmgr.quality to 0 and gentangents to false helps at all. Oh, you should also try without GLSL...

If that doesn't help, you'll need to try recompiling, adding one patch at a time and checking which one breaks it...

Edited by myconid
Link to comment
Share on other sites

When adding one patch at a time, 0AD didn't start crashing until I copied the glsl shaders into "binaries/data/mods/public/shaders/glsl", at step 8 of your instructions. Setting "gentangents = false" and "preferglsl = false" also stopped the crashing.

Good work! I wish software testers were all as thorough as you are.

The problem is with the model_common.xml file -- it doesn't test if tangents/extra UVs are provided in each model, so those end up becoming null pointers somewhere in the driver. ATI drivers probably checked for this, though Nvidia drivers don't. Will need to do it myself.

Thank you! :D

Edited by myconid
Link to comment
Share on other sites

Indeed!

I just have a coupple of questions Art-wise, specially when creating future assets for the game and maybe future mods.

On Blender I'm used to work with 3 different textures: One is difuse, another one is greyscale for the specularity and the other one could be also greyscale (for bump) or mapped "normals" - from Gimp's plugins or if I'm in the mood, from some serious 3d detailing and baking the normals into a new texture.

I know it may seen a quite a dumb question, but how does it work? How do you control the intensity of the normals, the influence of the specularity.... these things. I have very limited codding knowladge, I only did some really basic actor codding so far, but I'm really excited about this. Will it be controled like this suggests? http://trac.wildfiregames.com/ticket/1493

Thanks again for your awesome work, and sorry for such questions. :)

Best regards!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...