WEBVTT 00:00:00.390 --> 00:00:04.675 We've derived one system of transforming transparency that mostly works. To sum 00:00:04.675 --> 00:00:08.510 up all the opaque objects are rendered first, with Z buffering on, blending is 00:00:08.510 --> 00:00:12.674 then turned on for the transparent objects that follow. Blending takes extra 00:00:12.674 --> 00:00:17.132 time for the GPU to compute, so it's turned on only when needed. Finally, the 00:00:17.132 --> 00:00:20.670 transparents objects are sorted by their destins along the view, and are 00:00:20.670 --> 00:00:24.812 rendered in back to front order. If the camera or objects are moving, this 00:00:24.812 --> 00:00:29.102 sorting has to be done in every frame. This algorithm is in fact with three j s 00:00:29.102 --> 00:00:33.352 implements, you make an object transparent by setting its material. There are 00:00:33.352 --> 00:00:38.699 two parameters to set. The opacity is the f of value used for blending. You must 00:00:38.699 --> 00:00:43.200 also set the transparent parameter to be true. This transparency scheme usually 00:00:43.200 --> 00:00:47.352 works fairly well in practice but there are still quite a few problem cases. One 00:00:47.352 --> 00:00:53.145 problem is inter penetration. Here's the demo showing one transparent block 00:00:53.145 --> 00:00:57.664 moving through the other, give this demo a try. Move the camera around and use 00:00:57.664 --> 00:01:01.685 the slider to position the block. The dot on the center of each object is what 00:01:01.685 --> 00:01:06.260 is used to measure it's distance along the direction the camera is viewing. Once 00:01:06.260 --> 00:01:10.600 you're done with the demo, you'll then answer a question as to what's going 00:01:10.600 --> 00:01:11.073 wrong.