- IndiceTools::toIJ(s, w, &pixelI, &pixelJ); // update (pixelI, pixelJ)
+ const float2 pixel = IndiceTools::toPixelFloat(s, w);
+
+ // Les données de la sphère sélectionnée.
+ float selectedSphereDistance = FLT_MAX;
+ float brightness = 0;
+ float hue = 0;
+
+ // Sélectionne la sphère la plus proche, il peut ne pas y avoir de sphère trouvée.
+ for (int i = 0; i < NB_SPHERES; ++i)
+ {
+#if CURRENT_MEMORY_MODEL == MEMORY_MODEL_GLOBAL
+ const Sphere& sphere = ptrDevSpheres[i];
+#elif CURRENT_MEMORY_MODEL == MEMORY_MODEL_CONSTANT
+ const Sphere& sphere = CONST_SPHERES[i];
+#elif CURRENT_MEMORY_MODEL == MEMORY_MODEL_SHARED
+ const Sphere& sphere = tabSpheresSM[i];
+#endif
+
+ const float hSquare = sphere.hSquare(pixel);
+
+ if (sphere.isBelow(hSquare))
+ {
+ const float dz = sphere.dz(hSquare);
+ const float sphereDistance = sphere.distance(dz);