Foreground with transparent color over background

Graphic based area of development (Graphics Processing Unit), including the Geometry Transform Engine (GTE), TIM, STR (MDEC), etc.
Post Reply
ORART
What is PSXDEV?
What is PSXDEV?
Posts: 4
Joined: Jan 17, 2023

Foreground with transparent color over background

Post by ORART » September 18th, 2023, 4:43 pm

I'm trying to make a scrolling scene which has two images. One contains blocks, coins and the ground (foreground, I suppose); and the other one contains the background ( clouds, trees ).

I have understood that the TRUE black color ( RGB 0,0,0) represents the transparency and I got this in the part of the foreground that there won't be nothing.

The problem is that the black color is still there and I can't see the background. I've just downloaded the TimTool program in order to try to make the black "transparent", but it persists.

Any solutions? Or I must have just one background in my game? My images are in PNG.
You do not have the required permissions to view the files attached to this post.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 574
Joined: Nov 12, 2012
Contact:

Post by nocash » September 19th, 2023, 6:12 am

If you can't figure out what is wrong, then yes, you must use only one background.
Some things that look wrong...
Your png doesn't seem to contain transparent pixels, any half-decent png-to-tim converter would thus convert the solid black png pixels into solid near-black tim pixels. But anyways, you must really use a hex editor and look what you have in the tim file. The pixels (or palette entries) are 16 bit RGBA, not RGB as you seem to think. (Or sorts of RGBA, the alpha flag in bit15 has meaning A=1=SemiTransparent, which unrelated to the the solid and fully-transparenct pixels that you are looking for, so make sure that you have A=0 in all pixel colors).
It wouldn't be wrong if you could provide some basic info, what rendering commands and rendering attributes you were using, and what kind of textures with how many bpp.

ORART
What is PSXDEV?
What is PSXDEV?
Posts: 4
Joined: Jan 17, 2023

Post by ORART » September 20th, 2023, 5:43 am

I'm using this command: img2tim -bpp 8 -tcol 0 0 0 -plt 0 0 -org 0 0 level1a.png -o level1a.tim
and got this in several cases:
You do not have the required permissions to view the files attached to this post.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 574
Joined: Nov 12, 2012
Contact:

Post by nocash » September 20th, 2023, 10:24 am

Your main problem is communicating with other people and general problem solving, work on improving that skills! Nobody could help you if you post numerous png files instead of posting your actual tim file, and all that without allowing people to see your source code.

But, in this post, viewtopic.php?f=51&t=4053&p=22258#p22258 you appear to have drawn a "foregrounf sprite" with transparent pixels, drawing a bigger "foreground layer" with transparent pixels is just the same.
If you think about it, I hope that you will realize that you are currently acting exceptionally stupid about trying to solve a problem that you had already solved some months ago. Good luck, and please reconsider if you could have solved such problems on your own.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 574
Joined: Nov 12, 2012
Contact:

Post by nocash » September 21st, 2023, 2:48 pm

PS. From what I remember about what you had posted in the other thread, you did display the backgrond by uploading it from cpu (or cdrom?) to vram, such transfers are usually intended for initializing texture memory, you could also use them to initialize the framebuffer background in each frame (though that's rather unusual, and you should do such things only if you really know what you are doing, and have a good reason for doing it that way).

If you are using the same upload function for drawing the foreground layer, that won't work, it will simply overwrite the background. For foreground images you must always use rendering commands (like sprite/rect) to transfer foreground tiles from texture memory to framebuffer.

There is a size limit for rectangles, so if you want to display something like 320x224 bitmaps then you must split them into smaller snippets (although that huge bitmap idea is also something that you aren't doing right, most or all real games are using a background map with background tiles, and then display those background tiles one oafter another instead of displaying a single huge bitmap).

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests