raw filename... and alpha

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

raw filename... and alpha

Post by LuMo »

i looked through the sample with some textures and i found following code:

Code: Select all

extern unsigned char logo_start[];
in the cube sample it loads the logo.raw
but NOWHERE in the code is the filename specified...
not even the makefile says somethign about it...
logo.o: logo.raw
bin2o -i logo.raw logo.o logo
so how do i specify the filename/object that i build?

further, when i save my texture including alpha channel
the texture does not appear transparent.... why?


thanks in advance
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
User avatar
Stellar
Posts: 48
Joined: Mon Dec 12, 2005 9:13 am

Post by Stellar »

Well write this one in the books, I can help.. a little :X

Im not sure why the samples do it this way. What they've done, is converted ( using the program bin2o ) the image ( logo.raw ) speicified in the makefile, into a linkable object file. So the image ( i believe ) is statically built into the executable.

I dont see how the variable logo_start is referenced anywhere else? Its not in the makefile, or anywhere else in the program.

So, Ill be looking into loading raw files by hand, where you can do a fopen, parse and close. Im tring to get far enough in development so I can post a bunch a samples to encourage others to get into developing for psp.

I found an example last night of how to parse bmp and jpg files. Altho, im sure this is not optimal, the raw images do not have headers and are probably as small as images can get file size unless they are compressed.

not sure about the alpha? I havent got this far, but im sure there are texture states you must set to activate transparancy.
Last edited by Stellar on Thu Jan 12, 2006 11:32 pm, edited 1 time in total.
Image
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

The textures in the samples are linked directly into the executable, not loaded. This is to keep the actual code down to a minimum.
GE Dominator
User avatar
Stellar
Posts: 48
Joined: Mon Dec 12, 2005 9:13 am

Post by Stellar »

At the expense of a larger executable and always having it in ram. The only images I might do this way, are images that would always be used in a game, like a menu background mabey.

Psp development is very different. If you were to write a small demo, all the textures would have to be loaded to ram anyway. A game however changes them depending on the current map/level.
Image
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

well actually i do not care if i have to link images into my PBP or load em (at least at my current status)
but i would like to know how i can define where i can load it (i can build the objects as i can use the sample makefile and mod it...)

@alpha, the interesting part is i can save RGB with Alpha to raw in photoshop;
when i load it again, its CYMK without alpha?!
EDIT: if i open this file again and add another alpha layer... the image is fucked up so.. bad luck

is there a way to load up PNG images as textures, would be nice due they do have alpha channel and 32bit :))

greets
lumo, who is still testing...
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
nicoli_s
Posts: 12
Joined: Mon Jan 02, 2006 7:23 am
Contact:

Post by nicoli_s »

the logo_start is defined in the logo.o file and search the forums, theres info about loading up pngs, and as for alpha ive yet to attempt it but i will in the next day or so so ill post my findigns here
User avatar
Stellar
Posts: 48
Joined: Mon Dec 12, 2005 9:13 am

Post by Stellar »

Im not positive this is related to your problem, but i ran across it and thoght you may want to take a look at it

http://graphics.tudelft.nl/~wouter/publ ... alpha.html

I skimmed it and it seemed to mention similar things as you said about alpha.
logo_start is defined in the logo.o
so im guessing that the conversion program (bin2o) just tacks on a "_start" to the name "logo" and thats your variable name.
Image
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

nicoli_s wrote:the logo_start is defined in the logo.o file and search the forums, theres info about loading up pngs, and as for alpha ive yet to attempt it but i will in the next day or so so ill post my findigns here
i already write down png-screenshots, and able to load pngs, but not sure if its accepted as texture...



@Stellar
append _start ... good to know!
i know how to handle photoshop and the importing image problem is no real problem as i always keep my psd file :) but thanks for the link
greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

alpha blending/transparency

Post by dbeyer3069 »

I'll save you a lot of time and trouble on alpha channel/blending...

http://forums.ps2dev.org/viewtopic.php? ... d7781fedce

The default way the graphics.c library (from Lua) sets up the states with initGrapics() works for alpha blending. It's in the svn repository (google it or go to svn.pspdev.org).

David Beyer
nicoli_s
Posts: 12
Joined: Mon Jan 02, 2006 7:23 am
Contact:

Post by nicoli_s »

well in what format do you load the pngs? the .o file is just a big array of chars that represent the .raw file
Post Reply