Recent Posts

Pages: [1] 2 3 ... 10
1
Support / Re: Issue with Texture.overrideTexelData
« Last post by MichaelJPCT on January 19, 2021, 08:28:20 pm »
i use overrideTexelData at low frequency so it's not a problem for me.
but with FrameBuffer.getPixel i have to convert color format, and at high frequency (to output thousands of jpg files).
so i wish getPixel outputs the correct color format directly.
i mean in jpct-ae .
2
Support / Re: Issue with Texture.overrideTexelData
« Last post by Jakes on January 19, 2021, 01:26:28 pm »
It was way better. Iterating millions of times had its cost
3
Support / Re: Issue with Texture.overrideTexelData
« Last post by EgonOlsen on January 19, 2021, 01:20:35 pm »
This might be possible by implementing your own ColorModel and use that to create a BufferedImage. But I doubt that it's worth it...
4
Support / Re: Issue with Texture.overrideTexelData
« Last post by Jakes on January 19, 2021, 12:31:41 pm »
Yep, it worked, changing the channel order worked.

But, is there any way to set the image format to that order from the start, without having to iterate every pixel and rearrange it to the RGBA order? do you know any way besides using image type that could set the RGBA order correcly from the start?

regards
5
Support / Re: Issue with Texture.overrideTexelData
« Last post by EgonOlsen on January 19, 2021, 11:41:05 am »
As the docs say:

Quote
...the buffer with the texel data in RGBA-format.

Your issue is most likely, that the data from the DataBuffer isn't in that order. jPCT itself does a conversion from loaded BufferedImages into RGBA.

It does something similar to this to each texel:
Code: [Select]
int rgba = (texel & 0x0000ff00) | ((texel & 0x000000ff) << 16) | ((texel & 0x00ff0000) >> 16) | (texel>>24);
ATM, I fail to see how this converts from ARGB to RGBA, because something seems off with the handling of G here, but it works this way in the engine. It might not in your case, but the basic idea remains the same. Just the values might be different.

6
Support / Re: Issue with Texture.overrideTexelData
« Last post by Jakes on January 19, 2021, 11:39:55 am »
here is a clearer example:

Original image:


Resulting Image when using ARGB:


Resulting Image when using ABGR: Note that this one is the format the comes from ImageIO.read
7
Projects / Re: my project - Vehicle Simulation
« Last post by EgonOlsen on January 19, 2021, 11:21:32 am »
Looks cool. I like, how the landing gear behaves.
8
Support / Re: Issue with Texture.overrideTexelData
« Last post by Jakes on January 19, 2021, 11:09:03 am »
Yes, and it doesn't look like it, mainly because it's not only channel flipping but channel mixing,

i've tried this: img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);

and this is the result:



the weird part is that I'm not using alpha channel, the original resulting image doesn't have any kind of transparency
9
Support / Re: Issue with Texture.overrideTexelData
« Last post by EgonOlsen on January 19, 2021, 07:31:18 am »
Have you tried ARGB instead of ABGR?
10
Support / Re: Issue with Texture.overrideTexelData
« Last post by AGP on January 19, 2021, 03:41:29 am »
It does look horizontally flipped, but obviously there's more to it than that. Try ORing the prixel data with the appropriate value (255?) to make sure it's opaque.
Pages: [1] 2 3 ... 10