myconid Posted August 13, 2012 Author Report Share Posted August 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
Enrique Posted August 13, 2012 Report Share Posted August 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
Zaggy1024 Posted August 13, 2012 Report Share Posted August 13, 2012 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>. Quote Link to comment Share on other sites More sharing options...
k776 Posted August 13, 2012 Report Share Posted August 13, 2012 Sounds good. How are things like bloom and distance fog coming along? Quote Link to comment Share on other sites More sharing options...
myconid Posted August 13, 2012 Author Report Share Posted August 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
zoot Posted August 14, 2012 Report Share Posted August 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
myconid Posted August 14, 2012 Author Report Share Posted August 14, 2012 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? Quote Link to comment Share on other sites More sharing options...
zoot Posted August 14, 2012 Report Share Posted August 14, 2012 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:"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: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. Quote Link to comment Share on other sites More sharing options...
myconid Posted August 14, 2012 Author Report Share Posted August 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
zoot Posted August 14, 2012 Report Share Posted August 14, 2012 (edited) I can't see any difference at all, lol. I would expect a functional filter to at least make it look crappier:Box (left), Kaiser (right):Box:Kaiser: Edited August 14, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
myconid Posted August 14, 2012 Author Report Share Posted August 14, 2012 First try at rendering AO for all the buildings:https://github.com/m...id/0ad/tree/AOOThe 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_UPMake 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.pyBlender 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. Quote Link to comment Share on other sites More sharing options...
myconid Posted August 14, 2012 Author Report Share Posted August 14, 2012 zoot, either that didn't work as expected, the filter makes no visual difference, or mipmaps simply aren't being created. Quote Link to comment Share on other sites More sharing options...
azayrahmad Posted August 14, 2012 Report Share Posted August 14, 2012 To enable this effect, am I required to build a new one or is it automatically enabled when I update the SVN? Quote Link to comment Share on other sites More sharing options...
myconid Posted August 14, 2012 Author Report Share Posted August 14, 2012 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 = truegentangents = truesmoothlos = truematerialmgr.quality = 10.0 Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted August 14, 2012 Report Share Posted August 14, 2012 The binaries in SVN should work, but you need to edit these lines in your configuration file:preferglsl = truegentangents = truesmoothlos = truematerialmgr.quality = 10.0Make a local.cfg file first, then add those lines. Quote Link to comment Share on other sites More sharing options...
Loki1950 Posted August 14, 2012 Report Share Posted August 14, 2012 I have found that the local.cfg file is not used at all if you run the game directly from your local SVN repo this is with Win 7.Enjoy the Choice Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted August 14, 2012 Report Share Posted August 14, 2012 I have found that the local.cfg file is not used at all if you run the game directly from your local SVN repo this is with Win 7.Enjoy the Choice I have found that this is false. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted August 14, 2012 Report Share Posted August 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
myconid Posted August 14, 2012 Author Report Share Posted August 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
Zaggy1024 Posted August 14, 2012 Report Share Posted August 14, 2012 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? Quote Link to comment Share on other sites More sharing options...
azayrahmad Posted August 14, 2012 Report Share Posted August 14, 2012 Thanks guys, it works!Most of them are great, but a few of them looks strange.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. Quote Link to comment Share on other sites More sharing options...
myconid Posted August 14, 2012 Author Report Share Posted August 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
Gen.Kenobi Posted August 15, 2012 Report Share Posted August 15, 2012 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? Quote Link to comment Share on other sites More sharing options...
Zaggy1024 Posted August 15, 2012 Report Share Posted August 15, 2012 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.Leave that to me to fix. Quote Link to comment Share on other sites More sharing options...
azayrahmad Posted August 15, 2012 Report Share Posted August 15, 2012 (edited) 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.htmlThey 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 August 15, 2012 by azayrahmad 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.