![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
WWJ aficionado
Join Date: Aug 2007
Posts: 136
![]() |
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 |--------------------------------------- | _ __ | /_| ( _ _/'_ _ |( |. __)(//)//(/(/() | _/ |--------------------------------------- |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: May 2007
Location: Milan, Genoa (Italy)
Posts: 112
![]() |
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 |
|
|
|
|
|
#3 |
|
WWJ aficionado
Join Date: Aug 2007
Posts: 136
![]() |
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 |--------------------------------------- | _ __ | /_| ( _ _/'_ _ |( |. __)(//)//(/(/() | _/ |--------------------------------------- |
|
|
|
|
|
#4 |
|
WWJ aficionado
Join Date: Aug 2007
Posts: 136
![]() |
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. |
|
|
|
|
|
#5 |
|
WWJ aficionado
Join Date: Aug 2007
Posts: 136
![]() |
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 |--------------------------------------- | _ __ | /_| ( _ _/'_ _ |( |. __)(//)//(/(/() | _/ |--------------------------------------- |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |