Archived

This topic is now archived and is closed to further replies.

vonsatan

Q3 skies

Recommended Posts

vonsatan    122
I''m loading quake3 bsp''s... and have now come to rendering the skies but i''m having a problem with it. Does anyone know how they are implemented? .... they seem to just be projecting the sky onto the polygons defined as the sky ...rather than having a large box....how can i do this?

Share this post


Link to post
Share on other sites
Vetinari    133
They are done with a big box. I''ll post more in a few minutes if no one else chimes in.


Mike

"The state is that great fiction by which everyone tries to live at the expense of everyone else." - Frederick Bastiat, The Law

Share this post


Link to post
Share on other sites
vonsatan    122
ok, the sky shaders have sky boxes defined..i see that, but are there any poly''s associated with these boxes (in terms of rendering)? or do you just use these shader values and draw a big box?...even so.. the cloud planes are different..how do you do them?!

Share this post


Link to post
Share on other sites
Vetinari    133
You''d do better to look yourself than listen to my guesses. If you have q3a you can run it ''wireframe'' mode. At the main screen, go to the console and type devmap "q3ctf1". After it loads type in the console /r_showtris 1. You can see how the box is rendered yourself. You draw the cloud planes in different blended passes according to the shader specification.


Mike

"The state is that great fiction by which everyone tries to live at the expense of everyone else." - Frederick Bastiat, The Law

Share this post


Link to post
Share on other sites
vonsatan    122
yes, i have tried this ..and seen the triangles
but, for example.. in q3dm1 the sky is not one big box but rather lots of poly''s covering the holes where the sky would be seen. Also note that the shader used for the sky in this level doesnt specify any skyboxes...just a couple of blended cloud planes. But it still makes it look like a skybox somehow...how!?

Share this post


Link to post
Share on other sites
freshya    122
Not sure if this is how Quake3 does it, but you could try drawing your skybox as per usual (ie. a cube) and then just NOT drawing every polygon that is marked as ''sky''. That might not be how Q3 does it internally but I''m guessing it would work.

Share this post


Link to post
Share on other sites
vonsatan    122
yeah...i was just thinking that..hmmm..might work
but it still doesnt solve the cloud plane problem.... how do they get it to look a distance away and also look like it goes to the horizon?... might try manually doing a sphere map kinda thing...hmmmmm..

Share this post


Link to post
Share on other sites
Fidelio_    122
quote:
Original post by vonsatan
I''m loading quake3 bsp''s... and have now come to rendering the skies but i''m having a problem with it. Does anyone know how they are implemented? .... they seem to just be projecting the sky onto the polygons defined as the sky ...rather than having a large box....how can i do this?


Quake 3 doesn''t actually have a sky box in the level, the engine creates it, but it has a sky texture. What happens is that when you paint a window with the sky texture you will see the sky, projected in such a way that it looks correct. So there''s no transparency, the texture changes based on the viewing angle.

It would be much simpler in your own games to just have a skybox and leave windows empty.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Q3 uses the sky-shaded polygons as "hint" on what part of the sky(-box) you can see through the window.

"It would be much simpler in your own games to just have a skybox and leave windows empty."

This approach would result in lower framerates than Q3´s method, because of the overdraw you create. Q3 tries to minimze overdraw by drawing (approximately) only those parts of the sky that are really visible.

If you want to see how that can be done, have a look at my engine´s source:

http://www.tu-ilmenau.de/~amigo


skynet

Share this post


Link to post
Share on other sites
Vetinari    133
If you look at q3dm1, you will see it''s the same idea as a big box, they just don''t draw the whole thing.


Mike

"The state is that great fiction by which everyone tries to live at the expense of everyone else." - Frederick Bastiat, The Law

Share this post


Link to post
Share on other sites