About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
3D skybox
Author Message
uffo Offline
Member

Post: #1
3D skybox
Ever played around with the source engine? In addition with normal skybox you can add 3D skybox along with it.
This brings more life into the scenery, especially with city or other closed environment.
It's done by first modeling the skybox in lower scale and then with specific camera projected between the player and 2D skybox and it's parallax as the player moves through the level.

Could this be done with Esenthel engine? would be a nice addition (:

more info can be found here: <!-- m --><a class="postlink" href="http://developer.valvesoftware.com/wiki/3D_Skybox">http://developer.valvesoftware.com/wiki/3D_Skybox</a><!-- m -->
07-20-2009 09:34 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: 3D skybox
hi,
thanks for the idea. ive read the article but it doesnt say anything that would help. it's mostly about "how to create the 3d skybox in the source editor", but I dont know how the effect looks like, and how does it work exactly.
do you have some links to maybe video samples? to see the effect realtime, or more detailed description how it works? thanks
07-20-2009 12:35 PM
Find all posts by this user Quote this message in a reply
BYS Offline
Member

Post: #3
Re: 3D skybox
Hi, I just read this and I remember that the Unreal 2x engine uses the exact same approach (in 3x they use sky domes). I have read something in the beyond unreal wiki:

Quote:How does it work?
The workings of a skybox are actually quite simple internally. If any portion of a surface with Fake Backdrop set is visible, the skybox is drawn before any other drawing takes place. In other words, the skybox is drawn, then the rest of the world is drawn overtop of it. Surfaces with fake backdrop are not drawn at all, thus allowing the skybox to be "seen" "through" them. This is similar to looking through a fence - if you imagine the yard beyond drawn first and then the fence drawn overtop of it, you can still see the yard beyond through the openings and cracks in the fence. Likewise you can see the skybox "through" the fake backdrops in your level.

And here is another article:

http://www.absoluteastronomy.com/topics/...deo_games)

I think the biggest problem for the implementation in Esenthel is that the whole level has to be surrounded by a big box to draw the Skybox onto. Anyway I hope that is helpful in someways smile
07-20-2009 02:59 PM
Find all posts by this user Quote this message in a reply
sydbod Offline
Member

Post: #4
Re: 3D skybox
Here is a download of some documentation and source code for creating a skybox in another game library.
<!-- m --><a class="postlink" href="http://forumfiles.thegamecreators.com/download/1592166">http://forumfiles.thegamecreators.com/download/1592166</a><!-- m -->
It explains things very easily.
Hope it is of some help.
07-20-2009 03:53 PM
Find all posts by this user Quote this message in a reply
uffo Offline
Member

Post: #5
Re: 3D skybox
noes. those sound like normal 2d skyboxes (just textured cube/dome over the level).
what I'm talking about, is real meshes which act like the skyboxes (mountains, city buildings etc.)
first you build your map/level as you do normally. then you build seperate room in smaller scale which, in fact, is the enviroment you're gonna see surrounding you as the normal 2D skybox/dome but scaled then bigger (the 2D skybox is still there, but before that comes the 3D skybox).
gonna draw a picture for clarification, but mean time maybe this helps a little:

<!-- m --><a class="postlink" href="http://www.twhl.co.za/tutorial.php?id=106">http://www.twhl.co.za/tutorial.php?id=106</a><!-- m --> (still a tutorial for Hammer editor, but you can see the effect)
07-20-2009 08:42 PM
Find all posts by this user Quote this message in a reply
uffo Offline
Member

Post: #6
Re: 3D skybox
here's fast scetch in front view.
the main idea is, for example, that if you wanna see mountains in the horizon and the 2d picture just doesn't cut it (you have to admit those do look a little silly)
so you can build your own mountains. and when they're just small scale models they don't take that much from the cpu as opposed you'd build REAL mountain REALLY far away from the player and set the visibility to kilometers just to see them.

[Image: 3dskybox.jpg]
07-20-2009 09:03 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
Re: 3D skybox
a video showing this technique in action would be great wink
07-20-2009 09:13 PM
Find all posts by this user Quote this message in a reply
uffo Offline
Member

Post: #8
Re: 3D skybox
ok, here's one clip demonstrating it in use. however if you haven't played HL2 ep2, it's gonna spoil the ending grin
anyway, look at the tower you see in 1:00 and so on, it doesn't cull or fade out no matter how long the distance is from the player.
in fact it stays pretty much still. this is done with the 3D skybox.

<!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=TXRt3g0TaLQ&feature=related">http://www.youtube.com/watch?v=TXRt3g0T ... re=related</a><!-- m -->

and here's one from cs, it doesn't demonstrate the skybox very well, but you can notice one giant player hopping on the buildings at the horizon.
(flyed there with cheats);
<!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=etwGV8lKj0k">http://www.youtube.com/watch?v=etwGV8lKj0k</a><!-- m -->
07-20-2009 10:31 PM
Find all posts by this user Quote this message in a reply
sydbod Offline
Member

Post: #9
Re: 3D skybox
uffo Wrote:noes. those sound like normal 2d skyboxes (just textured cube/dome over the level).
what I'm talking about, is real meshes which act like the skyboxes (mountains, city buildings etc.)

I think you may have missed the FULL operating mode of a skybox.

Yes the skybox is just a cube/dome with textures on the inside surface.

The important part is that this cube/dome is positioned so that its origin point (0,0,0 point) is EXACTLY at the camera position, so that the skybox image behaves as if it is at some long distance away, and the image does not move like a close up object.

I do not understand why people just do not make their own skybox as it is easy to do.

1) make a cube with the faces pointing inwards, and texture the inside faces with 6 appropriate textures.
2) import the skybox into the game and scale it upwards to just stay within the maximum frustum distance.

3)disable SUN from within the game engine, and ONLY have ambient light active (any form of directional light MUST be turned off)
4)disable the sky rendering from within the game.

(GAME LOOP)
5)Position players camera to its view position/direction.
*******-> 6)position skybox origin to the camera position (skybox never gets rotated in any mode)
7)render the image with Z buffer disabled, and all light disabled, except for ambient light.(the skybox is now effectively the backdrop image)
8)re-enable all the ordinary game lights and the Z buffer, and render all the other game objects.

All this is covered in the link I provided.

EDIT: I don't know if we are allowed to mention other game libraries, but if we are not, then please erase the following:

One of the best examples of skybox usage is from the "Apocolyx 3D" game engine. (it is a scripted engine and therefor not in competition with "Esenthel" engine.
<!-- m --><a class="postlink" href="http://apocalyx.sourceforge.net/downloads.php#demos">http://apocalyx.sourceforge.net/downloads.php#demos</a><!-- m -->
Run the "Genoa" Level Genoa-lua-0.8.13.zip (11.9 Mb)(A huge level showing some views of Genoa, Italy.)

Move yourself upwards and to the edge of the player area, and you will soon see how the skybox integrates.
07-21-2009 12:59 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
Re: 3D skybox
sydbod : you're talking about ordinary skybox (ive tested the demo and it uses standard skybox, which is already supported by Esenthel)
But this thread is about a different skybox (3d skybox), which contains real 3D models rendered realtime in the game.
07-21-2009 11:44 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #11
Re: 3D skybox
uffo Wrote:ok, here's one clip demonstrating it in use. however if you haven't played HL2 ep2, it's gonna spoil the ending grin
anyway, look at the tower you see in 1:00 and so on, it doesn't cull or fade out no matter how long the distance is from the player.
in fact it stays pretty much still. this is done with the 3D skybox.

<!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=TXRt3g0TaLQ&feature=related">http://www.youtube.com/watch?v=TXRt3g0T ... re=related</a><!-- m -->

and here's one from cs, it doesn't demonstrate the skybox very well, but you can notice one giant player hopping on the buildings at the horizon.
(flyed there with cheats);
<!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=etwGV8lKj0k">http://www.youtube.com/watch?v=etwGV8lKj0k</a><!-- m -->
thanks, I now know better (more or less how it works)
the first video is better (the second has mostly static camera)

so in the first video the tower a 3d realtime model right?
could you tell me does the 3d skybox in the source engine support realtime dynamic lighting and dynamic shadowing? (im talking about only the models which are in the 3d skybox)
07-21-2009 11:50 AM
Find all posts by this user Quote this message in a reply
uffo Offline
Member

Post: #12
Re: 3D skybox
Esenthel Wrote:could you tell me does the 3d skybox in the source engine support realtime dynamic lighting and dynamic shadowing? (im talking about only the models which are in the 3d skybox)

yes, it's realtime. everything there can be animated, particles etc.

I suppose it has all the same features as the engine does, after all it's just a inaccessable small scale room included somewhere with the rest of the map (they're not builded seperately (though you can figure a new approach more suitable for your engine)).
07-22-2009 09:25 AM
Find all posts by this user Quote this message in a reply
Xerios Offline
Member

Post: #13
Re: 3D skybox
Esenthel, I hope you played half-life 2 cause the game is absolutely fantastic, especialy their engine which is extremely fast even on low-end pc's

I currently don't have the engine installed but from what I've experienced from just playing around in noclip mode I can tell you few things:

Seems like all the maps use lightmaps for shadows, and it's somehow blended with the dynamic object shadows like player etc, but that's just a theory it's been a long time since I've played half-life.

As for the '3d' skybox from what I remember they were just enormous 3d objects drawn far far away, I could even reach them and fly through (using noclip mode of course ). Just like a skybox the field of view probably doesn't affect them and they're constantly drawn. Nothing special =)

Here's a document I stumbled upon days ago showing how their shading works
<!-- m --><a class="postlink" href="http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf">http://www2.ati.com/developer/gdc/D3DTu ... hading.pdf</a><!-- m -->
and this one more descriptive
<!-- m --><a class="postlink" href="http://www.valvesoftware.com/publications/2006/SIGGRAPH06_Course_ShadingInValvesSourceEngine.pdf">http://www.valvesoftware.com/publicatio ... Engine.pdf</a><!-- m -->


I thought it could come in handy, to improve your engine =)
07-22-2009 05:34 PM
Find all posts by this user Quote this message in a reply
Post Reply