World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 11-15-2007, 08:08 PM   #1
asantiago
WWJ aficionado
 
Join Date: Aug 2007
Posts: 136
asantiago is on a distinguished road
Question Texture question

Hi all,

I'm working on a better version of remote loading in SurfaceImage and I have a question about texture loading.

In SurfaceImage the textures are loaded in the renderer thread with a sentence like:
<code>t = TextureIO.newTexture(iconStream, true, null);</code>

The data read process generates a pause in the rendering loop and I want to avoid it.

My question is: how does the loading data process work in TiledLayers so that it doesn't happens?

Thanks a lot.
__________________
|---------------------------------------
| http://www.acuriousanimal.com/
|---------------------------------------
| http://theballoonproject.blogspot.com
|---------------------------------------
| _ __
| /_| ( _ _/'_ _
|( |. __)(//)//(/(/()
| _/
|---------------------------------------
asantiago is offline   Reply With Quote
Old 11-15-2007, 11:28 PM   #2
fabrizio.giudici
Senior Member
 
Join Date: May 2007
Location: Milan, Genoa (Italy)
Posts: 112
fabrizio.giudici is on a distinguished road
Default

Same for me - BTW, I think I'm showing a deep ignorance about JOGL, but what are the multi-threading issues when dealing with Textures?
__________________
--
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941
fabrizio.giudici is offline   Reply With Quote
Old 11-16-2007, 03:11 PM   #3
asantiago
WWJ aficionado
 
Join Date: Aug 2007
Posts: 136
asantiago is on a distinguished road
Default

Hi, Fabrizzio

as JOGL doc says:
"OpenGL rendering semantics specify that only one context may be current on the current thread at any given time, and also that a given context may be current on only one thread at any given time."

In the modified version of SurfaceImage, the remote image is downloaded and putted in a buffer in a separate thread, but the texture must be created in the rendering thread. At this point when the sentence to create the new texture :

t = TextureIO.newTexture(this.stream, true, null);

the rendering thread needs to read the data from file, and produces a freeze "moment" in the animation of the globe.
__________________
|---------------------------------------
| http://www.acuriousanimal.com/
|---------------------------------------
| http://theballoonproject.blogspot.com
|---------------------------------------
| _ __
| /_| ( _ _/'_ _
|( |. __)(//)//(/(/()
| _/
|---------------------------------------
asantiago is offline   Reply With Quote
Old 11-16-2007, 04:50 PM   #4
asantiago
WWJ aficionado
 
Join Date: Aug 2007
Posts: 136
asantiago is on a distinguished road
Default

Ok I'm here again.

I continue working on SurfaceImage class. Now (in the initializeTexture method), when the texture must be loaded, I create a RequestTask and queue it in the 'WorldWind.getTaskService()'.

This RequestTask checks if the texture is local or remote. If local then load it (in this separate thread) and if not creates a task, that is queue in the 'WorldWind.getRetrievalService()', to download the image.

All work generates a TextureData object that finally is passes to the Texture object used by the SurfaceImage.

Now there are two problems:

1- There is my imagination or when is TextureData the freeze problem seems not a problem. It seems all is more smooth.

2- When load images (local or remotly) I get a white texture. This is strange because I amb rendering the BMNGOneImage object, that is based on SurfaceImage and it is ok.

Any ideas.
Thanks a lot.
__________________
|---------------------------------------
| http://www.acuriousanimal.com/
|---------------------------------------
| http://theballoonproject.blogspot.com
|---------------------------------------
| _ __
| /_| ( _ _/'_ _
|( |. __)(//)//(/(/()
| _/
|---------------------------------------

Last edited by asantiago; 11-16-2007 at 05:06 PM.
asantiago is offline   Reply With Quote
Old 11-17-2007, 12:51 PM   #5
asantiago
WWJ aficionado
 
Join Date: Aug 2007
Posts: 136
asantiago is on a distinguished road
Talking

Ok, problem solved. I don't know if it is a JOGL bug or a misunderstand of OpenGL.

I have changed the line:
SurfaceImage.this.textureData = TextureIO.newTextureData(iconStream, false, null);

by:
SurfaceImage.this.textureData = TextureIO.newTextureData(iconStream, true, null);

the only change is putting mipmap to true and all images loads ok. Really I don't understand because with the first form only some images are loaded right and some not.
__________________
|---------------------------------------
| http://www.acuriousanimal.com/
|---------------------------------------
| http://theballoonproject.blogspot.com
|---------------------------------------
| _ __
| /_| ( _ _/'_ _
|( |. __)(//)//(/(/()
| _/
|---------------------------------------
asantiago is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may 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
Interesting mathmatical question and polygon extrusion opacity Hactic Developers' Corner 3 09-20-2007 02:11 PM
Elevation Data as Texture? johnburkey@mac.com Development Help 6 07-05-2007 07:15 PM
Texture Missing... toolshed Development Help 13 06-28-2007 03:38 AM
Question about WW internal to stream and display images sensij Developers' Corner 4 05-22-2006 06:59 PM
Wrap GIS vector on texture image fuchen Developers' Corner 1 05-10-2005 06:49 PM


All times are GMT +1. The time now is 09:10 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.