| View previous topic :: View next topic |
| Author |
Message |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Jan 12, 2006 10:48 pm Post subject: raw filename... and alpha |
|
|
i looked through the sample with some textures and i found following code:
| Code: | | 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...
| Quote: | 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 |
|
| Back to top |
|
 |
Stellar

Joined: 12 Dec 2005 Posts: 48
|
Posted: Thu Jan 12, 2006 11:29 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Thu Jan 12, 2006 11:30 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Stellar

Joined: 12 Dec 2005 Posts: 48
|
Posted: Thu Jan 12, 2006 11:36 pm Post subject: |
|
|
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. _________________
 |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Jan 12, 2006 11:39 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
nicoli_s
Joined: 02 Jan 2006 Posts: 12
|
Posted: Fri Jan 13, 2006 12:04 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
Stellar

Joined: 12 Dec 2005 Posts: 48
|
Posted: Fri Jan 13, 2006 12:06 am Post subject: |
|
|
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/publications/Pasman02c/psalpha.html
I skimmed it and it seemed to mention similar things as you said about alpha.
| Quote: |
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. _________________
 |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Fri Jan 13, 2006 12:14 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
dbeyer3069
Joined: 19 Dec 2005 Posts: 81
|
Posted: Fri Jan 13, 2006 4:59 am Post subject: alpha blending/transparency |
|
|
I'll save you a lot of time and trouble on alpha channel/blending...
http://forums.ps2dev.org/viewtopic.php?t=4423&sid=e73944df3d680f5184e361d7781fedce
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 |
|
| Back to top |
|
 |
nicoli_s
Joined: 02 Jan 2006 Posts: 12
|
Posted: Sun Jan 15, 2006 2:38 pm Post subject: |
|
|
| well in what format do you load the pngs? the .o file is just a big array of chars that represent the .raw file |
|
| Back to top |
|
 |
|