返回介绍

手册

参考

示例

开发者参考

即时渲染对象(ImmediateRenderObject)

发布于 2021-07-10 14:14:16 字数 3669 浏览 1208 评论 0 收藏 0

This experimental class provides a fast code path for rendering meshes with frequently updated geometry data. When the renderer encounters an instance of ImmediateRenderObject, it only takes care about the most primitive rendering operations (e.g. binding vertex attributes, determining correct shader program or perfoming the actual draw call). Features like view frustum culling, wireframe rendering or using multiple materials are not supported. Besides ImmediateRenderObject can only be used to render triangles.

ImmediateRenderObject does not work with instances of BufferGeometry. The raw geometry data have to be maintained as properties of the ImmediateRenderObject.

Using ImmediateRenderObject makes only sense if you are updating your geometry data per frame. You can then benefit of a faster code path compared to the default mesh redering logic.

例子

Marching Cubes

构造函数(Constructor)

ImmediateRenderObject( material : Material )

material — The material of the ImmediateRenderObject.

Properties

See the base Object3D class for common properties.

.material : Boolean

The material of the ImmediateRenderObject. Assigning multiple materials is not supported.

.hasPositions : Boolean

Whether position data are defined or not. Default is false.

.hasNormals : Boolean

Whether normal data are defined or not. Default is false.

.hasColors : Boolean

Whether color data are defined or not. Default is false.

.hasUvs : Boolean

Whether texture coordinates are defined or not. Default is false.

.positionArray : Float32Array

The buffer holding position data. Default is null.

.normalArray : Float32Array

The buffer holding normal data. Default is null.

.colorArray : Float32Array

The buffer holding color data. Default is null.

.uvArray : Float32Array

The buffer holding texture coordinates. Default is null.

.count : Integer

The number of primitives to be rendered. Default is 0. This property will be set to 0 after each rendering so you usually set it in the implementatio of .render().

方法(Methods)

See the base Object3D class for common methods.

.render (renderCallback : Function) : null

renderCallback -- A function to render the generated geometry data.

This method needs to be implemented by the deriving class of ImmediateRenderObject. You normally want to implement the vertex buffer update logic and execute renderCallback at the end of your implementation.

源码(Source)

src/extras/objects/ImmediateRenderObject.js

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文