sidebar features
sidebar content

Go Back   Blender Artists Forums > Game Engine > Game Engine Resources

Reply
 
Thread Tools
AniCator's Avatar
AniCator AniCator is offline
Member
 
Join Date: Jul 2005
Location: The Netherlands
Posts: 2,110
Check it out!
Making a 2D/3D Skybox in the Blender Game Engine is ultra easy!

Watch:
http://www.youtube.com/watch?v=NgkeTBwdqhg

It isn’t that hard. I wonder why no one has ever tried it. (or has published it)
This is basically what the Source engine does. Only I use another scene for it.

Actually this was a 2D skybox but I converted it to a 3D one.
The 2D skybox uses a very basic copy orientation script. For the 3D skybox I added a copy position feature.
You should be able to do it yourself now.
The skybox is about 10 times smaller than the main scene. All of the high buildings are part of the skybox.
There are some lag issues though because I have to use a Python script to update the skybox every tic. But I can’t execute two commands on that single tic.
For example:
  • At frame 1: It gets the orientation and position of the main camera.
  • At frame 2: It sets the skybox camera’s orientation and position to the data it got from frame 1.
  • This means there will be at least one frame of lag. It’s hardly noticable in the 2D skybox but in the 3D skybox it’s a lot more visible.
I rendered the scene using Blender’s screenshot feature which took a screenshot every frame. I also set the logicTicRate to 30 for a steady framerate.
Then I glued all the screenshots together and that’s basically what you got to see.

Original post: http://www.anicator.com/2009/07/24/3...r-game-engine/

- AniCator

PS: I'll post a .blend within a few hours. It'll be another version that doesn't use GLSL.
PPS: Special thanks to
facundocouzo for putting this up: http://blenderartists.org/forum/atta...0&d=1248777614
I wonder why I didn't think of that.
............................................
Try not to become a man of success but a man of value.
KYouB - back for the 2010 Game Contest!

Last edited by AniCator; 28-Jul-09 at 16:07. Reason: Added facundocouzo's fix
#1   Old 24-Jul-09, 11:22   
Reply With Quote


Nikolay740 Nikolay740 is offline
Member
 
Join Date: Dec 2008
Location: Netherlands and Mother Russia
Posts: 265
looks cool
............................................
My BGE game project: Aerofight: Mechas and Airplanes
#2   Old 24-Jul-09, 11:28   
Reply With Quote
AniCator's Avatar
AniCator AniCator is offline
Member
 
Join Date: Jul 2005
Location: The Netherlands
Posts: 2,110
The purpose of this script is to make it possible to just work on your levels/maps/worlds without worrying about wrapping around a sky afterwards.

Download .blend file

- AniCator
............................................
Try not to become a man of success but a man of value.
KYouB - back for the 2010 Game Contest!
#3   Old 24-Jul-09, 11:55   
Reply With Quote
micah702's Avatar
micah702 micah702 is offline
Member
 
Join Date: Jun 2009
Location: Michigan, US
Posts: 382
Thanks, Christian Baker!
............................................
Best tutorials in the world -
http://www.tutorialsforblender3d.com/index.html


Best texture site in the world -
http://cgtextures.com/


My game project:
http://blenderartists.org/forum/showthread.php?t=167871

This is George:
(\__/)
(='.'=)
(")_(")
#4   Old 24-Jul-09, 16:10   
Reply With Quote
AniCator's Avatar
AniCator AniCator is offline
Member
 
Join Date: Jul 2005
Location: The Netherlands
Posts: 2,110
I'm working on a tutorial at the moment.
Skyboxes make creating levels easier. You won't have to worry about it any more. You won't have to worry about the size of the skybox or the clipping distance the camera should use so it would still see the skybox.
The sky will always be there.
I'm probably going to play around a bit more with the skybox. Put in some extra effects.
............................................
Try not to become a man of success but a man of value.
KYouB - back for the 2010 Game Contest!
#5   Old 26-Jul-09, 20:44   
Reply With Quote
moffboffjoe's Avatar
moffboffjoe moffboffjoe is offline
Member
 
Join Date: Aug 2008
Location: Derby, England
Posts: 221
uh, I've not watched the tutorial but why don't you just vertex parent the skybox to the characters center?
............................................
"I've got your nose, Mr. Anderson, and I'm going to keep it!"
#6   Old 26-Jul-09, 22:39   
Reply With Quote
Rorkimaru's Avatar
Rorkimaru Rorkimaru is offline
Member
 
Join Date: Jun 2008
Posts: 643
Quote:
Originally Posted by moffboffjoe View Post
uh, I've not watched the tutorial but why don't you just vertex parent the skybox to the characters center?
The idea is that everything in the real world is rendered in front of the skybox.


Using this technique you could layer a third scene (yes I hear the frame rate crying too) in front of the game scene and place cool sun flare sprites in it. Nice solution to a problem I remember having with flares
#7   Old 27-Jul-09, 18:06   
Reply With Quote
Teo_GreenGage's Avatar
Teo_GreenGage Teo_GreenGage is offline
Member
 
Join Date: Dec 2008
Posts: 517
great! I believe that this is a MUST for every sky type(space, earth, underwater) because of the fact that yu don't need huge camera draw distances and also the skymap is not affected by the mist. Parenting can create problems at fast speeds.I used this setup for a space scene a few months ago and is superior to the sphere/cube placed in the same scene, lifesaver.
............................................
There is no fun without YOU !
http://teogreengage.blogspot.com/

teo cazghir



Last edited by Teo_GreenGage; 27-Jul-09 at 19:41.
#8   Old 27-Jul-09, 19:28   
Reply With Quote
Nikolay740 Nikolay740 is offline
Member
 
Join Date: Dec 2008
Location: Netherlands and Mother Russia
Posts: 265
I am wondering, why skybox, why not skydome?
............................................
My BGE game project: Aerofight: Mechas and Airplanes
#9   Old 27-Jul-09, 19:42   
Reply With Quote
moffboffjoe's Avatar
moffboffjoe moffboffjoe is offline
Member
 
Join Date: Aug 2008
Location: Derby, England
Posts: 221
I am wondering, why skydome, why not skybox?
............................................
"I've got your nose, Mr. Anderson, and I'm going to keep it!"
#10   Old 27-Jul-09, 20:36   
Reply With Quote
Nikolay740 Nikolay740 is offline
Member
 
Join Date: Dec 2008
Location: Netherlands and Mother Russia
Posts: 265
because for flight sims and big out door scenes skydome would be better I guess
skybox is good for FPS, racing
............................................
My BGE game project: Aerofight: Mechas and Airplanes
#11   Old 27-Jul-09, 20:49   
Reply With Quote
moffboffjoe's Avatar
moffboffjoe moffboffjoe is offline
Member
 
Join Date: Aug 2008
Location: Derby, England
Posts: 221
you just answered your own question then
............................................
"I've got your nose, Mr. Anderson, and I'm going to keep it!"
#12   Old 27-Jul-09, 20:50   
Reply With Quote
AniCator's Avatar
AniCator AniCator is offline
Member
 
Join Date: Jul 2005
Location: The Netherlands
Posts: 2,110
It is possible to replace the box with a dome shaped mesh.
I'll cover it in the tutorial.
............................................
Try not to become a man of success but a man of value.
KYouB - back for the 2010 Game Contest!
#13   Old 27-Jul-09, 22:20   
Reply With Quote
facundocouzo's Avatar
facundocouzo facundocouzo is offline
Member
 
Join Date: Aug 2007
Posts: 51
hey! I fixed the lag stuff, now it does it on the same frame!
Attached Files
File Type: blend 2dskybox_by_facu.blend (543.1 KB, 218 views)
#14   Old 28-Jul-09, 10:40   
Reply With Quote
Teo_GreenGage's Avatar
Teo_GreenGage Teo_GreenGage is offline
Member
 
Join Date: Dec 2008
Posts: 517
hehe that's so cool- now you don't need 2 scripts, i guess it's more optimized this way!
............................................
There is no fun without YOU !
http://teogreengage.blogspot.com/

teo cazghir


#15   Old 28-Jul-09, 11:24   
Reply With Quote
Wahooney Wahooney is offline
Member
 
Join Date: Apr 2008
Location: Western Cape, South Africa
Posts: 40
I've used the same methods to create a 3d skybox and I also have the lag problem. I considered facundocouzo's solution too, but in my case my camera is attached to a dynamic object which can be knocked around, so that pretty much negates fac's solution... So like Kain in Kung-Fu I'm still wandering the earth, searching for answers
#16   Old 28-Jul-09, 17:01   
Reply With Quote
Fred_Pyo's Avatar
Fred_Pyo Fred_Pyo is offline
Member
 
Join Date: Mar 2002
Location: Asuncion, Paraguay
Posts: 781
Very interesting! I remember this hot topic regarding sync'ing skyboxes back in the old days... before bullet was used as the physics engine... Nice solution facundocouzo! This would be great for most games (fps for instance) where the camera is human controlled.

Linking the camera... haha... great!
#17   Old 28-Jul-09, 17:48   
Reply With Quote
facundocouzo's Avatar
facundocouzo facundocouzo is offline
Member
 
Join Date: Aug 2007
Posts: 51
@wahooney: by attached do you mean parented, children, using a camera actuator, scripted?, I think it would be pretty simple to get it working (obtaining the camera's local position, or using an empty , etc)
you could post an example
#18   Old 28-Jul-09, 18:45   
Reply With Quote
Wahooney Wahooney is offline
Member
 
Join Date: Apr 2008
Location: Western Cape, South Africa
Posts: 40
@facundocouzo:it's just simple parenting, camera linked to a geometric object. The thing is that the player can get knocked around, fall, jump, etc. and although it might be possible to coordinate jumping using your system, falling and being knocked around are damn near impossible.
#19   Old 29-Jul-09, 07:57   
Reply With Quote
AniCator's Avatar
AniCator AniCator is offline
Member
 
Join Date: Jul 2005
Location: The Netherlands
Posts: 2,110
Wahooney: You can use an empty as a reference object for the position. You parent the empty to the player object and then you use a script to copy and paste the position of the empty to the camera's position.
I can't write a script right now because this pc is a little bit to slow for that.
............................................
Try not to become a man of success but a man of value.
KYouB - back for the 2010 Game Contest!
#20   Old 29-Jul-09, 14:59   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 02:10.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists