hmm need some help
Moderator: InsideQC Admins
23 posts
• Page 1 of 2 • 1, 2
hmm need some help
im at a loss atm probably stared myself blind on the code so if anyone could check it id be happy if you discover the bug.
its the latest version of realm i did a major cleanup codewise but somewhere along the line it broke (alias models dont show in some places / angles) only the viewmodel is affected which is weird cause reverting the code doesnt fix it.
i also suspected my way of culling to be the culprit but even if i turn off culling its still the same :S
i do have a hunch that its related to the modelview matrix allthough the only change i made was renaming it but so far nothing seems to affect it.
here it is.
ftp://90.184.233.166:21/Realm_2010_4_02.7z
its the latest version of realm i did a major cleanup codewise but somewhere along the line it broke (alias models dont show in some places / angles) only the viewmodel is affected which is weird cause reverting the code doesnt fix it.
i also suspected my way of culling to be the culprit but even if i turn off culling its still the same :S
i do have a hunch that its related to the modelview matrix allthough the only change i made was renaming it but so far nothing seems to affect it.
here it is.
ftp://90.184.233.166:21/Realm_2010_4_02.7z
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
It would be helpful to also post a copy of the last version of the source code that didn't have this problem ...
This way any changes made are known and can be examined.
It would also greatly reduce the amount of work by a 3rd party to get a handle on the possible scope of the problem and therefore require far less time.
This way any changes made are known and can be examined.
It would also greatly reduce the amount of work by a 3rd party to get a handle on the possible scope of the problem and therefore require far less time.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
since its based on a newer finished project from mh (only one so far with bumpmapping) it might contain bugs i newer discovered.
you might wonder a bit when comparing it to standard quake
its VERY detailed.
oups btw before you go huh when compiling it it uses the intel compiler so need to get the trial version else things will explode
and the universe will cease to exist
you might wonder a bit when comparing it to standard quake
its VERY detailed.
oups btw before you go huh when compiling it it uses the intel compiler so need to get the trial version else things will explode
and the universe will cease to exist
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Both links worked OK to me.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Still isn't working for me. Using FireFox, same version for years.
This is a different computer and at a different location.
Same with IE

The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Of course it is now working
(Is your computer going to "sleep" or something maybe? Doesn't matter now since the downloads are going ...)
(Is your computer going to "sleep" or something maybe? Doesn't matter now since the downloads are going ...)
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
think it was just timeout works now
and now to the real bummer i found the bug sigh.
mh's shadow function uses a matrix table after cleaning up the code i changed the call to a pointer which to my surprise doesnt work
i reverted it back to the old and now it works funny thing i had no idea this would affect the viewmodel
// go back to the world matrix (cant use a pointer here or our viewmodel gets fucked)
glLoadMatrixf (cl_entities[0].MViewMatrix);
and now to the real bummer i found the bug sigh.
mh's shadow function uses a matrix table after cleaning up the code i changed the call to a pointer which to my surprise doesnt work
i reverted it back to the old and now it works funny thing i had no idea this would affect the viewmodel
// go back to the world matrix (cant use a pointer here or our viewmodel gets fucked)
glLoadMatrixf (cl_entities[0].MViewMatrix);
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
maybe usefull to others i cooked up some depth sorting stuff based on mh's D3D code.
call R_SortBrushEntities before R_RecursiveWorldNode in R_DrawWorld
and the same for alias models
call it before R_DrawAliasEntities in R_RenderScene.
this might add a bit of an overhead and im pondering if i could get away with just using one function to handle both ? the reason being that the codebase im working on doesnt call the brushmodel functions from DrawAliasEntities.
- Code: Select all
/*
=============
R_DepthSortEntities
=============
*/
int R_DepthSortBrushEntities (const void *a, const void *b)
{
static int offset;
entity_t *enta = *((entity_t **) a);
entity_t *entb = *((entity_t **) b);
// sort back to front
if (enta->distance > entb->distance)
{
offset = 1;
}
else if (enta->distance < entb->distance)
{
offset = -1;
}
else
{
offset = 0;
}
return offset;
}
/*
=============
R_SortBrushEntities
=============
*/
void R_SortBrushEntities (void)
{
int i;
// if there's only one then the list is already sorted!
if (cl_numvisedicts > 1)
{
// evaluate distances
for (i = 0; i < cl_numvisedicts; i++)
{
entity_t *ent = cl_visedicts[i];
// set distance from viewer - no need to sqrt them as the order will be the same
ent->distance = (ent->origin[0] - r_origin[0]) * (ent->origin[0] - r_origin[0]) +
(ent->origin[1] - r_origin[1]) * (ent->origin[1] - r_origin[1]) +
(ent->origin[2] - r_origin[2]) * (ent->origin[2] - r_origin[2]);
}
if (cl_numvisedicts == 2)
{
// trivial case - 2 entities
if (cl_visedicts[0]->distance < cl_visedicts[1]->distance)
{
entity_t *tmpent = cl_visedicts[1];
// reorder correctly
cl_visedicts[1] = cl_visedicts[0];
cl_visedicts[0] = tmpent;
}
}
else
{
// general case - depth sort the transedicts from back to front
qsort ((void *) cl_visedicts, cl_numvisedicts, sizeof (entity_t *), R_DepthSortBrushEntities);
}
}
}
call R_SortBrushEntities before R_RecursiveWorldNode in R_DrawWorld
and the same for alias models
- Code: Select all
/*
=============
R_DepthSortEntities
sort entities by depth.
=============
*/
int R_DepthSortAliasEntities (const void *a, const void *b)
{
static int offset;
entity_t *enta = *((entity_t **) a);
entity_t *entb = *((entity_t **) b);
// sort back to front
if (enta->distance > entb->distance)
{
offset = 1;
}
else if (enta->distance < entb->distance)
{
offset = -1;
}
else
{
offset = 0;
}
return offset;
}
/*
=============
R_SortAliasEntities
=============
*/
void R_SortAliasEntities (void)
{
int i;
// if there's only one then the list is already sorted!
if (cl_numvisedicts > 1)
{
// evaluate distances
for (i = 0; i < cl_numvisedicts; i++)
{
entity_t *ent = cl_visedicts[i];
// set distance from viewer - no need to sqrt them as the order will be the same
ent->distance = (ent->origin[0] - r_origin[0]) * (ent->origin[0] - r_origin[0]) +
(ent->origin[1] - r_origin[1]) * (ent->origin[1] - r_origin[1]) +
(ent->origin[2] - r_origin[2]) * (ent->origin[2] - r_origin[2]);
}
if (cl_numvisedicts == 2)
{
// trivial case - 2 entities
if (cl_visedicts[0]->distance < cl_visedicts[1]->distance)
{
entity_t *tmpent = cl_visedicts[1];
// reorder correctly
cl_visedicts[1] = cl_visedicts[0];
cl_visedicts[0] = tmpent;
}
}
else
{
// general case - depth sort the transedicts from back to front
qsort ((void *) cl_visedicts, cl_numvisedicts, sizeof (entity_t *), R_DepthSortAliasEntities);
}
}
}
call it before R_DrawAliasEntities in R_RenderScene.
this might add a bit of an overhead and im pondering if i could get away with just using one function to handle both ? the reason being that the codebase im working on doesnt call the brushmodel functions from DrawAliasEntities.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
reckless wrote:and now to the real bummer i found the bug sigh.
Hehe, how can that be a bad thing
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
23 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest