Author Topic: Skybox improvement - get your seamless generic skybox model here!  (Read 44417 times)

0 Members and 1 Guest are viewing this topic.

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Skybox improvement - get your seamless generic skybox model here!
Some of you may already be familiar with the limitation of cube-shaped skyboxen; the ugly seams visible between the cube faces. The technical issue behind the problem is a rather deep one and suffice to say, perfect solution is not available without DirectX 10 level of rendering engine if I recall correctly*. However, things can be done to get over this issue, and today, after an IRC discussion on the subject, blowfish put together a model that uses a bit different mapping than the typical face=texture style that would seem logical and most straightforward to use. As a result, skyboxes with no seams can now be used with a generic skybox model, with a negligible texture resolution sacrifice.

This model can be, if desired, put inside the mediaVP starfield skysphere, and with alpha blended textures pretty much limitless amount of options is now available. Things like being in atmosphere, or having rings of a planet reach behind you, are now possible without seams and with supreme quality.

The mapping scheme used is as follows: When using texture resolution of 2048^2, the actual part of the texture mapped to the side of the cube is now 2040^2. The remaining edge of the texture space is used to border the texture with the corresponding edges from the textures next to it, which will negate the issue that caused the seam edge issue to begin with.

Here is a sample image of how to edit the textures to get the correct results in-game:



This is a 1024^2 texture, so the area used by the actual texture is 1020^2 and the two pixel border between is filled with adjacent sides' textures, as you can see from here. The darkened areas are shown here just for clarity.

In-game screenshots just for the hell of it (this skybox isn't especially high quality, since I just put it together for the purpose of testing the seamless skybox model):







DOWNLOADS HERE

Here is a simple version to get the skybox and a batch of test maps:

generic-skybox-redist.7z

And here is a more complete version that contains .xcf files (native GIMP format, PSD can be provided if requested) and the source 1024^2 textures for the sample skybox:

generic-skybox-dev.7z


Credits:

Model: blowfish
Maps: Hipshot @ www.zfight.com, edited by Herra Tohtori, source image available at http://www.zfight.com/misc/images/textures/envmaps/stormydays_large.jpg

Enjoy your new seamless skyboxen, everyone!

EDIT:
* As per discussion later in the thread, this turns out to be bogus partially incorrect. There is apparently a new feature that will be in 3.6.12 that will allow the use of standard six-side skybox cubes without the seam issues, by setting the skybox rendering to clamp the textures via a FRED flag. However, there are other issues associated to this method - mainly environmental mapping still suffering from the seams and dependancy on a graphics card that can actually do the required stuff.

The technique mentioned in this post is still applicable if you want to avoid envmapping issues or when using an older build that doesn't support the force clamp flag.
« Last Edit: May 28, 2011, 02:33:16 pm by Herra Tohtori »
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Fury

  • The Curmudgeon
  • 213
Re: Skybox improvement - cube seam issue nullified
:yes:

Quote
(this skybox isn't especially high quality, since I just put it together for the purpose of testing the seamless skybox model)
:wtf: yeah, right

 

Offline Ziame

  • 28
  • ED ftw
Re: Skybox improvement - cube seam issue nullified
:wtf: yeah, right

QFT.

Awesome thing, even cooler skyboxes coming yeah!
Rabbinic Judaism had a good start with the Old Testament but kinda missed the point about 2000 years ago

ALL HAIL HERRA
/fan of BlackHole

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
Oh come on, I totally ripped the textures from the first skybox I could find via Google that had passable quality for testing purposes... that's not the main point here. :lol:
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 
Re: Skybox improvement - cube seam issue nullified
Oh my ****ing god, that's pretty...
Imma make a wallpaper out of this.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Skybox improvement - cube seam issue nullified
 :yes2: :D :yes:
Awesome herra, awesome.
Totally going to be using this (and yes, that includes that 'skybox that isn't especially high quality'  :lol: )
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Thaeris

  • Can take his lumps
  • 211
  • Away in Limbo
Re: Skybox improvement - cube seam issue nullified
 :eek2:

I want to fly the Loki in the atmosphere now...
"trolls are clearly social rejects and therefore should be isolated from society, or perhaps impaled."

-Nuke



"Look on the bright side, how many release dates have been given for Doomsday, and it still isn't out yet.

It's the Duke Nukem Forever of prophecies..."


"Jesus saves.

Everyone else takes normal damage.
"

-Flipside

"pirating software is a lesser evil than stealing but its still evil. but since i pride myself for being evil, almost anything is fair game."


"i never understood why women get the creeps so ****ing easily. i mean most serial killers act perfectly normal, until they kill you."


-Nuke

 

Offline IronBeer

  • 29
  • (Witty catchphrase)
    • Minecraft
Re: Skybox improvement - cube seam issue nullified
Hm. Looks like the bar for background quality has been raised.
 :yes: Excellent work.
"I have approximate knowledge of many things."

Ridiculous, the Director's Cut

Starlancer Head Animations - Converted

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Minecraft
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: Skybox improvement - cube seam issue nullified
yet another magic rabbit pulled out of the hat well done Herra Tohtori, blowfish and anyone else involved
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: Skybox improvement - cube seam issue nullified
Blasted mediafire incompatibility with opera mini. . ....
 
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Skybox improvement - cube seam issue nullified
<skyboxes>

:yes: :nod:

Blasted mediafire incompatibility with opera mini. . ....
 

Try Google Chrome ?

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Skybox improvement - cube seam issue nullified
i would have done it by clamping the textures, but this works.

the downside is any maps currently in existance would need to be downsampled for this to work, unless of course you have the original scene to render from. if said maps are in a compressed format and you dont have the original uncompressed version, you will probibly loose substantial quality. i probibly wouldnt loose anything since most of the skyboxes im using i rendered myself.

on the other hand this kinda has some good points, since you could standardize the whole skybox interface. and the alpha blending is a good touch. thought i wouldnt mind having -clamp textures as an interim till we have a materials system. a system where we only have to specify a texture set, and not have to worry about editing a model, would be even better.
« Last Edit: February 02, 2010, 01:40:39 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Skybox improvement - cube seam issue nullified
i would have done it by clamping the textures, but this works.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
i would have done it by clamping the textures, but this works.

the downside is any maps currently in existance would need to be downsampled for this to work, unless of course you have the original scene to render from. if said maps are in a compressed format and you dont have the original uncompressed version, you will probibly loose substantial quality. i probibly wouldnt loose anything since most of the skyboxes im using i rendered myself.

on the other hand this kinda has some good points, since you could standardize the whole skybox interface. and the alpha blending is a good touch.


If you have an improvement in mind, please share.

How would this texture clamping be done? In the model/mapping or in the game engine while rendering the skybox? If the texture clamping can be set up easily, why has no one done it before? Does FS2_Open support it? I definitely agree with the downside of having to edit the textures like this (especialyl the re-scaling part, which can mess up some things rather easily compared to rendering them to the required resolution to begin with), but I was led to believe that there is no simple way to get around the seam issue, based on the threads about it in the past.

Alpha blending isn't anything specific to this model really, it's just something that can be done if someone for example wants to put content within the mediaVP's starfield but doesn't want to render that into the sides of the cubes.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Skybox improvement - cube seam issue nullified
clamping is supported by the graphics abstraction but theye is no way to tell it to use it in the model file.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
clamping is supported by the graphics abstraction but theye is no way to tell it to use it in the model file.


Does that mean it can or cannot be done at the moment?

Can the skybox rendering be changed so that it does support it, if it doesn't do it at the moment?
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Skybox improvement - cube seam issue nullified
Isn't this what the FRED clamping flag was added for?  Per WCS' request?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
Oh well. This method can still be used if for some reason use of older builds that don't have this texture clamp feature enabled is for some reason required.

Like the Blue Planet: Age of Aquarius re-release which will be 3.6.10 compatible


And at any rate, it's sort of good that this information came out now rather than before re-making the skyboxes into new format.

The headline of this post might as well stay as it is, considering this is the first time I have heard of this new feature it is likely the first time many others hear of it as well. I'll edit the first post to include this information.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Skybox improvement - cube seam issue nullified
The Mantis issue for their request was #1914
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
The plot thickens:

Quote
22:46 <@Zacam-Work> *sighs* Force clamp still requires a GUP that can apply that to cubemaps whichi isn't a lot of them.
22:47 <@Zacam-Work> And it's not bogus, but I will look into the fred flag anyway.
22:51 <@Zacam-Work> I think what the flag is doing is forcing an iterative clamping for the seam edge for skyboxes rather than relying on the dynamic
                    instancing that is only available in DX10 class cardse. Key item to note there is: Dynamic. This doesn't preclude the ability to
                    statically do a seam edge clamp prior to hadning it off and appying it in the model, and in fact I think it's scaling the textures for
                    rendering in exactly the same way you're doing it manually.
22:56 <@Zacam-Work> Also, are the faces textures being mip-mapped, and how does it hold up to changing quality levels in-game?
22:57 <@Zacam-Work> Because I can almost guarantee that at lower detail levels, the same edge seam problem may still exist (but maybe not, if it's not fused
                    sides....hmmm.)
22:58 <@Zacam-Work> What the flag does, _I think_ is it renders the seams for all mipmap levels and all faces into one FBO, then does a series of
                    glCopyTexSubImage2D() from the FBO to correct the texture.
22:59 <@Zacam-Work> "BTW, mipmaping on cubemaps will not work correctly on the seams because there is no filtering across faces. So if you are doing dynamic
                    env mapping (rendering into a cubemap) then you will manually have to correct the seams. Or if you are doing static environment mapping,
                    you might want to manually generate your cubemap mipmaps using some preprocessing tool which puts in a correction for the seams like the
                    program
22:59 <@Zacam-Work>  CubeMapGen, and then completely bypass GLU or automatic mipmap generation and load all the preprocessed mipmaps manually.."
22:59 <@Zacam-Work> Per post in the nvDevZone.
23:03 <@Zacam-Work> Oh, and its backed on the AMD Developer Zone as well, so it's not unique to NV cards.
23:03 <@Zacam-Work> "Despite the fact that cube maps are defined on the spherical domain, standard cubemap mipchain generation techniques perform filtering
                    independently on each cube face. The main problem with this approach is that no information is propagated across edges, thus creating
                    undesirable discontinuities along the cube face edges. A limitation of nearly all cube mapping hardware which makes the seam problem
                    substantially
23:03 <@Zacam-Work>  worse is the fact that the bilinear texel filtering is not able to fetch across cube faces thus producing a hard seam artifact in
                    addition to introducing aliasing artifacts. These two compounding problems limit the usefulness of cubemapping."
23:03 <@Zacam-Work> So no, the problem is _not_ bogus.
23:06 <@HerraTohtori> oh... so the cubemap would still have the seams and therefore envmapping?
23:08 <@Zacam-Work> Correct.
23:09 <@HerraTohtori> well isn't that a barrel of laughs
23:09 <@Zacam-Work> It's just, with your method, you are manually correcting the issue by map displacement almost like a postprocessing effect to deflect
                    the issue. Which is actually really god damn clever and I'd prefer to see that used than the FRED flag which relies on more
                    computational horsepower for the same result.
23:10 <@HerraTohtori> WCSaga doesn't exactly hae much envmapping going on either
23:10 <@HerraTohtori> so they will likely have no problem using the flag

So basically we have here two methods with different pros and cons. Using the flag allows to keep the textures at full resolution without re-scaling and other texture adjustments associated to the other method, but it requires a GPU that supports the process and it will still have the seams in the environmental mapping.

The other method with the adjusted cube will work without the flag on all FS2 builds that support skyboxes, will work correctly with environmental mapping, but is significantly less convenient and ideally requires the skybox textures to be rendered at 2040^2 resolution originally rather than re-scaled from the 2048^2 textures.

In short: Convenience vs. Quality.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.