Page 1 of 1

Reflectivity in 3do-s

Posted: 26 Oct 2010, 09:51
by Beherith
There are no separate glow and reflectivity textures for tatex, so how is this calculated? I found some related engine code, but if anyone knows and can explain it to me, I would be very grateful!

Re: Reflectivity in 3do-s

Posted: 26 Oct 2010, 19:17
by jK
It uses the alpha channel of those tga's (the teamcolor is done via a special colorcode).

Re: Reflectivity in 3do-s

Posted: 26 Oct 2010, 21:28
by Beherith
Thanks! Hasnt occured to me to look in alpha.
Does teamcolor have to do with the following:

Code: Select all

typedef struct tagPrimitive
{
    long ColorIndex;
    long NumberOfVertexIndexes;
    long Always_0;
    long OffsetToVertexIndexArray;
    long OffsetToTextureName;
    long Unknown_1;
    long Unknown_2;
    long Unknown_3;    
} Primitive;

/* 
ColorIndex:
This is the index of a color in the TA color palette. For the color
palette, check out at the very end of this file for more detail, it
would take too much space to display here.
Ta palette : 

Here is a struct containing the whole palette,
it's in C++, you can just drop it in your code
if that's what you're using, eles convert it
to you language using those values. PALETTEENTRY
is a windows.h object btw. You can access it like this : 

(char)TAPalette[i].peRed;
(char)TAPalette[i].peGreen;
(char)TAPalette[i].peBlue;
(char)TAPalette[i].peFlags;

Here is the struct : 

		PALETTEENTRY TAPalette[256] = {
		{0x00, 0x00, 0x00, 0x00},
		{0x80, 0x00, 0x00, 0x00},
		{0x00, 0x80, 0x00, 0x00},
		{0x80, 0x80, 0x00, 0x00},
		{0x00, 0x00, 0x80, 0x00},
		{0x80, 0x00, 0x80, 0x00},
		{0x00, 0x80, 0x80, 0x00},
		{0x80, 0x80, 0x80, 0x00},...


Re: Reflectivity in 3do-s

Posted: 27 Oct 2010, 13:09
by rattle
I believe that the alpha channel is used for either reflectivity or team color if the image file is mentioned in teamtex.txt

http://springrts.com/wiki/Units:Textures

Re: Reflectivity in 3do-s

Posted: 27 Oct 2010, 13:19
by Beherith
Thanks very much!
Igor, bring the plans....

Re: Reflectivity in 3do-s

Posted: 27 Oct 2010, 15:12
by jK
rattle wrote:I believe that the alpha channel is used for either reflectivity or team color if the image file is mentioned in teamtex.txt

http://springrts.com/wiki/Units:Textures
The wiki is incorrect.
I made a lot teamcolored 3do textures which also had reflections! The teamcolor is calculated by a purple color code, means if green-channel is equal 0 and the red channel is equal to the blue channel then it is a teamcolored texel.

PS: the wiki says correctly how the teamcolor code works, but it also says that teamcolored textures can't contain reflections, what is incorrect.

Re: Reflectivity in 3do-s

Posted: 27 Oct 2010, 15:18
by smoth
fun fact: I halped convert all the old ota textures to purple.

Re: Reflectivity in 3do-s

Posted: 27 Oct 2010, 18:43
by CarRepairer
jK wrote:purple color code
:?

Re: Reflectivity in 3do-s

Posted: 27 Oct 2010, 18:49
by Beherith
Thanks guys! Anyone got a more or less complete tatex replacement?

Re: Reflectivity in 3do-s

Posted: 27 Oct 2010, 19:29
by Master-Athmos
Get CA and look at the tatex folder...

Re: Reflectivity in 3do-s

Posted: 28 Oct 2010, 11:29
by Beherith
Thanks, so all the texes in tatex_gpl are 3rd party (non ota) stuff?