luaplayer.org
September 08, 2010, 03:29:06 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: IMPORTANT: Please read the following post http://luaplayer.org/forums/index.php?topic=693
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Rendering an image under 10x10  (Read 398 times)
danran
Sr. Member
****
Posts: 353


View Profile Email
« on: February 28, 2010, 02:31:40 PM »

It didn't work, it rendered just a black box at the size i used (8x8), when i uped the width/height to 10x10 the image rendered fine. (I used they exact same image as i used before, all i did was add it into a 10x10 frame & pasted the previous image into that frame then it worked fine.)
Also, interestingly setting the swizzle to false, half of the 8x8 image (the top half) renders fine but the bottom half remains black. I also loading the image into both VRAM & RAM but with the same results.
Logged
Criptych
Global Moderator
Hero Member
*****
Posts: 692


Why, oh why, didn't I take the blue pill?


View Profile WWW
« Reply #1 on: March 01, 2010, 03:29:42 PM »

Hmm... did 9x9 give you the same problem?  And what kind of image was it - RGB or palette?
Logged

I used to be a schizophrenic - but we're okay now.
FFN Browser | Nanotank! PSP | Google Maps PSP
danran
Sr. Member
****
Posts: 353


View Profile Email
« Reply #2 on: March 01, 2010, 11:52:09 PM »

Hummh did try 9x9, the thing was that i had two versions of the same image, the first 10x10 which i was using before 32bit, but wanted to convert to the other image, 8x8 also 32bit.
I'll upload the images later Wink
p.s - honestly, i don't have a clue if there rgb or palette. There most likely RGB, usually when i have an image all i care about & Bit depth, format & size. Note that obviously both images are very small in terms of size.
Logged
Criptych
Global Moderator
Hero Member
*****
Posts: 692


Why, oh why, didn't I take the blue pill?


View Profile WWW
« Reply #3 on: March 02, 2010, 09:58:46 AM »

p.s - honestly, i don't have a clue if there rgb or palette. There most likely RGB, usually when i have an image all i care about & Bit depth, format & size. Note that obviously both images are very small in terms of size.
Yes, I was referring to the bit depth; sorry for the confusion.  Put simply, RGB/A images are loaded at 32 bits/pixel, and palette images at 8 bits.
A similar issue had me looking into the PGE source today; I found that it enforces a minimum width of 16 pixels internally, regardless of bit depth.  A quick fix here solved my problem, but I haven't checked yet to see if it works with yours.
Logged

I used to be a schizophrenic - but we're okay now.
FFN Browser | Nanotank! PSP | Google Maps PSP
danran
Sr. Member
****
Posts: 353


View Profile Email
« Reply #4 on: March 02, 2010, 10:52:21 AM »

Yes, i was actually wondering about this after looking at your own thread, about creating a 4 bit image was it?
So i had to give it a try anyway, the images:
http://img294.imageshack.us/gal.php?g=miniblock.png

I'd understand a minimum width of 1 or even 2 but 16, its a bit strange.

Edit: Indeed you are right,
taken from the source, pgeTexture.c:
Code
GeSHi (c):
texture->swizzled = 0;
texture->width = width;
texture->height = height;
texture->textureHeight = pgeTextureNextPow2(height);
texture->textureWidth = pgeTextureNextPow2(width);
 
if(texture->textureHeight < 8)
texture->textureHeight = 8;
 
if(texture->textureWidth < 16)
texture->textureWidth = 16;
 
texture->size = texture->textureWidth*pgeTextureNextMul8(texture->height)*(texture->bits>>3);
texture->data = pgeMalloc(texture->size);
 
Created by GeSHI 1.0.7.20
« Last Edit: March 02, 2010, 10:58:51 AM by danran » Logged
FaT3oYCG
Full Member
***
Posts: 139


I don't argue, I simply express my own opinion!

fatboycg@hotmail.co.uk fatboycg09
View Profile WWW Email
« Reply #5 on: March 02, 2010, 12:16:57 PM »

why don't you use a tile sheet then?
Logged

FaT3oYCG
danran
Sr. Member
****
Posts: 353


View Profile Email
« Reply #6 on: March 02, 2010, 12:26:45 PM »

why don't you use a tile sheet then?
Like i said, I'm making due with 10x10, the reason I'm not using a tile sheet in this particular occasion is because 4 of these are created when you smash a block, i update everything single one and each block moves differently. I could make one, with the same images placed for times in a individual frames but personally i feel there's no need.
Logged
Criptych
Global Moderator
Hero Member
*****
Posts: 692


Why, oh why, didn't I take the blue pill?


View Profile WWW
« Reply #7 on: March 02, 2010, 02:36:44 PM »

I'd understand a minimum width of 1 or even 2 but 16, its a bit strange.
Actually it makes sense for an 8-bit image.  Swizzling requires a minimum width of 16 bytes, so the minimum width in pixels is (16*8 =) 128 / bpp.
the reason I'm not using a tile sheet in this particular occasion is because 4 of these are created when you smash a block, i update everything single one and each block moves differently.
You can use "tile" sheets for your sprites, too; just draw a differently-sized segment of the texture at a location unrestricted by grid coordinates.  Take a look at pgeFont.c: it stores the font's characters, often of different widths, in one texture, and can print them at any location on the screen.

EDIT: I tried drawing both images in PGE 0.02, SVN PGE, and my modified version.  0.02 exhibited the problem as you described it, except that disabling swizzle seemed to have no effect.  Neither the SVN version nor my version exhibited this problem, so I assume whatever caused was fixed between 0.02 and 0.03 (which makes it hard to pin down Sad), but isn't related to the changes I made.
« Last Edit: March 02, 2010, 03:20:30 PM by Criptych » Logged

I used to be a schizophrenic - but we're okay now.
FFN Browser | Nanotank! PSP | Google Maps PSP
danran
Sr. Member
****
Posts: 353


View Profile Email
« Reply #8 on: March 02, 2010, 05:09:54 PM »

Its good to know that it's fixed atleast Wink
Logged
InsertWittyName
Administrator
Hero Member
*****
Posts: 646

41010391 GSDavide
View Profile Email
« Reply #9 on: March 06, 2010, 02:39:28 AM »

Yes, this was originally reported by romero126 and has been fixed for 0.03
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!