project-navigation
Personal tools

Author Topic: Improved 3D Geoscape Rendering [was: Nightime city lights in 3D geoscape]  (Read 82500 times)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Maybe we need this for UFO:AI when it is finished  ;) :D ;D:
http://www.tomshardware.co.uk/10tb-hdd-raid,review-31629-5.html
 8)
Please, do not take this serious. It is just a  ;)

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
even if you select low res the image has to be scaled down - which can take ages already (though i haven't done any tests on this). ;)

I thought the idea is to provide a low res and a high res texture?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Also, for those who are saying we can't include high-res textures because old systems can't handle them, I have to admit I'm kind of confused.  The game already includes an option in the "graphics" menu that lets you pick what you want to cap the maximum texture resolution at; if you're having problems with high res textures, can't you just force the game to use scaled down versions?  The original data file size has nothing to do with the size of the texture in system/graphics memory, which is controlled entirely by the resolution of the image, so how big the files are on disk is really only relevant when you're downloading them.  Is there something about this that I'm missunderstanding?  Because I just don't get the "large textures won't work on older systems" thing.

@muton: my post was referencing to this

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Okay, a new patch has been posted to the patch tracker (https://sourceforge.net/tracker/index.php?func=detail&aid=2977653&group_id=157793&atid=805244 ); it works well on my system, but it's a large enough patch that it's pretty unlikely that it will work flawlessly for everyone.  If you run into issues, please let me know.  In addition to the patch, you will also need a number of new files; they can be obtained from (http://cs.jhu.edu/~ben/graphics/ufoai/).

After the discussions here about texture file size, I have introduced a system with several different versions of each texture in different sizes.  The game will automatically load the images with the size that best matches the setting for "texture quality" in the graphics options menu.  If those images don't exist (ie. you ask for high-res textures but you haven't downloaded them), it will automatically fall back on the best match it can find.  For this reason, the lowest resolution textures should always be present, but these are quite small.

I've also changed from having one texture per month to having one texture per "season" of winter, spring, summer, fall.  This means we only need 4 textures rather than 12, which reduces the size of the download by a factor of 3, and still provides pretty good visual quality in terms of being able to watch the seasons change.

The new post-processing effects are pretty, but also relatively demanding, so if you're not happy with the framerate, simply turn off the postprocessing effects in the graphics menu.
« Last Edit: April 09, 2010, 07:22:33 am by Mattn »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Great, arisian !
Wanted to go to sleep, but now I have to test this immediately  ;) :D ;D :) 8)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
looks nice - but... ;)

* i'm using 1024x768 and the sun post processing effect is a little bit off.
* the gloss of the sun is a little bit too bright imo. if you could make it disappear from the earth surface that would be the most realistic imo.
** (i like the athmospheric scattering one can see on ufo08 though [even if it should be blue, not yellow ;) ] - but it's not that important to keep the whole gloss)

about the cvar for the post process - this can be made to be switchable at runtime (currently you have to restart the game for this).
Code: [Select]
static qboolean CL_CvarWorldLevel (cvar_t *cvar)
{
const int maxLevel = cl.mapMaxLevel ? cl.mapMaxLevel - 1 : PATHFINDING_HEIGHT - 1;
return Cvar_AssertValue(cvar, 0, maxLevel, qtrue);
}

[....]
cl_worldlevel = Cvar_Get("cl_worldlevel", "0", 0, "Current worldlevel in tactical mode");
Cvar_SetCheckFunction("cl_worldlevel", CL_CvarWorldLevel);
[....]

take e.g. this code - you could add your own check function and check for the r_config.frameBufferObject boolean in it - if set, allow a change, otherwise fix to zero. then you can query the r_postprocess->integer value and remove the r_config.postProcessing.

great to have different texture resolution support - but ... ;) our filesystem supports overwriting textures. that means that if a gamer has a 0geoscape.pk3 with low res, a 1geoscape.pk3 with high res, the high res textures will be taken (taken into account that the files have the same name and are in the same (zip) directory of the pk3). You know how pk3 files are working? E.g. you could provide a zip file with all the textures for the medium or high res packs (as the low res pack will go into svn anyway) with a folder structure like this:
Code: [Select]
-pics/
  \- geoscape
      \- map_earth_bump.png
      \- map_earth_season00.png
      \- map_earth_season01.png
      \- map_earth_season02.png
      \- map_earth_season03.png

all in all great version of the geoscape rendering. just a few minor tweaks and we can add it to the svn. thanks for the hard work you put into this.
« Last Edit: April 09, 2010, 07:55:55 am by Mattn »

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Mattn, maybe we should create a new branch for arisian. I would like to test if it would even work on my sys (and how fast) but I doubt I will patch my copy from two or more sources by hand... Am I lazy? :D

-geever

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
the feature will be deactivated by default for the first time. so nothing should change for "normal" users.

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Since the game collects information about the user's system on startup, wouldn't it be better if the feature were turned on or off depending on the user's hardware on first run? I realize that the game should still be playable on low end systems, but that does not mean that the initial configuration should always be geared for those low end systems.

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
It's certainly easy enough to just get rid of specular reflection entirely if we want.  I can rip out all the specularity code entirely if you want, or I can just disable specular rendering for the moment.  I'm inclined to do the latter, but let me know what you think.

In terms of the "overwriting textures" issue, part of the reason I did things the way I did was so that users could actually switch which textures they were loading without having to deal with actually deleting or re-naming files.  Unless I don't understand the way that the pk3 files work, if you have the high-res 1geoscape.pk3 file on your system, there's no way to tell the game to use the low-res 0geoscape.pk3 without actually removing the 1geoscape.pk3 file from the search path.  It's still entirely feasible to have different pk3 files for the different texture resolutions the way I've done it, but if you have several of them on your system, my method uses the correct one based on the in-game options settings, rather than automatically using the highest resolution one that exists.  This way, you could (for example) include 0geoscape.pk3 *and* 1geoscape.pk3 in the "standard" download, and then have 2geoscape.pk3 as an "optional" addon with the very-high-res textures.  You could even include all three .pk3 files in the "standard" download without having to fear that you would be forcing people to use the high-res textures.  It would make a difference in terms of hard-drive space and download bandwidth, but that would be the only difference for players with low-end systems.

I'll take a look at the issue with the sun effects being in the wrong place; I didn't try running the game at different resolutions, which I'm pretty sure is causing that problem.  I don't think it should be too hard to fix.

I'll also go ahead and make the post-processing switchable at runtime.  In terms of the "default" behavior, I'm not sure how easy it would be to enable/disable things by default based on auto-detection; is there an easy way of doing that?  It will disable things if the system can't handle the new features at all (ie. the graphics card doesn't support the opengl extensions we need), but I'm not quite sure what to do beyond that.  Though once I make it possible to turn post-processing on or off on-the-fly, it may not matter that much.

I'll let you know when I've got a new patch; in the mean time, let me know if anyone runs into any other issues.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
I realize that the game should still be playable on low end systems, but that does not mean that the initial configuration should always be geared for those low end systems.
I agree 100%.

Most of the players of a computer-game never bother going into any graphic-options-menu.
They just start playing the thingy @ whatever configuration it starts.
I have witnessed this fact very often as I am the type of guy who does care & before starting the game actually does adjust his graphic settings ;)

So the best thing for us to have would imho be a reasonable auto-configuration, like BTAxis suggested.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
@arisian:
 Unfortunately I cannot tell you how I like it (yet), because I had problems with the compilation yesterday.  :-\
I will wait with shouting out my opinion until a new version of this will be added into trunk.  ;)

Please do not throw out any code that can be optimized & adjusted, I think Mattn just meant to remove the gloss from the parts of the earth which are covered by land & not by water, if I correctly understood him ?!

Regarding the textures & their sizes: I think you have done enough regarding filesize by reducing the seasons by factor 3  ;)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
I agree 100%.

Most of the players of a computer-game never bother going into any graphic-options-menu.
They just start playing the thingy @ whatever configuration it starts.
I have witnessed this fact very often as I am the type of guy who does care & before starting the game actually does adjust his graphic settings ;)

So the best thing for us to have would imho be a reasonable auto-configuration, like BTAxis suggested.

hehe - believe me, i've seen hundrets of players that are exactly doing the opposite. They will tweak the graphic settings if they have a high end machine anyway.

but i also agree with btaxis that this could be activated via autodetection - but that is a totally different feature request and should not be handled here. this is only about geoscape rendering.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
It's certainly easy enough to just get rid of specular reflection entirely if we want.  I can rip out all the specularity code entirely if you want, or I can just disable specular rendering for the moment.  I'm inclined to do the latter, but let me know what you think.

whatever looks best - the bright yellow sunlight spot does just not look realistic. if you see space photos of the earth you won't see a bright yellow spot on the earth ;)
if you could disable it for now that would be nice. but i fear that the bumpmapping might take some losings from that, no?

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
but i also agree with btaxis that this could be activated via autodetection

I'm afraid about autodetection a bit, it doesn't work always. Quite some players had problems with GLSL autodetection too, in the world of videocards "supported" != "useable".

-geever