- May 29, 2013 at 1:12 pm #31290
I am trying to create top level non-mip-mapped texture. I am using PVRTexLib version 4.5.
In order to achieve this, i am setting u32MIPMapCount as 0 while creating CPVRTextureHeader object.
256, // u32Height,
256, // u32Width,
0, //mipmap count
When i try to access data pointer of this texture using below code, i get null pointer.
void *p = sCompressedTexture.getDataPtr(0,0,0);
std::cout < < "p is nulln";
Data pointer of texture is perfectly fine if i set u32MIPMapCount as 1 while creating CPVRTextureHeader object. But this will create top level plus one extra mipmap level.
Please confirm how can i get the correct data pointer for top level non-mip-mapped texture (u32MIPMapCount = 0).May 29, 2013 at 1:44 pm #37334
The top level of a texture is included in the “number of mip maps”, so you actually want to set it to 1, rather than 0. 1 actually does just mean the top level, and no additional mip maps.
TobiasMay 30, 2013 at 4:51 am #37335
As per “PVRTexTool.User Manual.pdf” (section 5.4.1) – ‘u32MIPMapCount’ is the number of MIP-map sublevels present in addition to the top level: 0 means that only a top level non-MIP-mapped texture exists, 1 means the top level plus an extra MIP-map level, etc.
Am i missing something?June 3, 2013 at 5:34 am #37336
I am blocked due to this issue. Can some body please answer my query?June 3, 2013 at 10:29 am #37337
Have you tried setting the value of “u32MIPMapCount” to 1 as Tobias suggested? Tobias is the lead engineer for TexTool, so I suspect the documentation may have an error in it.
JoeJune 10, 2013 at 5:23 pm #37338
Sorry I was ill last week so didn’t get around to answering this – there is in fact a bug in the documentation as Joe suggested, not entirely sure how it got there but I’ll see that it gets fixed. What I said in my post is correct, the document is wrong.