Sky/spacecubes

Posted By: Joozey

Sky/spacecubes - 09/18/10 13:01

Hey all,

I've been pondering around with creating environment skies. After many tries on manually painting cubemaps and unwrapping all sorts of spheres for skydomes I was still left unhappy with the results (stretched textures on various parts of the sky, or having an obvious seam visible). Finally, I created a photoshop action that maps a cubemap out of a tiling scene, which came with pretty okay results (spare my paint skills :P):










Above examples are scaled down thumbs. Size of the original scene is 4096*2048 final cubemap is 6144*1024. Sometimes there are still tiny seams visible (and 3dgs often shows a pixel edge) but this is as good as I can do.


Download spacecubes (.rar, 16MB)

View spacescene1
View spacescene2


If anyone wants to convert his scene to a cubemap post it here. But beware that your scene has to be a size of 4096*2048 or lower, else you will lose quality. The top and bottom parts are generated from 1/4th height of the top and bottom resp. of the original image, merged into a square. The middle of these parts still have a little seam but can easily be covered manually after conversion.

Regards,
Joozey
Posted By: Landixus

Re: Sky/spacecubes - 09/18/10 13:04

not bad laugh
Posted By: Joozey

Re: Sky/spacecubes - 09/18/10 15:50

Thanks laugh
Posted By: Superku

Re: Sky/spacecubes - 09/18/10 17:08

I like the colours very much!

Could you please post an in-game screen shot?

EDIT: That's weird, I've just tried to use the first skycube in my game, it displays correctly in WED but I just get a very blurry blue background. (I must admit that I don't have much experience with sky cubes or skies in general).
Posted By: MrGuest

Re: Sky/spacecubes - 09/18/10 22:48

Nice work, tis a shame about the seam.
Originally Posted By: Superku
Could you please post an in-game screen shot?
Easier said than done with skies.

try this
Code:
#include <acknex.h>
#include <default.c>

#define PRAGMA_PATH "Images\\Skies"

ENTITY* ent_sky;

void sky1(){
    ent_morph(ent_sky, "spacecube1+6.bmp");
}

void sky2(){
    ent_morph(ent_sky, "spacecube2+6.bmp");
}

void main(){
    
    on_1 = sky1;
    on_2 = sky2;
    
    video_screen = 1;
    video_mode = 9;
    
    wait(1);
    
    level_load(NULL);
    
    ent_sky = ent_createlayer("spacecube1+6.bmp", SKY | CUBE, 1);    
    
}

Obviously change the path they're in grin
Posted By: Joozey

Re: Sky/spacecubes - 09/18/10 23:56

I couldn't get it properly working in WED applied on a cube (just tiled wrong) but it works fine in-game. MrGuest's code should work, I always initiate such things through code myself, and I got it working (A7 Pro). Well, I think it needs the SHOW flag too wink. SKY | CUBE | SHOW.

I think I'll paste a video later here if I got a little game up and running.

Here is a picture from some astronomy site converted to cubemap within a minute, so not realistic as space doesn't wrap around there in real life tongue. Works great, just a bit pasting on the edge to make it seamless.

LARGE FILE! 18MB
http://www.joozey.nl/3dgs/contribs/skycubes/spacescene3+6.bmp

Original:
http://blog.deepskycolors.com/archivo/2010/09/17/andromeda-M31-versus-Triangulum-M33.html
Posted By: MrGuest

Re: Sky/spacecubes - 09/19/10 00:34

Originally Posted By: Joozey
Well, I think it needs the SHOW flag too wink. SKY | CUBE | SHOW.
Strangely, though probably not as with most of GS, you don't need to pass the SHOW flag, as the entity is drawn when created as with world entities.

Also, the SHOW flag isn't even used for view entities, and to hide and show them you could set and reset INVISIBLE as with world entities.

Unless, just for conitec to confuse everyone even more, SHOW, SKY and CUBE are all used for flags2 and not flags, so you'll need
Code:
ent.flags2 &= ~(SHOW);

if you want to hide the entity this way.

In summary, use:
Code:
set(ent, INVISIBLE);
reset(ent, INVISIBLE);

or
Code:
ent.flags2 |= SHOW
ent.flags2 &= ~SHOW;

try not to mix them


Nice 3rd sky btw grin
Posted By: Joozey

Re: Sky/spacecubes - 09/19/10 00:52

I had a blue standard background when I don't SHOW it. If I set VISIBLE then it is visible but all the models in the level are clipped away unless approached very closely (independent from camera.clip_far), but SHOW worked.

Now testing again, it works without SHOW :\. Sometimes, I don't get 3dgs.
The manual is not agreeing with you, and uses SHOW anyway.
Posted By: CHaP

Re: Sky/spacecubes - 09/21/10 14:55

Oh great! I was looking for something like that!

THX!
Posted By: Liamissimo

Re: Sky/spacecubes - 09/21/10 15:29

I took it for Gravix, hope it is okay but my old looked creepy grin
Posted By: Joozey

Re: Sky/spacecubes - 09/21/10 16:31

Use them as you please laugh
Posted By: jigalypuff

Re: Sky/spacecubes - 09/21/10 23:33

Joozey, nice work but have you tried http://alexcpeterson.com/spacescape ? Give it a go, you`ll love it
Posted By: Joozey

Re: Sky/spacecubes - 09/22/10 01:01

No but it looks awesome grin.
Thanks for sharing, will definitely try it out.
Posted By: Blink

Re: Sky/spacecubes - 09/22/10 20:31

thanks, they look awesome!!!
© 2024 lite-C Forums