2 registered members (AndrewAMD, Ayumi),
903
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
skyspheres, z-buffer and clipping
#319696
04/16/10 21:21
04/16/10 21:21
|
Joined: Apr 2010
Posts: 38
deianthropus
OP
Newbie
|
OP
Newbie
Joined: Apr 2010
Posts: 38
|
I've searched pretty thouroughly (I think) and found much discussion but little resolution on this topic; and I wonder if maybe it has been solved since those threads were posted several years back:
how can I set up my sky sphere so that it does not appear to intersect level geometry or LOD terrain? Can I tell the engine to render objects that are actually beyond the skysphere model as between the skysphere and the camera, through some trick of the z-buffer? Or would I be better of scaling my skysphere model so that its radius is the clipping distance, and using fog as a cheap cover up? (I'd much prefer the prior, if it is possible)
Last edited by deianthropus; 04/16/10 21:21.
|
|
|
Re: skyspheres, z-buffer and clipping
[Re: wdlmaster]
#320456
04/21/10 20:16
04/21/10 20:16
|
Joined: Apr 2010
Posts: 38
deianthropus
OP
Newbie
|
OP
Newbie
Joined: Apr 2010
Posts: 38
|
Thanks, this seems like a brilliant idea, but I must not be executing it right. I still get geometry overlap.
ENTITY* sky0;
VIEW* sky_view = { layer = -9000; flags = VISIBLE; x = 0; y= 0; z= -20000; }
function update_sky() { sky0.x = sky_view.x; sky0.y = sky_view.y; sky0.z = sky_view.z; sky_view.pan = camera.pan; sky_view.tilt = camera.tilt; sky_view.roll = camera.roll; } function init_sky() { sky0 = ent_create("skygrad2.mdl",vector(sky_view.x,sky_view.y,sky_view.z),set(my,PASSABLE)); }
.... init_sky runs 1 time, update_sky is on a constant check. I feel I must still be missing something critical. Do I need to activate the view?
Last edited by deianthropus; 04/21/10 21:00.
|
|
|
Re: skyspheres, z-buffer and clipping
[Re: deianthropus]
#320791
04/24/10 17:37
04/24/10 17:37
|
Joined: Apr 2010
Posts: 38
deianthropus
OP
Newbie
|
OP
Newbie
Joined: Apr 2010
Posts: 38
|
Update: This works beautifully, especially if I put a "distant" terrain model in a layer between the camera and the sky (great illusion of scale for big, big mountains).
However (totally new issue, but i'll keep it in this thread because I'm dealing with the same outcome, if a bit expanded), I want to be able to set the file references per level, so that one level may have a different sky/distant terrain/etc from another. I suppose I could set it in the level script, but that hasn't worked for me (can a level script execute a main() function? if not, how do I work around this?)
Alternatively, I could use an external text file. This way, i could have all of my level variables set, as well as read an array of .hmp files for a LOD terrain system (load terrain in the camera view, with array entries corresponding to a 'geographic' location in order to load terrain and objects dynamically based on the location of the camera. [LOD similar to, say, Oblivion]). Thoughts? Experiences? Which is more practical?
|
|
|
|