You could manually insure that your image is sized in powers of two and rewrite the texture loader code to not resize your image as you load it.
- John Wright Starfire Research "ZACZEK, MARIUSZ P. (JSC-DM) (NASA)" wrote: > > I find that if the texture image is smaller it will load faster....reduce > your image and it should > be faster...not sure how else to improve load time...although others may > know. > > Mario > > Mariusz Zaczek > NASA - Johnson Space Center > Automated Vehicles and Orbit Analysis / DM35 > Flight Design and Dynamics Division > Mission Operations Directorate > Bldg: 30A Room: 3048B > > Disclaimer: "The opinions, observations and comments expressed in my email > are strictly my own and do not necessarily reflect those > of NASA." > > -----Original Message----- > From: Zak Nixon [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 02, 2002 3:59 PM > To: [EMAIL PROTECTED] > Subject: [JAVA3D] Texture loading > > BlankI have a globe with a texture wrapped around it. While the creation of > the globe, it takes a long time > to load the texture. Is there anyway to speed up the loading of a texture. I > am currently have the code at the bottom of this message.. > > Thanks for your help. > > - Zak > > Code below: > -------------------------------------- > public void buildObject() { > JFrame frame = new JFrame(); > > BaseAppearance sphereAppearance = new BaseAppearance(); > > TextureAttributes textureAttributes = new TextureAttributes(); > Material sphereMaterial = new > Material(SceneColors.white,SceneColors.grey,SceneColors.white,SceneColors.wh > ite,20.0f); > TextureLoader loadedTexture = new TextureLoader(this.textureFilePath,new > String("RGB"),frame); > Texture sphereTexture = loadedTexture.getTexture(); > > sphereAppearance.setCapability(BaseAppearance.ALLOW_TEXTURE_WRITE); > sphereMaterial.setLightingEnable(true); > sphereAppearance.setMaterial(sphereMaterial); > sphereAppearance.setTexture(sphereTexture); > textureAttributes.setTextureMode(TextureAttributes.MODULATE); > sphereAppearance.setTextureAttributes(textureAttributes); > > Sphere globe = > new Sphere( > this.radiusOfBody, > Sphere.GENERATE_NORMALS > | Sphere.GENERATE_TEXTURE_COORDS > | Sphere.ENABLE_APPEARANCE_MODIFY > | Sphere.ENABLE_GEOMETRY_PICKING, > 80, > sphereAppearance); > > globe.setCapability(GeometryArray.ALLOW_TEXCOORD_READ); > globe.setCapability(GeometryArray.ALLOW_TEXCOORD_WRITE); > > globe.setAppearance(sphereAppearance); > > this.addChild(globe); > } > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
