Hello guys!
i was messing with transparency a bit, and noticed something weird, take a look at this code:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn();
dbSyncRate ( 60 );
dbColorBackdrop ( dbRGB ( 255, 0, 0 ) );
dbMakeObjectPlain ( 2, 800, 800 );
dbPointObject ( 2, 0, 2, 0 );
dbPositionObject ( 1, 0, 30, 0 );
dbPositionCamera ( -100, 100, -100 );
dbPointCamera ( 0, 30, 0 );
dbAutoCamOff ( );
dbLoadObject ( "atmosphere.x", 10 );
dbLoadImage ( "atmosphere.tga", 1 );
dbTextureObject ( 10, 1 );
dbSetObjectTransparency ( 10, 1 );
::dbScaleObject ( 10, 30, 30, 30 );
dbSetAlphaMappingOn ( 10, 50 );
dbLoadObject ( "atmosphere.x", 11 );
dbScaleObject ( 11, 40, 40, 40 );
::dbSetAlphaMappingOn ( 11, 40 );
dbSetObjectTransparency ( 11, 1 );
while ( LoopGDK ( ) )
{
if ( dbKeyState ( 2 ) )
dbHideObject ( 10 );
else
dbShowObject ( 10 );
if ( dbKeyState ( 3 ) )
dbHideObject ( 11 );
else
dbShowObject ( 11 );
dbSync();
}
return;
}
here, i can see object 11 through object 10, and i can see the plain through object 11, but i cant see the plain through object 10.
also, if i replace second dbLoadObject with dbCloneObject ( 11, 10 ), i cant see object 11 through 10, but i can see the plain through 10 and 11, why is that? ( ye i know, its confusing xD )
these 2 exe's shows what im talking about :
http://filebeam.com/1f04a3f5aae4a99e932b2fceb03806d3( press 1 and/or 2 and see what happens )