16 bit textures

  • Thread starter Thread starter fuchisasquatch
  • Start date Start date
Status
Not open for further replies.
And what about white colour ?
31 * 8 = 248 = F8.
So with this type of conversion you can't get pure white ? But I saw FF FF FF pixels in bmp that Texture Beast created :).
Your program creates good files too.

Cyb: Texture Beast is a program to convert some formats to others, made by Alhexx. You can find it on his site.
 
well it depends ... if you want to make it to FF then multiply it by (255 / 31 ) = 8,2258 and then round it.
But maybe 248 is right value and it should be that way.
 
Nuh 248 is a greyish color. To see your self go into paint and put 248 in each R,G,B box. So it would surely screw up the colors of some images.
 
hmm i was think of something like

(originalcolorval + 1) * 8

that would work for white..but yeah maybe itd screw up the other colors
 
oh no woops it would work

eg.

(31 + 1) * 8 = 256

and max color range for BMP is 255..so yeah
 
Yeah it would be. I was thinking bout this for ages and trying all this crap. Weird its confusing. I also searched around and couldnt find anything. But id suggest saving as 24bit BMP anyway since you dont require a palette. But the conversion between ARGB1555 to RGB888 still needs to be worked on.
 
Mirex, can't you post source code from Biturn that handles conversion of 16 bit TEX files to BMP ?
 
Do what I said and make a lookup table like this:

00000 00000000
00001 00001000
00010 00010000
...
...
11110 11110111
11111 11111111

Basically multiply the first number by 8.23 to make a table.
 
hmm i was thinking and i though would this work

use delphi's round function or similar to do something like

newcolval = Round(colorval * (255 / 31))

i dunno if thats sure to work..but give it a try..

EDIT: oh woops thats kinda similar to what sfx1999 said..but i guess that the above way is more accurate even though the rounding off would give the same or very similar answer..
 
It works :o.
Thanks fuchisquatch :).

Code: [Select]
Code:
procedure TForm1.Button1Click(Sender: TObject);var rgb: word;r,g,b: byte;fs: tfilestream;begin  rgb := $6339;  r := (rgb and $7C00) shr 10;  g := (rgb and $3E0) shr 5;  b := (rgb and $1F);  r := Round(r * (255 / 31));  g := Round(g * (255 / 31));  b := Round(b * (255 / 31));  fs := tfilestream.Create('test', fmCreate);  fs.Write(b, sizeof(b));  fs.Write(g, sizeof(g));  fs.Write(r, sizeof(r));end;

*runs Delphi*
Now I can implement this to my prog :).
 
Oh cool  :D

Man im downloading delphi right now.

I use VB and i can do almost whatever i want and can do with it..but it just pisses me off sometimes..

It doesnt support signed/unsigned longs..and dont even think about quads and floats.. (I needed signed longs in the texture reading program for the 32bit data)

And also the support files you need to distribute with your applications or have a VB run time pack that really annoys me..so yeah im making a switch.

Its good that delphi looks really simple and maybe just as easy as VB. Hmm i would use C/C++ and even learnt everything there is to know about console programming, but when i went into Win32 applications or tried MFC it was just so friggen complicated and at that time i didnt really see a need for C/C++ anyway.
 
I downloaded an addon for Delphi called Castalia 2 yesterday. It's great because it helps you write code while you're writing it, and not as default - when you compile it. For example:

brackets2.gif


Normally you don't see these colour lines, but they help.

Link: Castalia 2.5

Btw: I didn't even bother what means signed and unsigned, but I see this is some important stuff... Can someone explain this to me ?
 
Oh right.

Well signed numbers range from a negative value to a positive value where unsigned numbers range from 0 to a higher postive value.

Normally you wouldnt really need to use unsigned numbers unless your involving some advanced calculation and you would use signed numbers for reading data that has no chance of being negative (e.g. file sizes, image widths, ect.)

Unsigned and signed numbers have the same number of bytes so for example:

Signed bytes range from the value -128 to 127
Unsinged bytes range from the value 0 to 255

So you see that if you add 128 to 127 you get 255..and as you can see by that they have the same range ammount.

EDIT: Can i ask what version of delphi your running. Im trying to download "Borland Delphi v7 Studio Enterprise" is that any good..?
 
Now I get it, thanks ;).

I'm using Delphi v7 Personal Enterprise, about 160 Megs, works well :).
 
Oh alright then yeah i guess what im downloading is not bad then. Its 135 MB..and i hope its the real thing cause you cant really trust KaZaA.
 
I did it! :D

But, here's another problem: Now I want to do whole proccess backwards, so I can convert BMP to TEX. I have 3 color values: r,g and b. How can I make 2 byte 15 bit color from them ? :P
 
Status
Not open for further replies.
Back
Top