strange bug ?
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
strange bug ?
ive been working a bit on the culling in realm wanted to make a uniform system but i ran into some problems.
mh might notice where i pulled in these from. the problem im facing is that it pushes the viewent outside of the frustum in some odd angles the gun dissapears at other angles particle effects go boom
and to top it off sometimes the ground dissapears
not sure what gives i took great care calling this function before any rendering was done any ideas ?
- Code: Select all
void R_VisCullEntities (void)
{
int i;
entity_t *ent;
if (!r_drawentities.value) return;
ent->occluded = false;
for (i = 0; i < cl_numvisedicts; i++)
{
// store current entity
ent = cl_visedicts[i];
// not an alias model (sprite checks are skipped)
if (ent->model->type != mod_alias) continue;
// get entity origin
VectorAdd (ent->origin, ent->model->mins, ent->mins);
VectorAdd (ent->origin, ent->model->maxs, ent->maxs);
// approximate the correct leaf for the entity in order to properly set fog and caustics.
// this isn't 100% accurate (no method ever could be unless we use water surfs as clipping
// planes) but it suffices pretty good for id1
ent->modelleaf = R_LeafForEntity (ent->mins, ent->maxs);
// adjust the bounding box if the model has been rotated
if (ent->angles[0] || ent->angles[1] || ent->angles[2])
{
// mark as occluded if the sphere is outside the frustum so that it wont have to be tested again
ent->occluded = R_CullSphere (ent->origin, ent->model->radius);
}
else
{
// mark as occluded if the box is outside the frustum so that it wont have to be tested again
ent->occluded = R_CullBox (ent->mins, ent->maxs);
}
}
}
mh might notice where i pulled in these from. the problem im facing is that it pushes the viewent outside of the frustum in some odd angles the gun dissapears at other angles particle effects go boom
and to top it off sometimes the ground dissapears
not sure what gives i took great care calling this function before any rendering was done any ideas ?
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
first of all,
is being called before ent is even initialized. Did you mean to put this line inside the loop?
- Code: Select all
ent->occluded = false;
is being called before ent is even initialized. Did you mean to put this line inside the loop?
- metlslime
- Posts: 316
- Joined: Tue Feb 05, 2008 11:03 pm
added as an afterthought originally didnt have that cause the boolean value of the bounding box check can only be true/false.
and yes it actually made it worse so i removed it again.
its still not right though
maybe i should let someone have a look at the entire thing its pretty hard to post all the changes i made considering the numerous changes mh made before my messing around.
i did add in the sphere culling from tochris (might be that) ill try to disable it. the weird thing is in its original form it actually worked but was a mess.
and yes it actually made it worse so i removed it again.
its still not right though
maybe i should let someone have a look at the entire thing its pretty hard to post all the changes i made considering the numerous changes mh made before my messing around.
i did add in the sphere culling from tochris (might be that) ill try to disable it. the weird thing is in its original form it actually worked but was a mess.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest