0 registered members (),
1,173
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Can 3dgs use a 3d skybox like in hl2?
[Re: Grim_Jim]
#94632
10/16/06 12:53
10/16/06 12:53
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
i don't think there is a tutorial for that but it's simple (if you aren't a 3dgs beginner ). basically you just have to define a second view: Code:
view skyview { x = 2000; // place it where you geometry for the 3d-skycube is y = 2000; z = 1000; layer = -10; // set the layer lower than the default camera size_x = 1024; // set the size to your screen resolution size_y = 768; flags = visible; }
always rotate your skyview with the default camera: Code:
starter rotateskyview { while(1) { vec_set(skyview.pan, camera.pan); wait(1); } }
and make sure you don't use a background color otherwise the lower layer won't be visible: Code:
vec_set(sky_color, vector(0, 0, 0)); // put this into your main function for example
(everything off the top of my head so look into the manual if something doesn't work because i used wrong parameter names or made some other mistake...)
|
|
|
Re: Can 3dgs use a 3d skybox like in hl2?
[Re: ventilator]
#94635
10/20/06 06:39
10/20/06 06:39
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
this seems a lot easier: Quote:
sky.scene This flag is used for a sky model. Sky model polygons are drawn at infinite z buffer distance, thus not covering any other objects in the level. If this flag is not set, the sky model can cover level elements according to its distance. Range: on - model does not cover level objects. off - normal position(default). Type: flag (sky definition only) Example: Code:
sky mountain { type = <mountainsphere.mdl>; layer = 3; scale_x = 0.25; flags = scene,visible; }
quoted from the manual.
Quote:
Thats sad, I read somewhere that 3dgs had a helpfull comunity. I guess I read wrong.
hmm... i think he was referring to kihaku, not u ventilator. i mean, dont take this the wrong way, kihaku, but the question was whether or not A6 can use 3D skyboxes (like in half life 2), and if so, how to do it. asking him why is not helpful. though, i hav to say that's the only reason i can think of for the above quote. grim_jim, u were really stretching it to say that A6 has an unhelpful community, and while what kihaku asked and said wasn't a help, it was obviously intended to point u in a better direction or to actually find out for him/herself why u wanted to do this. to answer the question about why, however, i would recommend playing half life 2. it has awesome backgrounds (such as the citadel) which are fully animated, full 3D, and since they are rendered in the background they have the advantage of allowing the developer to make it with minimal detail while still looking awesome, because they'll always be seen from the exact same position.
julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Can 3dgs use a 3d skybox like in hl2?
[Re: JibbSmart]
#94636
10/20/06 21:40
10/20/06 21:40
|
Joined: Jun 2001
Posts: 385 Eastern Washington State
Zio
Senior Member
|
Senior Member
Joined: Jun 2001
Posts: 385
Eastern Washington State
|
Quote:
this seems a lot easier:Quote:
sky.scene This flag is used for a sky model. Sky model polygons are drawn at infinite z buffer distance, thus not covering any other objects in the level. If this flag is not set, the sky model can cover level elements according to its distance. Range: on - model does not cover level objects. off - normal position(default). Type: flag (sky definition only) Example: Code:
sky mountain { type = <mountainsphere.mdl>; layer = 3; scale_x = 0.25; flags = scene,visible; }
quoted from the manual.
I don't know why, but the scene flag has NEVER worked for me. I still have to scale sky objects up to ridiculous sizes to prevent them from clipping normal geometry.
So, I decided to try duplicating HL2's 3d skybox method, and I got it working perfectly.
Code:
// Don't forget to set bg_color.blue to 0 view skycam { layer = 0; flags = visible; }
function initCamera() { // This is where your hidden skybox is, either above or below the main level var skybox_z = -768;
while(1) { vec_set(temp.x,camera.x); vec_scale(temp.x,0.16); vec_set(skycam.x,temp.x); skycam.z = skybox_z; vec_set(skycam.pan,camera.pan); wait(1); } }
The code works great, the trick is properly making your level. Any HL2 mappers already know how.
You make your map as normal. Once you've got it done (or mostly done), make a cube and scale it so that it just barely covers your entire map. Then move the cube way above or below your level, some place out of sight so the player wont see it. Scale the cube down by 0.16.
This cube is now the guide for your skybox. Build your skybox around this cube. Once you've got the skybox made, delete your guide cube.
Make sure your skybox is directly above or below your level, not off to the side or anything. Make a note of how far above/below it is, and put this distance into the skybox_z value.
Be sure that your main level does NOT have a skycube surrounding it! That's right, you want the leaks that normally cause the hall of mirrors effect. What happens is, the skycam view is rendered behind the normal camera view, filling in the background areas. The skycam duplicates the cameras movement, but on a 1/16th scale, the same scale we built our skybox.
Since the skybox environment is made up of normal geometry and models and whatnot, you can use shaders and everything else you normally use in a level, making you able to make very impressive skyboxes. But since it's on a 1/16th scale, the impact on performance is minimal. You can make seemingly large background environments, when in reality they are tiny.
This page has a lot of information on how this method works, although its a bit different to set up in HL2 than 3DGS, but that's expected.
http://www.valve-erc.com/srcsdk/Levels/3d_skyboxes.html
|
|
|
Re: Can 3dgs use a 3d skybox like in hl2?
[Re: Zio]
#94637
10/23/06 07:15
10/23/06 07:15
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
that's pretty cool! good tricks there but camera movement is IMHO unneccessary. just like a normal sky cube, u aren't meant to actually be able to get any closer to any of the background scenery, which further improves performance because u kno exactly what polygons are going to be visible and how high the texture resolutions need to be in order to maintain good-looking detail. i guess u r right in saying that u could save a little performance by putting scenerey in like that and still having it move when the camera moves. the fact that the scene flag doesn't work is disappointing i had experienced that problem ages and ages ago, but wasn't aware that it still doesn't work, so i'll bring it up in Bug Hunt julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Can 3dgs use a 3d skybox like in hl2?
[Re: Grafton]
#94640
10/24/06 07:40
10/24/06 07:40
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
i hav played HL2, and i cannot remember a bit where it has camera movement with the skybox. the main example i can think of is in the early levels when u can see the citadel. it is a 3D, animated skybox, but the camera does not move with it (at least not in those levels, i can't be bothered playing through and looking for it). maybe it has a sky layer that does move, but that is unrelated. i see very little point with having the skybox simulate camera movement because it is just a waste of code and processing power: why not have full size scenery with lower-res textures and no collision detection? the size of the model doesn't matter much at all (to my knowledge), as it is still the same amount of points and texels seen on-screen. to me it sounds like extra work for nothing, so please give examples of improved framerate and explanations of why it actually helps. i guess if u can save level size vastly by having a miniature skybox it could be helpful, but if the background is on that sort of scale i dont see why u wouldn't use an ordinary skybox. please give explanations and examples of how and why it actually improves framerate! thanks julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|