FMS
09-07-2005, 06:58 PM
Hi,
I am writing this shader and I don't seem to follow why "SUBR" is not providing me the correct results. I checked the contents of the variables and they seems to be fine. Apparently when I try to do the subtraction between "Coordinates" and "Position", the "COLOR" results in some junk values.
Here is the source code:
#################################################
"!!ARBfp1.0\n"
"OPTION NV_fragment_program2;\n"
"ATTRIB ParticleIndex = fragment.texcoord[2];\n"
"OUTPUT COLOR = result.color;\n"
"PARAM Root = {0.0, 0.0};\n"
"PARAM Width = program.env[0]; # width is 4\n"
"TEMP MassAddress;\n"
"TEMP Position;\n"
"TEMP Coordinates;\n"
"TEMP GridIndex;\n"
"TEMP Index;\n"
"TEMP fraction;\n"
"TEMP temp;\n"
"TEX Coordinates, ParticleIndex, texture[2], RECT;\n"
"TEX MassAddress, Root, texture[0], RECT;\n"
"MOVR Index.x, MassAddress.z;\n"
"CAL DECODEINDEX;\n"
"TEX MassAddress, GridIndex, texture[0], RECT;\n"
"TEX Position, GridIndex, texture[1], RECT;\n"
"SUBR COLOR, Coordinates, Position;\n"
"RET;\n"
"DECODEINDEX:\n"
"DIVR GridIndex.y, Index.x, Width.x;\n"
"FRCR fraction.x, GridIndex.y;\n"
"MULR GridIndex.x, fraction.x, Width.x;\n"
"RET;\n"
"END\n";
#################################################
Please help.
Platform : x86(AMD) , Linux RedHat 9.0
Graphics Hardware : GeForce 6600 GT
Thanks.
- FMS
I am writing this shader and I don't seem to follow why "SUBR" is not providing me the correct results. I checked the contents of the variables and they seems to be fine. Apparently when I try to do the subtraction between "Coordinates" and "Position", the "COLOR" results in some junk values.
Here is the source code:
#################################################
"!!ARBfp1.0\n"
"OPTION NV_fragment_program2;\n"
"ATTRIB ParticleIndex = fragment.texcoord[2];\n"
"OUTPUT COLOR = result.color;\n"
"PARAM Root = {0.0, 0.0};\n"
"PARAM Width = program.env[0]; # width is 4\n"
"TEMP MassAddress;\n"
"TEMP Position;\n"
"TEMP Coordinates;\n"
"TEMP GridIndex;\n"
"TEMP Index;\n"
"TEMP fraction;\n"
"TEMP temp;\n"
"TEX Coordinates, ParticleIndex, texture[2], RECT;\n"
"TEX MassAddress, Root, texture[0], RECT;\n"
"MOVR Index.x, MassAddress.z;\n"
"CAL DECODEINDEX;\n"
"TEX MassAddress, GridIndex, texture[0], RECT;\n"
"TEX Position, GridIndex, texture[1], RECT;\n"
"SUBR COLOR, Coordinates, Position;\n"
"RET;\n"
"DECODEINDEX:\n"
"DIVR GridIndex.y, Index.x, Width.x;\n"
"FRCR fraction.x, GridIndex.y;\n"
"MULR GridIndex.x, fraction.x, Width.x;\n"
"RET;\n"
"END\n";
#################################################
Please help.
Platform : x86(AMD) , Linux RedHat 9.0
Graphics Hardware : GeForce 6600 GT
Thanks.
- FMS