Author Topic: how does jpct draw many transparency objects ?  (Read 732 times)

Offline carl

  • byte
  • *
  • Posts: 3
    • View Profile
how does jpct draw many transparency objects ?
« on: November 20, 2012, 02:22:42 am »
 I make a Clock with 3DMax  composed of some other child Objects ,something like minute hand, second hand and so on , and I need an animation that let the Clock disappear gradually by decrease of its transparency.

then if I rotate the Clock while it is  in the process of disappearance , the total rotation degree is no more than 90. the  Clock will be blinking. sometimes minute hand is in front of second hand ,and sometimes second hand is in front of minute hand.  Why is it blinking ,  does the zbuffer still  work with transparency objects ?  or the zBuffer precision is not enough?

how does JPCT draw with many Objects some of which are transparency and some are not ? does we need to  sort these objects with  z coordinate ?

Thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: how does jpct draw many transparency objects ?
« Reply #1 on: November 20, 2012, 07:20:08 am »
They are sorted by their average depth and drawn in that order (painter's algorithm). The z-Buffer is used to read from, but not to write into because it doesn't work well with the alpha channel (i.e. it has no idea if it should actually write the depth or not based on alpha).
If your hands are always in front of the clock, you can use setSortOffset with some negative value to force them to be rendered in front.