Code documentation & information ?

Code documentation & information ?

Portrait de Polar01

Hi,

I'm currently discovering the Embree code and have a few questions, because there is no documentation on some functions:

1) signmsk
2) xorf
3)  rcp

BTW, if I understand, in the file "triangle1v_intersector_pluecker".h there is the following code :

const float sgnDet = signmsk(det);
const float U = xorf(dot(cross(v2+v0,e0),D),sgnDet); 

Is it equivalent to : const float U = copysign(dot(cross(v2+v0,e0),D), det);

Thanks

http://spectralbattle.wordpress.com/
4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Sven Woop (Intel)

1) signmask takes a floating point number and and sets every bit to zero, except for the sign bit (topmost bit).

2) xorf simply calculates a bitwise xor of the bit representation of two floating point numbers

The mask returned by signmask can be used to efficiently flip the sign bit of another floating point number by using the xorf instruction.For instance xorf(signmask(-6),10) = -10. The intersection algorithm uses a sequence like this to flip some signs if the triangle is hit from the back.

3) rcp calculates the reciprocal of a floating point number, rcp(x) = 1/x

Portrait de Sven Woop (Intel)

The sequence does not copy the sign, but flip the sign of dot(cross(v2+v0,e0),D) if det < 0

Portrait de Polar01

Thanks,

Yes, I see... ingenious :-)

http://spectralbattle.wordpress.com/

Connectez-vous pour laisser un commentaire.