[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Thread Index]
[Monthly Archives] [List Home]

RE: [Virtools] Performance drop when textures come into view for the first time



Texture compression decrease amount of data to transfer, so 3d runs
faster.. BUT you have to compress textures before putting them into
video memory, so the init (compression) takes some time.

Concerning textures, what i suggest is that you should always work with
pow2 textures using non-compressed DISK file format, so that you can
easily predict the amount of memory that will be used in your app, just
by looking at the size of your texture directory. For instance, .jpeg is
small on your disk, but in the video memory it takes as much size as
.bmp .. (Be carefull of the difference between VIDEO compression (DXT)
and DISK compression (jpeg))

As far as i know, i don't really think the video memory is cleaned
between 2 resets, so i don't understand why you have delays after one
reset. Maybe you have more textures than video memory, so that anyway it
can't all fit in ? Have a look at the Virtools profiler once you have
ALL your scene visible : the amount of texture is showed (and be
carefull you have to take front/back/z-buffers into consideration in
your memory calculation)

To loop through all your textures, create a group of all the textures
and then do something like that :
	CKGroup *textureGroup;
	textureGroup = (CKGroup *)beh->GetInputParameterObject( 0 );

	// loop the group
	for( int noObj = 0; noObj < textureGroup->GetObjectCount();
noObj++ )
	{
		CKTexture *currentTexture = (CKTexture
*)textureGroup->GetObject( noObj );
		currentTexture->SystemToVideoMemory(
behcontext.CurrentRenderContext, FALSE);
	}
Arnaud

> -----Original Message-----
> From: owner-virtools-user-group@lists.theswapmeet.com 
> [mailto:owner-virtools-user-group@lists.theswapmeet.com] On 
> Behalf Of Patrick Hogenboom
> Sent: mardi 15 janvier 2002 13:39
> To: 'Virtools-User-Group'
> Subject: RE: [Virtools] Performance drop when textures come 
> into view for the first time
> 
> 
> Hi Arnoud,
> thanks very for pointing out the SystemToVideoMemory call :)
> 
> About texture compression, are you sure it causes delay ?
> I just put texture compression on my biggest maps and have 
> noticed a speed increase. Ok, I also resized the textures to 
> a power of 2 (maybe that outweighed the compression 
> performance hit) This made a real impact as virtools upscaled 
> them to the nearest power of 2, causing the memory footprint 
> to soar ! Maybe there should be a preferences setting to 
> scale non-pow-2 textures up or down.
> 
> Is there any way of preventing the need for re-uploading the 
> textures after a reset ?
> 
> Just one little question :
> How do I set up a loop that iterates through all textures ?
> 
> Thanks, Patrick
> 
> 15-Jan-02 11:10:57, "Arnaud Muthelet" <arnaud@simteam.com> wrote:
> 
> >Hi patrick,
> >
> >The delay is due to system to video bitmap data transfer. 
> The more the 
> >data, the longer the delay. Delay grows even longer while 
> using texture 
> >dynamic compression (DXT). To fix that, you should loop on all the 
> >textures of your scene using the function 
> >CKTexture::SystemToVideoMemory(), at the beginning of your scene. It 
> >will take a few moment, but no more delay after (given the fact that 
> >ALL textures loaded fit in your video memory of course ) Arnaud.
> >
> >> Hi all,
> >> first of all, let me wish you a fun and productive 2002 :D ! 
> >> May it bring what you wish / dream for.
> >> 
> >> I'm having performance trouble when textures come into view
> >> for the first time after I reset / load a world. What I mean 
> >> is this : _I load a cmo file _rotate the camera _the 
> >> performance drops when ever I encounter new objects/textures
> >>   the bigger the texture, the bigger the performance drop. 
> >> _after I have completed the full 360 degrees, there is no 
> >> more performance drops
> >>   Unfortunately, when I reset the scene, the problem comes back !
> >> 
> >> I think that the performance drop is some kind of AGP
> >> swapping / texture uploading to video ram. But that it comes 
> >> back when I reset the scene, just doesn't make sense.....
> >> 
> >> On fast machines the performance just dips, but on low-spec
> >> machines, the whole application freezes quite some time... 
> >> I've seen this under Dev, the standalone player and the webplayer.
> >> 
> >> My questions are these :
> >> _Does anybody have more knowledge or an explanation of this
> >> phenomenon ? _Why does it recur when I reset the world ? _Can 
> >> I pre-upload all textures to video ram ?
> >>   That way the caching time gets added to the loading time 
> >> and it doesn't interfere with the user's experience. _Can I 
> >> prevent the clearing of the cache, so that resetting doesn't 
> >> recur the problem ?
> >> 
> >> Thanks in advance, Patrick
> >> 
> >> ...............................................................
> >> Distributed via the virtools-user-group list:
> >> http://www.theswapmeet.com/numl.html
> >> To reply to the list 
> >> instead of its author, use "Reply to All" To unsubscribe: 
> >> send "unsubscribe virtools-user-group" to 
> >> Majordomo@lists.theswapmeet.com To subscribe: send "subscribe 
> >> virtools-user-group" to Majordomo@lists.theswapmeet.com To 
> >> post a message: send it to 
> virtools-user-group@lists.theswapmeet.com
> >> ...............................................................
> >> 
> >
> >...............................................................
> >Distributed via the virtools-user-group list: 
> >http://www.theswapmeet.com/numl.html
> >To reply to the list instead of its author, use "Reply to All"
> >To unsubscribe: send "unsubscribe virtools-user-group" to 
> Majordomo@lists.theswapmeet.com
> >To subscribe: send "subscribe virtools-user-group" to 
> Majordomo@lists.theswapmeet.com
> >To post a message: send it to 
> virtools-user-group@lists.theswapmeet.com
> >...............................................................
> >
> >
> 
> 
> 
> ...............................................................
> Distributed via the virtools-user-group list: 
> http://www.theswapmeet.com/numl.html
> To reply to the list 
> instead of its author, use "Reply to All" To unsubscribe: 
> send "unsubscribe virtools-user-group" to 
> Majordomo@lists.theswapmeet.com To subscribe: send "subscribe 
> virtools-user-group" to Majordomo@lists.theswapmeet.com To 
> post a message: send it to virtools-user-group@lists.theswapmeet.com
> ...............................................................
> 

...............................................................
Distributed via the virtools-user-group list: http://www.theswapmeet.com/numl.html
To reply to the list instead of its author, use "Reply to All"
To unsubscribe: send "unsubscribe virtools-user-group" to Majordomo@lists.theswapmeet.com
To subscribe: send "subscribe virtools-user-group" to Majordomo@lists.theswapmeet.com
To post a message: send it to virtools-user-group@lists.theswapmeet.com
...............................................................


Follow-Ups: References: