Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (595)
Games in Android Showcase (168)
games submitted by our members
Games in WIP (646)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  What is the best method for a background ?  (Read 1713 times)
0 Members and 1 Guest are viewing this topic.
Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Posted 2004-01-10 14:39:16 »

I need some advise in this area. I can create a background for a 3d world that looks very nice with a sphere wrapped with background picture. The texture only has to tile on the horizontal and after applying a photoshop filter that does a distortion for polar coordinates it works pretty well.

However I dont know the advantages of other methods. I know that a cube can  be used instead with 6 tiling pictures but do we have to apply any distortion filter to the textures to make them look seamless not like a  cube ?

What about if we use a cylinder for the background 3d object ? What are the advantages ?

Another thing im trying to simulate a day/night cycle like in Morrowind, with the sun moving in the sky and the sky fading into a star field. Any sugestion on how to do this ?

Offline Breakfast

Senior Devvie

for great justice!

« Reply #1 - Posted 2004-01-10 18:30:14 »

I have been giving this some thought myself - I'm afraid I can't be a world of help with the skybox thing, I have usually used a sphere for this, but on the weather pattern thing I have tried to think through a route to having it work.

I think the best way is to use a Texture-By-Reference to map the skybox and use Java2D to generate the actual image. Now I think about it, it may be a lot easier to do this using a square skybox because otherwise you need to sort out sphere mapping as well as any changes to the image itself.  

I would suggest using a standard day/night pattern with straight blue-sky through to starry night and then overlaying a plasma cloud pattern over it. It may even be smart to alphablend the layer and place it on another shape inside the skybox to create some degree of parallax, but it may be as effective and more efficient to merge the two layers into a single image.

If you're not too up on them, plasma patterns are often used in fractal terrain generation - there is a good tutorial page here.
Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Reply #2 - Posted 2004-01-11 15:11:52 »

Thanks for your help. I use real images for the sky but its neccessary to equalize the bright in photoshop for those pictures before using them otherwise it gets hugly.

I have a problem with making a background using a cube and 6 textures. The problem is that it looks like a cube. Specially in the corners. Maybe I have to do something to the textures or the cube before rendering the background geometry. Any help would be apreceated.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom
« Reply #3 - Posted 2004-01-11 16:27:16 »

The skybox will look ugly unless the textures are made properly. This is done by setting up 6 cameras in a modelling progam, where the lenses makes up a unit cube. I found some skybox textures here:

NB! the pk3 file inside the zip is actually a zip. Rename it and unzip it.

Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Reply #4 - Posted 2004-01-13 20:29:45 »

That sky box page was quite useful. Thanks a lot.

How exactly do you set up the 6 cameras to make a unit cube ? And how do you use the raw images in there ?

I supose you use each of the 6 cameras to take a snapshot image, distorced by those cameras, that will will render nicely in the skybox.
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #5 - Posted 2004-01-13 21:13:56 »

Terragen can be used to make nice skyboxes if thats the style you're after. The only thing you need to remember is to set the field of view to 90 deg and generate square images for each direction. The perpective warping will be correct when applied to a skybox then.

Terragen gives you a whole bunch of rendering options as well, and I seem to remember one being to render without the sky, so you could keep it separate to make it change in game Smiley

Btw, Serious Sam used Terragen to create its skyboxes.

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Reply #6 - Posted 2004-01-14 19:53:11 »

Yes, i made a google search a while ago and it come up with terragen. It looks a good program. It also gave me a lot of serious sam howto pages for skyboxes. I have to look at this program more carefully. Thanks.

Im also trying to determine the type of distortion op used in the raw texture images before using them on a cubic skybox. I think its some sort of equation using sin and cos that makes each texture shrink at the center. Then maybe i can use the advanced imaging api to work on the images without need to use extra programs.
Offline tom
« Reply #7 - Posted 2004-01-14 20:34:12 »

how does your raw textures look like?

It's difficult to create a skybox from just any odd image. If you wan't good result you'll have to render  the skybox textures.

Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Reply #8 - Posted 2004-01-14 20:44:06 »

I was thinking of geting some real images of backgrounds from the internet or take some real photos with a digital camera and make them tile with each other using photoshop stamp tool. However if i just use them like that it just looks like i am inside a big cube.
Offline tom
« Reply #9 - Posted 2004-01-14 21:03:34 »

Then I think you're better off using a cylinder, sphere or some other object. However, if you manage to create a background object that looks good with your raw texture mapped to it, then it is possible to convert that to a skybox.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Breakfast

Senior Devvie

for great justice!

« Reply #10 - Posted 2004-01-15 07:20:47 »

If you want that morrowind weather conditions type sky you are definitely going to be better off having a plain coloured sky with the sun in it and then generating the clouds on the fly rather than using photos.
Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Reply #11 - Posted 2004-01-15 19:44:20 »

I saw the sky images generated by terragen and they are very realistic. Its not such an hard work applying the math to do the clouds. It could even be done in a background thread that updates the sky every second without delaying a game too much.

Im almost shure Morrowind uses pre-rendered sky images and color palette animations. Morrowind only renders the sky part of the background not the sides. This is because of the cell loading system they used to make a continous world, so its not difficult for them. Daggerfall the previous game used to render both the sky and the sides of the background with mountains and stuff as well as using a similar cell loading system.

Using internet background photos with skyboxes probably requires a little tweeking  with photoshop but im shure with the right filters it can be done easly.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

deepthought (48 views)
2015-06-30 15:39:44

deepthought (55 views)
2015-06-30 15:39:09

deepthought (65 views)
2015-06-30 15:36:52

Za\'Anzabar (42 views)
2015-06-29 05:44:54

TritonDreyja (49 views)
2015-06-24 17:10:40

CopyableCougar4 (48 views)
2015-06-23 00:34:45

BurntPizza (55 views)
2015-06-21 20:36:46

cookiecompiler (94 views)
2015-06-11 15:42:53

cookiecompiler (56 views)
2015-06-11 15:41:14

NegativeZero (81 views)
2015-06-11 09:49:18
How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!