#90 bad deep shadow generation when netrendering

open-accepted
nobody
None
5
2008-04-21
2008-04-17
Anonymous
No

When rendering deepshadows in network mode, if there's transparent object, the deepshadow file isn't valid and crash Pixie, this can be resolved by adding:

"fseek(tsmFile,curPos,SEEK_SET);" at the end of the function CRemoteTSMChannel::sendRemoteBucket(...).

----

int CRemoteTSMChannel::sendRemoteBucket(SOCKET s,int x,int y) {
// record current position, seek back to tile start
uint64_t curPos = ftell(tsmFile);
fseek(tsmFile,lastPosition,SEEK_SET);
uint64_t sz = curPos - lastPosition;
rcSend(s,&sz,sizeof(uint64_t));

// send the tile data
char buf[NETWORK_BUFFER_LENGTH];
while(sz > 0){
int nn = (int) ((sz>(NETWORK_BUFFER_LENGTH)) ? (NETWORK_BUFFER_LENGTH) : sz);
fread(buf,nn,1,tsmFile);
rcSend(s,buf,nn,FALSE);
sz -= nn;
}
uint64_t newPos = ftell(tsmFile);
if(newPos != curPos) {
fseek(tsmFile,(long) curPos,SEEK_SET);
error(CODE_BUG,"Error reading tsm file.\n");
}
lastPosition = (long) curPos;
fseek(tsmFile,curPos,SEEK_SET);
return TRUE;
}

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Cedric PAILLE.

     
  • Nobody/Anonymous

    Logged In: NO

    I understand that it's weird, because the current position is equal to the new position, but it really crash on windows if not set again, not tested on Unix.

    Cheers.

     
  • Okan Arikan

    Okan Arikan - 2008-04-21

    Logged In: YES
    user_id=555300
    Originator: NO

    I added this fix into the trunk. This is really weird.

    Cedric, again, I would appreciate you giving the SVN trunk a try to make sure the TSM rendering in networked mode words now.

    Thank you,

    Okan

     
  • Okan Arikan

    Okan Arikan - 2008-04-21
    • status: open --> open-accepted
     
  • Cedric PAILLE

    Cedric PAILLE - 2008-04-22

    Logged In: YES
    user_id=954786
    Originator: NO

    Okan,

    I gived a try to the SVN, and it works, but I always have issues with white spaces in pathes (see post in the forum "Crash on windows when net-rendering" (help section)) and the error handler at netSetup function (in the post too, it crashes on WIN32 & LINUX).

    Best regards.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks