For regular draw calls, uniform4fv is within the top 5 GL functions taking the most execution time. Setting uniforms for shaders is often a considerable amount of the time spent by an engine. The sampler used in shaders is sampler3D instead of sampler2D. Also, the internal format and type combinations are not 100% matched. For example, since we have one more dimension, we will have depth, zoffset, and TEXTURE_WRAP_T for 3D textures. There are certain elements that do not match exactly. The code for setting up a 3D texture usually has a 2D texture counterpart. We have fast access speed and native tri-linear interpolation. WebGL 2 support for 3D textures is as good as that for 2D textures. 3D textures can also improve performance by using them to cache light for real-time global illumination. In addition, 3D textures can be used to store medical data such as MRI and CT scans, and are useful when implementing cross-sectioning. Now we can bring these features into our WebGL engine. The first thing that comes to mind with 3D textures is volumetric effects, such as fire, smoke, light rays, realistic fog, etc. After drawing to the multisampled renderbuffers gl.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |