Skip to content

Commit

Permalink
fix: issus with orthoslice meshes on m1 mac sonoma
Browse files Browse the repository at this point in the history
some underlying platform issue with Apple Metal on M1 Mac Sonoma requires specular color to be specified for correct rendering of phong material meshes
see: https://forums.macrumors.com/threads/javafx-mesh-lighting-rendering-errors-macos-14-2-1.2415934/
  • Loading branch information
cmhulbert committed Jun 20, 2024
1 parent 3a95323 commit 59e6e81
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.janelia.saalfeldlab.paintera.viewer3d;

import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.CullFace;
import javafx.scene.shape.MeshView;
Expand All @@ -10,6 +11,7 @@
import net.imglib2.RealLocalizable;
import net.imglib2.RealPoint;
import net.imglib2.RealPositionable;
import org.janelia.saalfeldlab.paintera.meshes.Meshes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -56,6 +58,9 @@ public class OrthoSliceMeshFX {

public OrthoSliceMeshFX(final long[] dimensions, final Affine viewerTransformFX) {

material.setSpecularColor(Color.TRANSPARENT);
material.setSpecularPower(0.0);

final Point min = new Point(2), max = new Point(dimensions);

final List<RealPoint> vertexPoints = calculateVertexPoints(min, max);
Expand Down

0 comments on commit 59e6e81

Please sign in to comment.