General Category > Discussion - EVE

BT81x and VERTEX2F

(1/2) > >>

Rudolph:
I am a bit disapointed now that the BT81x still has the handbrakes VERTEX2F und VERTEX2II in place with no alternative.
The need to shift the coordindates into the bit-positions only wastes time.
Especially since by default pixel precision for VERTEX2F is 1/16 - and for whatever reason that is.

Looking thru the user-manual I recognize though that it is just not possible to add a VERTEX3F command.
VERTEX2F is 0x01nnnnnn and VERTEX2II is 0x10nnnnnn, neither a 0x00nnnnnn or a 0x11nnnnnn would work because that would make it indistinguishable from the other commands.
This might be the reason why this has not been touched.

However, there would be a way out.
There are 21 reserved bits in VERTEX_FORMAT.
Bit 3 could have been used to change the format of VERTEX2F:
Bit 0...13 = Y
Bit 16...29 = X

With 1 bit less in resolution as a trade-off the frac-value of 0 would be -8192 to 8191, same as 1 and so the maximum pixel precision would be 1/8 pixel.

Can we have this as a patch please for both the FT81x and the BT81x?

BRT Community:
Hello,

Thank you for your suggestion, it is an interesting approach and one which I will pass on to the development team.

Best Regards,
BRT Community

pauljiao:

--- Quote ---There are 21 reserved bits in VERTEX_FORMAT.
Bit 3 could have been used to change the format of VERTEX2F:
Bit 0...13 = Y
Bit 16...29 = X

With 1 bit less in resolution as a trade-off the frac-value of 0 would be -8192 to 8191, same as 1 and so the maximum pixel precision would be 1/8 pixel.

--- End quote ---

I think your idea shall be Bit 2 (starting from Bit 0) ,i.e. the THIRD bit, other than bit 3 is used in VERTEX_FORMAT.
But I do not know what benefit it may bring to you.

Rudolph:
Nope, bit 3 of VERTEX_FORMAT was correct.
Bit 0..2 are already in use for "frac", although only with a range from 0 to 4.
Bits 3 to 23 are marked as "RESERVED".

While new meaning could be assigned to frac values of 5/6/7, using one of the reserved bits should be more intuitive since the table for the frac values would look very similar to what it is now.

0  1 pixel     -8192 to 8191
1  1/2 pixel  -4096 to 4095
2  1/4 pixel  -2048 to 2047
3  1/8 pixel  -1024 to 1023

Kaetemi:
Your goal is to align the coordinates of the vertex instruction on the 16bit boundary, correct?

Something like this may give you some mileage:

--- Code: ---short x, y;
short xc = (1 << 14) | (x & 0x3FFF);
short yc = (y << 1) & 0x7FFF;
dl32(VERTEX_FORMAT(1));
dl16(yc);
dl16(xc);

--- End code ---

Shift one coordinate, and mask the stray bit of the other one.

A more ideal solution then, instead, could be to have a vertex format instruction that sets the precision of each coordinate individually.

Navigation

[0] Message Index

[#] Next page

Go to full version