Inside3D!
     

hmm need some help
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Thu Feb 04, 2010 7:12 am    Post subject: hmm need some help Reply with quote

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
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 7:50 am    Post subject: Reply with quote

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.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Thu Feb 04, 2010 9:09 am    Post subject: Reply with quote

ofc Smile

ftp://90.184.233.166/Realm_2009_2_17.zip
Back to top
View user's profile Send private message
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Thu Feb 04, 2010 9:16 am    Post subject: Reply with quote

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 Smile

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 Laughing
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 10:54 am    Post subject: Reply with quote

I get "failed to download" for both URLs.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Thu Feb 04, 2010 6:30 pm    Post subject: Reply with quote

hmm strange works fine here ? its from my own ftp.

i see in log that it finished succesfully can you open the zip files ?
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Thu Feb 04, 2010 6:57 pm    Post subject: Reply with quote

Both links worked OK to me.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Thu Feb 04, 2010 7:01 pm    Post subject: Reply with quote

ok thanks Smile

hmm not sure why you get this then.
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 11:09 pm    Post subject: Reply with quote



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


_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Fri Feb 05, 2010 7:25 am    Post subject: Reply with quote

disabled timeout lets see if that helps ?

else only option i have is putting them on a filehosting site.
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Fri Feb 05, 2010 8:25 am    Post subject: Reply with quote

Of course it is now working

(Is your computer going to "sleep" or something maybe? Doesn't matter now since the downloads are going ...)
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Fri Feb 05, 2010 1:50 pm    Post subject: Reply with quote

maybe you can try cygwin "wget"
theres also a version of wget for windows, but the cygwin one is probably better
Back to top
View user's profile Send private message
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Fri Feb 05, 2010 3:16 pm    Post subject: Reply with quote

think it was just timeout works now Wink

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 Embarassed

i reverted it back to the old and now it works funny thing i had no idea this would affect the viewmodel Laughing

// go back to the world matrix (cant use a pointer here or our viewmodel gets fucked)
glLoadMatrixf (cl_entities[0].MViewMatrix);
Back to top
View user's profile Send private message
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Fri Feb 05, 2010 4:57 pm    Post subject: Reply with quote

maybe usefull to others i cooked up some depth sorting stuff based on mh's D3D code.

Code:
/*
=============
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:
/*
=============
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.
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Fri Feb 05, 2010 9:03 pm    Post subject: Reply with quote

reckless wrote:
and now to the real bummer i found the bug sigh.


Hehe, how can that be a bad thing Very Happy
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group