YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Transparency and threejs - Interactive 3D Graphics

Get Embed Code
2 Languages

Showing Revision 2 created 05/24/2016 by Udacity Robot.

  1. We've derived one system of transforming transparency that mostly works. To sum
  2. up all the opaque objects are rendered first, with Z buffering on, blending is
  3. then turned on for the transparent objects that follow. Blending takes extra
  4. time for the GPU to compute, so it's turned on only when needed. Finally, the
  5. transparents objects are sorted by their destins along the view, and are
  6. rendered in back to front order. If the camera or objects are moving, this
  7. sorting has to be done in every frame. This algorithm is in fact with three j s
  8. implements, you make an object transparent by setting its material. There are
  9. two parameters to set. The opacity is the f of value used for blending. You must
  10. also set the transparent parameter to be true. This transparency scheme usually
  11. works fairly well in practice but there are still quite a few problem cases. One
  12. problem is inter penetration. Here's the demo showing one transparent block
  13. moving through the other, give this demo a try. Move the camera around and use
  14. the slider to position the block. The dot on the center of each object is what
  15. is used to measure it's distance along the direction the camera is viewing. Once
  16. you're done with the demo, you'll then answer a question as to what's going
  17. wrong.