Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,173 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 2 of 2 1 2
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 Offline
Senior Expert
ventilator  Offline
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: Grim_Jim] #94633
10/19/06 00:55
10/19/06 00:55
Joined: Oct 2006
Posts: 8
New Jersey, USA
Grim_Jim Offline OP
Newbie
Grim_Jim  Offline OP
Newbie

Joined: Oct 2006
Posts: 8
New Jersey, USA
Thats sad, I read somewhere that 3dgs had a helpfull comunity. I guess I read wrong.

Re: Can 3dgs use a 3d skybox like in hl2? [Re: Grim_Jim] #94634
10/19/06 01:10
10/19/06 01:10
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
hm? didn't my last post point you into the right direction? where exactly are you stuck? maybe you have to learn some basic scripting first?

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
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

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
Z
Zio Offline
Senior Member
Zio  Offline
Senior Member
Z

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
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

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: JibbSmart] #94638
10/23/06 20:38
10/23/06 20:38
Joined: Jun 2001
Posts: 385
Eastern Washington State
Z
Zio Offline
Senior Member
Zio  Offline
Senior Member
Z

Joined: Jun 2001
Posts: 385
Eastern Washington State
The camera movement actually helps a lot, it gives you a lot more options with your 3d skybox. If you've ever played HL2, you can see why. You can have buildings and terrain be in your skybox, and since the camera moves with the player movement, it looks completely seamless.

I want to put together a little level showing this in action, I'll post it if I come up with something.

Re: Can 3dgs use a 3d skybox like in hl2? [Re: Zio] #94639
10/24/06 00:37
10/24/06 00:37
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
Quote:

I want to put together a little level showing this in action, I'll post it if I come up with something



That would be nice, then we could see firsthand what the advantages are over a
regular skybox.


Not two, not one.
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
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

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!
Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1