project-navigation
Personal tools

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

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Just err on the side of safety. It doesn't have to be perfect, people can always manually adjust the options.

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
I'll go ahead and disable specularity for now; to be honest, I don't really like the way it currently looks either.  I think it looks nice from an oblique angle, but when the specularity is right in the middle of the view it looks wrong.

In terms of "earth from space has no specularity," it depends on the images you look at.  For some examples of earth from space with specular reflection:

http://www.losgazquez.com/blog/wp-content/uploads/2007/12/earth-from-space.jpg
http://www.daviddarling.info/images/Earth_living_planet.jpg
http://researchpark.arc.nasa.gov/lecture%20series/images/Earth.jpg
http://www.softpedia.com/progScreenshots/Earth-3D-Space-Tour-Screenshot-5607.html

Also, note the atmospheric scattering in this one:
http://multimedia4everyone.com/faith_science_commentary/media/photo_earth-from-space.jpg

At some point, I'd like to improve the atmosphere rendering.  I'm also not totally happy with the way the sun looks right now, but I can continue to work on those things; I don't think it's worth delaying this patch for them, I'll just make another smaller patch for them when I get around to it.

In terms of auto-detection, it should already handle the "unsupported" case; it's the "supported but unusable" case that I'm not sure how to test for automatically.  If anyone has suggestions, I'm open to them.

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Okay, a new version is now up at the patchtracker; I think it should fix the issue with different screen resolutions.  Also, in the process of fixing that, I discovered that it didn't handle changing the screen resolution without a restart, so I fixed that, too.  Now you can turn the post-processing on and off and/or change resolution, all with out restarting :)

Be sure to re-download the "common" textures, as one of them has changed; you shouldn't need to re-download anything else.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
applied to trunk https://sourceforge.net/apps/trac/ufoai/changeset/29282

are all glsl shaders needed? i can only see one init function for combine2?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
oh, btw. it would be nice if we would use uppercase variable names for varyings in the shaders. just to keep the style to the existing shaders consistent.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
There seems to be a problem with putting the new code in:

Code: [Select]
error: 'for' loop initial declarations are only allowed in C99 mode|
...pops up in numerous places when trying to compile now, breaking the compile process.

This happened after I just updated from SVN a minute ago.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
@Everyone else reading this: This issue has now been fixed in the SVN.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Compiling a whole new version for a test now (including maps)...
Will report my findings soon.
Can't wait to see this stuff in action  ;D
Nevertheless I make a whole version (including maps), because I also want to test the different other map-bugfixes as well...

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Arisian, compliment.
You really pushed the geoscape into 2084 !!!
This looks awesome. Never seen a game with such a greatly looking earth before...
Great to watch the terminator-line moving over the earth dividing night & day, together with the bumpmapping happening. RESPECT !
I just realized that I just tested the version with the low-res textures, have to check the hi-res textures, too.
But I think that will completely blow me away  ;)...

  8)RESPECT AGAIN, TOP WORK !!!  8)

btw, tested dev29315.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
@Mattn: There is only the base/pics/geoscape/low directory in trunk @ the moment (low res version only)...  ::)

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
@Mattn: I'll try to keep shader "varying" variables capitalized; I hadn't realized that was the style.  With respect to the "convolution" shaders, you're correct that the current version only uses one of them.  The others are there in case you want to play with the FILTER_SIZE macro; basically, using the larger filters gives better quality at the cost of performance.  Actually, I think that probably the best way to do it would be to generate the shader code procedurally based on the FILTER_SIZE, which could possibly then be made into a user-changable option.  I haven't done that yet, though, so I just included the extra shaders in case people wanted to try them out.

@Destructavator: Sorry about that; I hadn't realized that style of for-loop syntax was only introduced in C99.  My compiler doesn't give me any sort of warnings at all, so I hadn't given it any thought.  In the future, I'll be sure not to declare my counters in my loop statements.

Let me know if anyone runs into any other bugs or issues; in the mean time, I'll see if I can't do something about the sun specularity...

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Here's another small patch; this one offers an improvement on rendering the earth's atmosphere, including both specular and diffuse styles of reflection/refraction.  It also fixes an issue with the positioning of the moon.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Code: [Select]
R_LoadShader: atmosphere_fs.glsl: 0(65) : error C1115: unable to find compatible overloaded function "pow(float, int)"
0(65) : error C1115: unable to find compatible overloaded function "pow(float, int)"

R_LoadProgram: atmosphere: Vertex info
-----------
0(41) : warning C7549: OpenGL does not allow C style initializers
0(42) : warning C7011: implicit cast from "vec4" to "vec3"
0(43) : warning C7011: implicit cast from "vec4" to "vec3"
0(44) : warning C7011: implicit cast from "vec4" to "vec3"
0(41) : warning C7549: OpenGL does not allow C style initializers
0(41) : warning C7549: OpenGL does not allow C style initializers
0(41) : warning C7549: OpenGL does not allow C style initializers


Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
fixed it in my commit. see r29345

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
 http://mattn.ninex.info/screenshots/geoscape_improved1.png
 http://mattn.ninex.info/screenshots/geoscape_improved2.png
 http://mattn.ninex.info/screenshots/geoscape_improved3.png

looks really great.

the scattering could be a little bit less bright at the dark side (in other words the fallout might be a little bit higher)