Line 11... |
Line 11... |
#define Last_t r58
|
#define Last_t r58
|
#define PixelColor r59
|
#define PixelColor r59
|
#define PixelPosition r60
|
#define PixelPosition r60
|
#define InitialPosition r61
|
#define InitialPosition r61
|
#define Three r62
|
#define Three r62
|
#define CurrentOutputPixel r64
|
//#define CurrentOutputPixel r64
|
#define CurrentTextureColor r65
|
//#define CurrentTextureColor r65
|
#define V0 r68
|
#define V0 r68
|
#define V1 r69
|
#define V1 r69
|
#define V2 r60
|
#define V2 r60
|
#define TextureColor r61
|
//#define TextureColor r61
|
#define LastColumn r62
|
#define LastColumn r62
|
#define Pixel2DFinalPosition r63
|
#define Pixel2DFinalPosition r63
|
|
|
#macro C = DotProduct( A, B )
|
#macro C = DotProduct( A, B )
|
R47 = A * B;
|
R47 = A * B;
|
Line 54... |
Line 54... |
V0 = (0xfffb0000, 0xfffa0000,0x00000000 );
|
V0 = (0xfffb0000, 0xfffa0000,0x00000000 );
|
|
|
V2 = (0x00050000, 0x00040000,0x00000000 );
|
V2 = (0x00050000, 0x00040000,0x00000000 );
|
|
|
|
|
|
Pixel2DFinalPosition.x = 255;
|
|
Pixel2DFinalPosition.y = 255;
|
|
Pixel2DFinalPosition.z = 255;
|
|
|
//----------------------------------------------------------
|
//----------------------------------------------------------
|
function main()
|
function main()
|
{
|
{
|
vector Hit,AllDone;
|
vector Hit,AllDone;
|
|
vector CurrentOutputPixel = (0,1,2);
|
|
vector CurrentTextureColor = (0xa,0xb,0xc);
|
|
|
//Make sure GenerateRay is only called once
|
//Make sure GenerateRay is only called once
|
if ( PrimitiveCount == MaxPrimitives )
|
if ( PrimitiveCount == MaxPrimitives )
|
{
|
{
|
GenerateRay();
|
GenerateRay();
|
Hit = 0;
|
Hit = 0;
|
}
|
}
|
Hit = CalculateBaricentricIntersection();
|
Hit = CalculateBaricentricIntersection();
|
|
|
PrimitiveCount--;
|
PrimitiveCount--;
|
if ( PrimitiveCount != 0 )
|
if ( PrimitiveCount == 0 ) { exit; }
|
{
|
|
exit;
|
|
}
|
|
|
|
if (Hit != 0)
|
if (Hit != 0)
|
{
|
{
|
TextureCalculation();
|
TextureCalculation();
|
PrePixelShader();
|
PrePixelShader();
|
}
|
}
|
|
|
PixelShader();
|
PixelShader( CurrentOutputPixel, CurrentTextureColor );
|
GenerateNextPixel();
|
GenerateNextPixel();
|
return 1;
|
|
exit;
|
exit;
|
}
|
}
|
|
|
//----------------------------------------------------------
|
//----------------------------------------------------------
|
function GenerateRay()
|
function GenerateRay()
|
Line 119... |
Line 124... |
|
|
vector ExpectedResult = (0x000e8f71, 0xffffcccd, 0xffff999a);
|
vector ExpectedResult = (0x000e8f71, 0xffffcccd, 0xffff999a);
|
if ( t != ExpectedResult)
|
if ( t != ExpectedResult)
|
{
|
{
|
R66 = 0xdead;
|
R66 = 0xdead;
|
|
exit ;
|
} else {
|
} else {
|
R66 = 0xaced;
|
R66 = 0xaced;
|
}
|
}
|
|
|
if (t.yyy >= 0)
|
if (t.yyy >= 0)
|
Line 136... |
Line 142... |
}
|
}
|
|
|
return 1;
|
return 1;
|
}
|
}
|
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
function PixelShader()
|
function PixelShader( CurrentOutputPixel, CurrentTextureColor )
|
{
|
{
|
//This does nothing because IO is not yet implemented
|
//CurrentOutputPixel = CurrentTextureColor; // What the hell?????
|
//I = { `OMWRITE ,`OREG_PIXEL_COLOR ,`CREG_CURRENT_OUTPUT_PIXEL ,`CREG_TEXTURE_COLOR };
|
out[ CurrentOutputPixel ] = CurrentTextureColor.xyz;
|
return ;
|
return ;
|
}
|
}
|
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
function GenerateNextPixel()
|
function GenerateNextPixel( CurrentOutputPixel, CurrentTextureColor )
|
{
|
{
|
PrimitiveCount = MaxPrimitives;
|
PrimitiveCount = MaxPrimitives;
|
TextureColor = 0;
|
CurrentTextureColor = 0;
|
CurrentOutputPixel += 3;
|
CurrentOutputPixel += 3;
|
|
|
|
|
if (Pixel2DPosition.xxx >= LastColumn.xxx )
|
if (Pixel2DPosition.xxx >= LastColumn.xxx )
|
{
|
{
|