WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 06-24-2009, 12:37 AM
Joran Joran is offline
Member
 
Join Date: Jun 2006
Posts: 38
Send a message via Yahoo to Joran
Smile

Hello,

That is a good question. I am no expert in that area, and I just fiddled on until it worked.

After a bit of investigating the original code I found out how it worked. What I did was resizing the image in a separate thread. For this I needed a OpenGL context, because gluScaleImage is used by OpenSceneGraph. So in this thread I create a new OpenGL context for the gluScaleImage. So the texture is never uploaded to the graphic card for display in this process. I never really looked at what OpenSceneGraph did I my thread, but it worked.

I now also found out the problem. My image is normally not a power of two. So I would read it in, remember the original size and then rescale the image in another thread and display it using the original size to determine the size of the texturequad to display it on. An image with the power of two dimensions loads up fast enough, with (almost) no stuttering.

Using the the option resizeNPOS=False still gives a delay when uploading the texture to the graphic card. That is what my example program did and what confused me.

So this more or less solves my problem. Except that I now need to make something to automatically scale those images. It would be nice if the scaling could be done when loading the texture, because then the director solution would work. So something like viz.addTexture('test.png', instantScale=True).

Thanx for all the help. Sometimes it is just a matter of asking me the right questions.
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble loading vrml files generated by ProE tavaksai Vizard 12 12-09-2008 11:11 AM
How to edit the skin tones of the complete characters' cfg files? vEsotu Vizard 3 09-23-2008 12:07 PM
optimizing the loading of .wrl files dan12345 Vizard 2 06-10-2008 11:36 PM
loading large wav files in vizard tommahhh Vizard 1 05-16-2005 03:23 PM
Including Files that Include Other Files vjosh Vizard 1 09-21-2004 04:44 PM


All times are GMT -7. The time now is 10:36 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC