1

In JavaFx if transparency is applied to a shape, it doesn't gives proper transparency effect, until there is any other shape behind it. for example, this sphere has some transparency but it appears only bright (not transparent)

Sphere only appears bright not showing transparency

where as, if any other shape is there behind it it shows noticeable transparency.enter image description here

what is the proper way of manipulating transparency to get desired effect even if there is no shape behind it and what is the proper way of placing point and ambient light in order to illuminate the shape properly.

expected result vs javafx rendering

BitKnight
  • 149
  • 7
  • I'm not sure what you mean. A transparent sphere will blend with the background. What else do you expect? – Nico Schertler Jul 11 '18 at 19:59
  • Yes, you're right. That's what I am expecting, The way edges of sphere is blending with the red color, why its not blending with blue background..why it is so white, why it cant be transparent as shown in the new image attached. – BitKnight Jul 12 '18 at 09:09
  • What is your blend mode? Looks a bit like additive blending. Try multiplicative instead. – Nico Schertler Jul 12 '18 at 12:25
  • I am using JavaFx default 3d rendering and also i am very new to low level graphics/rendering, So not familiar with these terms. Could you please suggest or provide direction where to look and what we can do improve the rendering. – BitKnight Jul 17 '18 at 09:25
  • See [the documentation](https://docs.oracle.com/javafx/2/api/javafx/scene/effect/BlendMode.html) for an example. `SRC_OVER` might be more appropriate for your scenario. I am sorry that I can't be of more help. I know just the low-level stuff and not what JavaFX makes out of it. – Nico Schertler Jul 17 '18 at 10:30

0 Answers0