Jump to content

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


Recommended Posts

Confirmed, flat faces with smooth shading may cause that problems. Can't commit now, I'm in a hurry, but if Zaggy reads this, he can make a list where he finds this artifacts to fix them setting the faces to "flat"

I'm not sure I understood what the problem was, but I'm glad we have a solution. :)

On a rather different note, today I got started on an AO-baking script for Blender. I'm managing to save extra UVs and batch-bake AO for almost all the meshes in the "structural" folder. The exceptions are propylaea.dae and some ships (?), which Blender can't import.

Link to comment
Share on other sites

I'm not sure I understood what the problem was, but I'm glad we have a solution. :)

I'll try to explain.

Big surfaces with smooth shading seems to cause the problem. I changed the following selected (orange) faces to "flat shading" and the problem disappeared. (maybe I also messed up something with the parallax material,not totally sure)

The red rim faces should be the ones with "smooth shading" to give the round illusion in this case.

post-13528-0-59975000-1344889425_thumb.j

Link to comment
Share on other sites

On a rather different note, today I got started on an AO-baking script for Blender. I'm managing to save extra UVs and batch-bake AO for almost all the meshes in the "structural" folder. The exceptions are propylaea.dae and some ships (?), which Blender can't import.

The problem is probably that Blender doesn't like the DAEs having materials in them. Delete <library_images>, <library_materials>, <library_effects>, and near the bottom of the file, delete <instance_material>.

Link to comment
Share on other sites

I'll try to explain.

Thanks!

The problem is probably that Blender doesn't like the DAEs having materials in them. Delete <library_images>, <library_materials>, <library_effects>, and near the bottom of the file, delete <instance_material>.

Yup, I already figured that out. I think the problem might be that these models have armatures in them. But anyway, 400/408 models rendered fine, so this is going well.

Sounds good. How are things like bloom and distance fog coming along?

On pause until this stuff gets done. Put that down for Alpha 12.

Link to comment
Share on other sites

From http://trac.wildfire...i/TextureFormat:

Artists should save and upload textures in PNG format, and the game engine will automatically perform the mipmapping and compression and will cache the result so that it can load quickly next time. This allows us to losslessly edit the textures and tweak the conversion settings, and avoids problems with textures being manually exported with the wrong settings. The texture conversion settings are specified in textures.xml files.
I wonder if this is done for normal maps? If not, it would seem a factor in degrading normal map quality when zoomed out.
Link to comment
Share on other sites

From http://trac.wildfire...i/TextureFormat:

I wonder if this is done for normal maps? If not, it would seem a factor in degrading normal map quality when zoomed out.

It is. All the textures are loaded the same way, remember?

Then again, maybe this has to do with how the textures are converted. I'll look into that later.

Btw, AMD's control panel thingie has a slider for "mipmap quality" on mine. Maybe you can set that through the command line or through a config file somewhere?

Link to comment
Share on other sites

It is. All the textures are loaded the same way, remember?

Then again, maybe this has to do with how the textures are converted. I'll look into that later.

Indeed. Seems like this would be the relevant file for the Roman fortress. However, it says:

<File pattern="*" format="dxt5" mipmap="true" filter="box"/>

I found this page discussing differences between the box and Kaiser filters:

image004.jpg

"The frequency responses of filters discussed in this article. Brown: ideal, cyan: point filter, yellow: box filter, green: Lanczos- and Kaiser-windowed sinc pulses (the graphs coincide very closely). The x axis represents frequency; the y axis represents the amount by which the filter scales that frequency."

It would seem that the Kaiser filter is a decent improvement over the box filter. I wouldn't know why people here haven't chosen to use it by default, though?

An example of box (left) vs. Kaiser (right) filters from the same page:

image020.jpgimage022.jpg

IMO, if seen from a bit of a distance, the image on the right clearly looks better and less 'pixelated' than the one on the left.

Link to comment
Share on other sites

It would seem that the Kaiser filter is a decent improvement over the box filter. I wouldn't know why people here haven't chosen to use it by default, though?

Well, try it and find out! :) These are the default values for kaiser, see what you can get out of it:


<File pattern="*" format="dxt5" mipmap="true" filter="kaiser" kaiserwidth="3.0" kaiseralpha="4.0" kaiserstretch="1.0"/>

Sounds like a good idea to clear your cache when you change this.

Get a few comparison screenshots, keep an eye on performance. Maybe we can make a good case for changing the default.

Link to comment
Share on other sites

First try at rendering AO for all the buildings:

https://github.com/m...id/0ad/tree/AOO

The AO maps are in textures/skins/ao. I've only updated a handful of the actors to use the AO maps/materials, mostly some civil centres, fortresses and barracks. It looks like the Greek buildings are split into a bunch of props for some reason, so those need to be put back together manually before this can work.

The Blender script is in source/tools/AOBaker. To use:

  • Make two directories, Y_UP and Z_UP. Separate models which contain the word "Z_UP" into one directory - use the Windows search function, or this on Linux
    grep -L -Z -r 'Y_UP' . | xargs -0 -I{} mv {} Y_UP


  • Make another two directories to store the generated models (with extra UVs) and textures.
  • Edit the texdestdir and modeldestdir lines in the script to be the full paths to the directories you created.
  • Set srcdir to either ".../Y_UP" or ".../Z_UP" (these are full paths). When baking "Z_UP" set the "handedness" value to "True", when baking "Y_UP" set it to "False".
  • Run Blender with
    blender -P bakeAO.py


  • Blender will start churning in the background and spitting model and image files in the directories you created.
  • Wait a trillion years.
  • Head death of the universe.

Link to comment
Share on other sites

To enable this effect, am I required to build a new one or is it automatically enabled when I update the SVN?

The binaries in SVN should work, but you need to edit these lines in your configuration file:


preferglsl = true
gentangents = true
smoothlos = true
materialmgr.quality = 10.0

Link to comment
Share on other sites

Yup, I already figured that out. I think the problem might be that these models have armatures in them. But anyway, 400/408 models rendered fine, so this is going well.

Word of caution here: even if you seem to be able to import a rigged/skeletal/armature model, you shouldn't, because the Blender importer will mess up the bone transforms which won't be noticed until they are imported back into the game. Unless the importer problem has been solved in a new version of Blender but I haven't heard that it is yet. They should be excluded from the conversion process. This would include animated siege units and ships.

Link to comment
Share on other sites

Word of caution here: even if you seem to be able to import a rigged/skeletal/armature model, you shouldn't, because the Blender importer will mess up the bone transforms which won't be noticed until they are imported back into the game. Unless the importer problem has been solved in a new version of Blender but I haven't heard that it is yet. They should be excluded from the conversion process. This would include animated siege units and ships.

Duly noted. Animated things shouldn't have AO baked onto them, anyway.

Link to comment
Share on other sites

It looks like the Greek buildings are split into a bunch of props for some reason, so those need to be put back together manually before this can work.

The props use different texture files for different bits of the buildings, so they can't be joined.

Btw, are you going to replace the AO I've already done?

Link to comment
Share on other sites

The props use different texture files for different bits of the buildings, so they can't be joined.

Is that absolutely necessary? Would it be too difficult to combine all the textures into one, like for the Romans? Or, create a couple more textures that are more specialised, so each building needs only one?

Btw, are you going to replace the AO I've already done?

Eventually yes, as it'll be much easier to have a script to do the work automatically. But for now, what I'm trying to do simply doesn't work on buildings that are in pieces, so it needs to be done manually. You might want to concentrate your efforts on those buildings.

Also check out that git branch I linked to above, if you want to see what sorts of results I've had so far.

I'm pretty sure the tiles on top didn't intended to look like pillows. I don't know if it's only in my laptop though.

Hehe nope, it's working as intended! We told it to draw pillows, so it's all good. ;)

The heightmap texture needs to be reworked to look less pillowy.

Link to comment
Share on other sites

Is that absolutely necessary? Would it be too difficult to combine all the textures into one, like for the Romans? Or, create a couple more textures that are more specialised, so each building needs only one?

If we combine them, the map will be bigger, like 2048x2048.. Not sure if it'll affect the performance, but that's the way we did in RoTE :)

Eventually yes, as it'll be much easier to have a script to do the work automatically. But for now, what I'm trying to do simply doesn't work on buildings that are in pieces, so it needs to be done manually. You might want to concentrate your efforts on those buildings.

Also check out that git branch I linked to above, if you want to see what sorts of results I've had so far.

In the future can we hope for Dynamically and automatically generated AO? :P

Link to comment
Share on other sites

If I may know, which file is the heightmap for that part? I know it's because the file is generated using software instead of handmade.

One more thing. I remember one of the modders for games created this:

http://enbdev.com/index_en.html

They created post-processing effects for many games, including GTA, Fallout, Skyrim, etc. Not only HDR and Bloom, but also reflection, motion blur and many more.

By the way, adding reflection would be real better for those marble building!

Edited by azayrahmad
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...