Reloading Texture Solved

Hi

I’ve loaded in a texture from the image, and then i modified the texture; however when i only shows as modified when close and reopen. How do i get it to ‘flush’ or reload the image from the image file? I tried reloading it the way i original did but it doesn’t change it.

Thanks

ther should be something like setRefresh or setreload or similar

Image.setRefreshNeeded()

1 Like

Thanks for the help, though it still dosen’t seam to be refreshing it properly. I’m using it as a material for a terrain

It works for me. Can you provide a test case?

1 Like

basicly:

I created the textures:



Texturecolour = assetManager.loadTexture(“Mytexture.bmp”);



then applied to a texture which is then applied to my mesh MaterialColour.setTexture(“ColorMap”, Texturecolour);

Maybe we should get clarification on how you are updating it. Are you changing the file on disk or something?



…asset manager would have cached it in that case.

ah i’m loading it in as a BufferedImage which i can then get RGB values of to change. though i tried re-setting the texture as the image but it dosen’t flush it. though i know the image is being altered beacuse on reload its visable.

[snippet id=“14”]

Well i got it working, Thank you for the help. i think it was something odd to do with how it was refrencing the image. since if i for example load the image i want to go on the material into a image via the assetmanger load texture, then set my texture and material:



Image = assetManager.loadTexture(“myimage.gif”).getImage();

MyText = new Texture2D(Image);

Material.setTexture(“Alpha”, MyText);



and call those 3 when ever i exit the image, it works perfectly fine.

might not the be best way but it works for me.