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

0 Members and 1 Guest are viewing this topic.

Offline Zacam

  • Magnificent Bastard
  • Administrator
  • 211
  • I go Sledge-O-Matic on Spammers
    • Minecraft
    • Steam
    • Twitter
    • ModDB Feature
Re: Skybox improvement - cube seam issue nullified
And also, the skybox method will hold up even under an engine over haul, and I can't say with 100% certainty that the FRED flag will, much less what will happen with a cross-platform FRED project.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!
Talk with the community on Discord
"If you can keep a level head in all this confusion, you just don't understand the situation"

¤[D+¬>

[08/01 16:53:11] <sigtau> EveningTea: I have decided that I am a 32-bit registerkin.  Pronouns are eax, ebx, ecx, edx.
[08/01 16:53:31] <EveningTea> dhauidahh
[08/01 16:53:32] <EveningTea> sak
[08/01 16:53:40] * EveningTea froths at the mouth
[08/01 16:53:40] <sigtau> i broke him, boys

 
Re: Skybox improvement - cube seam issue nullified
Hehe, no, that isn't very high quality at all ( :eek2:) *wonders if the 158th will pick up on this. . . . .
'yo my domestic skillets, who put swarm torpedoes on the Tev bombers?'
~Nighteyes

 

Offline Desertfox287

  • 27
  • Sweat saves blood-Erwin Rommel
Re: Skybox improvement - cube seam issue nullified
I really need to learn how to do that nice :D

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Skybox improvement - cube seam issue nullified
you could probibly automate ht's meathod with a skybox generator, which would cross-reference the textures and generate the borders automatically. actually i have a lua based tga parser somewhere which could probibly do this. so you feed it its 1020 textures and it would save a copy with the borders in-place. tga is a very easy format to code with, even in lua.
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 Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
you could probibly automate ht's meathod with a skybox generator, which would cross-reference the textures and generate the borders automatically. actually i have a lua based tga parser somewhere which could probibly do this. so you feed it its 1020 textures and it would save a copy with the borders in-place. tga is a very easy format to code with, even in lua.

Preferably 2040² textures. My observations suggest that 8192 pixels of horizontal resolution is sufficient to offer unscaled background at typical FS2 fields of view, so in many cases it is the optimal resolution.

Larger, 4090² textures can be used with one mip map to offer high quality backgrounds for narrower than default fields of view. Without a mip map they tend to cause shimmering with wide field of view.

An automated texture parser would be welcome as it would reduce the time of handling the textures significantly, but I would prefer if people knew how to manually do it before using automated methods.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

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
Try Google Chrome ?

 
 
On my Sony Ericsson W995? Not gonna happen :P
 
Don't worry. I can get this any time I want. At home.
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 Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Skybox improvement - cube seam issue nullified
you could probibly automate ht's meathod with a skybox generator, which would cross-reference the textures and generate the borders automatically. actually i have a lua based tga parser somewhere which could probibly do this. so you feed it its 1020 textures and it would save a copy with the borders in-place. tga is a very easy format to code with, even in lua.

Preferably 2040² textures. My observations suggest that 8192 pixels of horizontal resolution is sufficient to offer unscaled background at typical FS2 fields of view, so in many cases it is the optimal resolution.

Larger, 4090² textures can be used with one mip map to offer high quality backgrounds for narrower than default fields of view. Without a mip map they tend to cause shimmering with wide field of view.

An automated texture parser would be welcome as it would reduce the time of handling the textures significantly, but I would prefer if people knew how to manually do it before using automated methods.

i was thinking something along the lines of a stand alone utility to automatically insert the borders from the other 4 adjacent maps you just give it 6 2040^2 textures(really the size doesnt matter, it can be easily coded to take any size), then enlarge the textures and insert the proper pixels from the other maps. if i did it it would probibly use the command line lua interpreter from lua.org, and the commands and scripts would run from a batch file, could probibly also include a command line tga to dxt converter utility so that the maps could be converted to dds and dumped right in the game maps dir and would work.
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 Tarvis

  • 26
Re: Skybox improvement - cube seam issue nullified
Isn't it possible to do this with the cube model itself without having to specially modify the skybox textures themselves?

Can you map the adjacent textures using the model itself?

I know it's hard to imagine - here's a diagram I came up with to help explain. Basically using the UV mapping, the adjacent textures are mapped to the plane outside of where it intersects the other ones.

So it would do what is accomplished in the texture editing, but with the model itself using UV editing. Each face of the model hear would end up looking like a modified skybox texture if it were alone. The planes intersect where each texture crosses over into the new one.

Would this have the same problem or not? The player wouldn't see outside of the box anyways.

EDIT: Whoops, looks like I left out a top face. Oh well, it still conveys the point.

[attachment deleted by admin]

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
Isn't it possible to do this with the cube model itself without having to specially modify the skybox textures themselves?

Can you map the adjacent textures using the model itself?

I know it's hard to imagine - here's a diagram I came up with to help explain. Basically using the UV mapping, the adjacent textures are mapped to the plane outside of where it intersects the other ones.

So it would do what is accomplished in the texture editing, but with the model itself using UV editing. Each face of the model hear would end up looking like a modified skybox texture if it were alone. The planes intersect where each texture crosses over into the new one.

Would this have the same problem or not? The player wouldn't see outside of the box anyways.

EDIT: Whoops, looks like I left out a top face. Oh well, it still conveys the point.

That's what I tried first on model level. Having six planes with each having dimensions of 4.096 units, then moving them inward so that each plane was at distance 2.040 from the center.

It didn't work, the engine rendered each of the faces since transparency on skyboxes requires object hierarchy being set up correctly, and since the parts of the planes "out of the box" were part of the same level of hierarchy as the "visible" parts of the faces, it rendered the parts that were supposed to be hidden, and results were even more hideous than just having the seams.

I guess it would be possible to just use a black border, but I suspect that would result in similar seam issues as the original problem with cube shaped skyboxen.

I then presented my research results in IRC, asked for a way to cut away the parts of the planes that were outside the cube, and was informed that it could be done by adjusting the mapping. blowfish then provided me the model posted in the beginning of the thread. Essentially, this is one way of explaining how the model mapping works, except the parts of the maps that are outside the cube are simply not rendered.

Not only that but you would still have to modify the textures exactly the same way that is used in the model posted in the OP... unless I understood something completely wrong from your explanation.
« Last Edit: February 11, 2010, 05:57:44 pm by Herra Tohtori »
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Skybox improvement - cube seam issue nullified
i kinda fixed corners in my older skyboxes by moving the uv space inward exactly 1 texel width. uv coords are (16 bit?) floating point with 0,0 being one corner of the texture and 1,1 being the other corner (of course they can be more or less than that which is how tiling is done). now finding the width and height of each texel depends on the image resolution. i think 1/texture_width, 1/texture_height will give you the height and width of a texel in uv coords. a 512^2 texture is going to have a texel width and height of about 0.0019531. so instead of having each corner of a square polygon be at:
0'0
0'1
1'0
1'1
you would have them set to:
0.0019531,  0.0019531
0.0019531,  0.9980469
0.9980469,  0.0019531
0.9980469,  0.9980469

take care to avoid rounding errors, 16 bit floating point only gives you about 6 or 7 digits of accuracy with some margin for error. mind you these numbers are for 512^2 skybox textures, which is abit low res for freespace. even 1024^s are kinda block. i also cant remember if it worked or not.
« Last Edit: February 11, 2010, 10:34:40 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 Tarvis

  • 26
Re: Skybox improvement - cube seam issue nullified
That's what I tried first on model level. Having six planes with each having dimensions of 4.096 units, then moving them inward so that each plane was at distance 2.040 from the center.

It didn't work, the engine rendered each of the faces since transparency on skyboxes requires object hierarchy being set up correctly, and since the parts of the planes "out of the box" were part of the same level of hierarchy as the "visible" parts of the faces, it rendered the parts that were supposed to be hidden, and results were even more hideous than just having the seams.

I guess it would be possible to just use a black border, but I suspect that would result in similar seam issues as the original problem with cube shaped skyboxen.

I then presented my research results in IRC, asked for a way to cut away the parts of the planes that were outside the cube, and was informed that it could be done by adjusting the mapping. blowfish then provided me the model posted in the beginning of the thread. Essentially, this is one way of explaining how the model mapping works, except the parts of the maps that are outside the cube are simply not rendered.

Not only that but you would still have to modify the textures exactly the same way that is used in the model posted in the OP... unless I understood something completely wrong from your explanation.
What I meant was, for the areas outside the view to use the textures directly from the adjacent face (thus each face would be mapped twice) instead of a modified texture that has it added to it.

 
Re: Skybox improvement - cube seam issue nullified
Hey Herra, I finally tried it out and I must say it's very nice and "atmospheric" if you will.  :yes:

I have a question, that's probably going to be very newbish though: Can anybody take the skybox you provided and map our own textures to it? Will that work, or will we need to rebuild the whole thing in each case?

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - cube seam issue nullified
Hey Herra, I finally tried it out and I must say it's very nice and "atmospheric" if you will.  :yes:

I have a question, that's probably going to be very newbish though: Can anybody take the skybox you provided and map our own textures to it? Will that work, or will we need to rebuild the whole thing in each case?

The model should be useable for any kind of skyboxes, just change the textures. Changing the texture names in PCS2 is almost a trivial task. The model is out there for download for a reason. I should probably upload it to FSMods if it isn't there already...

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

 

Offline bigchunk1

  • bigchunk1 = Awesome²
  • 29
  • ...and by awesome I mean Jerk!
Re: Skybox improvement - get your seamless generic skybox model here!
Tried to follow the tutorial and I got this image:


I must be doing something wrong. I took six 2048^2 textures, resized them to 2040^2 and increased the canvas size to 2048^2 to get that white boundary. If I understand the tutorial correctly, the seemless uv mapping is supposed to account for this somehow, or perhaps i'm just lost. Please help!

Disclaimer: I don't pretend to know anything about skyboxes or image formatting or any of that sort!!! 
BP Multi
The Antagonist
Zacam: Uh. No, using an effect is okay. But you are literally using the TECHROOM ani as the weapon effect.

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - get your seamless generic skybox model here!
Tried to follow the tutorial and I got this image:


I must be doing something wrong. I took six 2048^2 textures, resized them to 2040^2 and increased the canvas size to 2048^2 to get that white boundary. If I understand the tutorial correctly, the seemless uv mapping is supposed to account for this somehow, or perhaps i'm just lost. Please help!

Disclaimer: I don't pretend to know anything about skyboxes or image formatting or any of that sort!!!


Underlined the problem here.

The trick to making this work is to surround each 2040^2 area with the adjacent texture edges. That way, the "gaps" between the textures are covered in the mapping, and the seams will disappear.



If you observe this sample image, you can see that there are four textures surrounding the center one, and the texture area is outlined with the darkened area. You can also see the white small squares in each corner, where the white background shines through.

If it's still unclear, ask further specifics in irc sometime.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline bigchunk1

  • bigchunk1 = Awesome²
  • 29
  • ...and by awesome I mean Jerk!
Re: Skybox improvement - get your seamless generic skybox model here!
That took quite a bit of careful pixel perfect placement, but I got it to work perfectly. Thanks.
BP Multi
The Antagonist
Zacam: Uh. No, using an effect is okay. But you are literally using the TECHROOM ani as the weapon effect.

 
Re: Skybox improvement - get your seamless generic skybox model here!
As mentioned above, it takes quite a bit of pixel-perfect placement to make this work. And those who get to make a fair few of these, know how time-consuming the job can be. So I made a GIMP script that does it for you.

Installation
1. Unzip the script into C:\Documents and Settings\<username>\.gimp-<version>\scripts
2. In GIMP, click Filters > Script-Fu > Refresh scripts
3. The script will now show up as "Envmap to skybox" in the Filters > Map menu.

Required input
  • Place your faces in the following way (it's the Blender envmap layout).



  • Recommended input resolutions are 6120x4080 (for 2048^2 maps) or 12240x8160 (for 4096^2 maps)
  • Merge all your layers into one (Ctrl-M)
  • Make sure your picture size fits your layer (Image > Fit Canvas to Layers)
  • Your image should be in RGB mode (Image > Mode > RGB)

What will happen
The script will ask you where and under what filename you want to save the faces. They're saved automatically as PNG, DON'T give the filename an extension!
The saved images will merge seamlessly when used with the skybox in OP.

MediaFire download: version 1.3, January 2016 (3kB)
« Last Edit: January 16, 2016, 02:03:09 pm by FreeSpaceFreak »

 

Offline Cyborg17

  • 29
  • Life? Don't talk to me about life....
Re: Skybox improvement - get your seamless generic skybox model here!
I know the first thing I'm doing when I get home. :-D

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Skybox improvement - get your seamless generic skybox model here!
This script works quite nicely.





 :)
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Angelus

  • 210
  • The Angriest Angel
Re: Skybox improvement - get your seamless generic skybox model here!
I DEMAND the downloadlink for this skybox!