About Store Forum Documentation Contact



Post Reply 
Weird textures
Author Message
cmontiel Offline
Member

Post: #1
Weird textures
I am getting weird pvrtc4 textures on Mac only. Those same textures are well displayed on ios.

Not sure if it's my fault by the last merge. I didn't test today's update.

https://dl.dropboxusercontent.com/u/1733...c4text.png
(This post was last modified: 10-10-2014 10:42 AM by cmontiel.)
10-10-2014 10:36 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Weird textures
Can you attach the source image, and describe what exactly is the problem?
10-10-2014 10:43 AM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #3
RE: Weird textures
Sent you a pm with source image. You can see the problem comparing with the link above.
I will make a full merge with latest code, maybe i did something wrong.
(This post was last modified: 10-10-2014 11:01 AM by cmontiel.)
10-10-2014 11:00 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: Weird textures
Hi,

I've made a quick test (on Win for now)
Code:
/******************************************************************************/
ImagePtr logo;
/******************************************************************************/
void InitPre()
{
   EE_INIT();
   App.flag|=APP_FULL_TOGGLE;
}
bool Init()
{
   SupportPVRTC();
   logo=UID(2291143500, 1166413659, 2975352728, 2461956582);
   Image temp;
   logo->copyTry(temp, -1, -1, -1, IMAGE_PVRTC4, IMAGE_2D, 1);
   temp.save("d:/0.gfx");
   logo="d:/0.gfx";
   return true;
}
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   if(Kb.bp(KB_ESC))return false;
   Gui.update();
   return true;
}
void Draw()
{
   D.clear(WHITE);
   if(logo)logo->drawFs();
   Gui.draw();
   D.text(0, 0, S+Time.frame());
}
/******************************************************************************/
load the image, save it as PVRTC4, then reload that, and display on screen, and it works ok.
If you still have the issue after full complete rebuild of the engine+editor, please provide steps to reproduce the problem.

Thank you very much
10-10-2014 11:20 AM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #5
RE: Weird textures
The .gfx is well formed, the issue is only on MAC displaying it.

Could you try to draw it on Mac? It will take me a day or 2, to merge all again.
(This post was last modified: 10-10-2014 11:46 AM by cmontiel.)
10-10-2014 11:25 AM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #6
RE: Weird textures
Ok I found where. Image.load(file) and ImageAtlas.load(file) are not working properly on Mac. Tested with last source code, "file" is a EE::File (not Str).

Looks like save(file) and copyTry methods have issues too.
(This post was last modified: 10-11-2014 02:58 AM by cmontiel.)
10-11-2014 12:52 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
RE: Weird textures
Thank you,
I was able to reproduce the issue on Mac, I'll investigate this now.
10-11-2014 10:21 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #8
RE: Weird textures
Thank you for reporting the issue, I've found and fixed the problem.
10-11-2014 12:56 PM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #9
RE: Weird textures
Image.load(file) ok.
ImageAtlas.load(file) still fails.
(This post was last modified: 10-11-2014 02:18 PM by cmontiel.)
10-11-2014 02:17 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #10
RE: Weird textures
Hello,
ImageAtlas is based on Image so I think it should work.
Could you try re-creating the ImageAtlas file using the "Create" button in the Editor, or do this manually if you're using your own solution.
If that won't help, please provide a sample project to reproduce the problem, thank you.
10-12-2014 01:49 AM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #11
RE: Weird textures
I can't provide a sample project but here is what i do

Code:
File f;
ImageAtlas atlas;

f.read(pathName);
atlas.load(f);

It says that is a PVRTC4 but has "holes" and some images are clipped.

https://dl.dropboxusercontent.com/u/1733...byfile.png


If i load this way
Code:
atlas.load(pathName);

It says that is a DXT5.

https://dl.dropboxusercontent.com/u/1733...byname.png

I sent you this atlas by pm.
10-12-2014 10:42 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #12
RE: Weird textures
Hello,

If you do
Code:
f.read(pathName);
atlas.load(f);
or
Code:
atlas.load(pathName);
This doesn't matter, because if you go to ImageAtlas.load source from Str name, you will see that it uses File.

I've tested both methods and they gave me the same results.

You wrote to me in PM
Quote:It was created manually using .pixel(intx,inty,pixel); and copyTry function.
Perhaps that's the problem?
Are you not using provided ImageAtlas.create?
If you're creating Images manually you need to clear them at start using Image.clear.
10-12-2014 11:04 AM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #13
RE: Weird textures
Fixed image.clear() did the trick.

Now i am curious why was working before the update wihout clear pfft.

Thanks for support and quick answers.
10-12-2014 11:20 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #14
RE: Weird textures
I recommend not using custom tools/methods for the things that the Engine and Editor already provide working solutions.

Why it may have worked before is that when you're not calling clear, then unitialized memory state is always undefined, so it could have been zero before.
10-12-2014 11:25 AM
Find all posts by this user Quote this message in a reply
Post Reply