Jump to content

How to create Sky in 3D games

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
sdanyal

sdanyal

    Newbie

  • Members
  • PipPip
  • 11 posts
I am going to build a 3d racing game but i failed to make sky. Can anyone tell me that how can i create sky in game
Please tell me some methods or tricks for creating sky.
Also can anyone give me example program which is compile-able so that i can easily understand

#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 765 posts
I believe most (if not all) games use already rendered sky image to draw the sky instead of use complex algorithm to render it in real time. The latter technique would need a lot of time (cpu cycles) to calculate the algorithm and still has to render the result to screen.

So you have to create a bitmap large enough to cover your screen in any possible resolution (or you can stretch), or large enough to cover multiple screen if you want dynamic sky illusion, in Photoshop or something like that (I believe there are many photoshop filters can do this task nicely). And in your game you just need to pick the part of that image and render to screen. Much much easier and faster :)

#3
sdanyal

sdanyal

    Newbie

  • Members
  • PipPip
  • 11 posts
looking easy but didn't understand fully!
please give me a example program because i have tried this method earlier

#4
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 765 posts
Okay, let me break down into steps.

  • Create a sky image, save it in any image format you prefer.
  • When starting your game load that sky image into memory
  • everytime you draw to screen, draw that sky image first. This is to make sure that it's becoming the background.

I haven't wrote any code in VB for too many years, so I cannot give you sample code. Sorry. But just follow the steps above and you will be fine.

Cheers!