`
cuixuxucui
  • 浏览: 350871 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Flash Player 2种渲染模式(Retained模式,Immediate模式)

阅读更多

Retained模式
 高端模式,AS3是Retained Mode
 能够成为跨越Adobe产品功能的标准
 分离渲染本身和功能依赖要求,如GPU,Cell等
 能够分离处理的类型,如video,audio
 在渲染计算中以表面特征出现(Surfaces)
 BitmapData,Filters,cacheAsBitmap都是表面特征
 Bitmap本身会被独立保留
 解决了渲染模式中的不连续性
 体系庞大
 难于维护和保持兼容性
Immediate模式
 底层模式
 灵活
 易于维护及保持兼容
 缺点
 绑定了功能到底层语言与硬件驱动
 结论
 Pixel Bender使用Immediate模式
 GPU加速使用Immediate模式
 分离为表象的部分使用Immediate模式
 Bitmap和其他"lls填充为Retained模式
 AS3是Retained模式
 两者混合可以优化Binary下的Retained效率

 

参考资料:Retained and Immediate Modes
A graphics system operates in retained mode if it retains a copy of all the data describing a model. In other words, a retained mode graphics system requires you to completely specify a model by passing model data to the system using predefined data structures. The graphics system organizes the data internally, usually in a hierarchical database. Once an object is added to that database, you can change the object only by calling specific editing routines provided by the graphics system.

By contrast, a graphics system operates in immediate mode if the application itself maintains the data that describe a model. For example, original QuickDraw is a two-dimensional graphics system that operates in immediate mode. You draw objects on the screen, using QuickDraw, by calling routines that completely specify the objects to be drawn. QuickDraw does not maintain any information about a picture internally; it simply takes the data provided by the application and immediately draws the appropriate objects.

OpenGL is an example of a 3D graphics system that operates in immediate mode. QuickDraw GX is an example of a 2D graphics system that operates in retained mode.

QuickDraw 3D supports both immediate and retained modes of specifying and drawing models. The principal advantage of immediate mode imaging is that the model data is immediately available to you and is not duplicated by the graphics system. The data is stored in whatever form you like, and you can change that data at any time. The main disadvantage of immediate mode imaging is that you need to maintain the sometimes quite lengthy object data, and you need to perform geometric operations on that data yourself. In addition, it can be difficult to accelerate immediate mode rendering, because you generally need to specify the entire model to draw a single frame, whether or not the entire model has changed since the previous frame. This can involve passing large amounts of data to the graphics system.

Retained mode imaging typically supports higher levels of abstraction than immediate mode imaging and is more amenable to hardware acceleration and caching. In addition, the hierarchical arrangement of the model data allows the graphics system to perform very quick updates whenever the data is altered. To avoid duplicating data between your application and the graphics system's database, your application should match the data types of the graphics system and use the extensive editing functions to change a model's data.

Another important advantage of retained mode imaging is that it's very easy to read and write retained objects.

To create a point, for example, in retained mode, you fill in a data structure of type TQ3PointData and pass it to the Q3Point_New function. This function copies the data in that structure and returns an object of type TQ3GeometryObject , which you use for all subsequent operations on the point. For example, to draw the point in retained mode, you pass that geometric object returned by Q3Point_New to the Q3Geometry_Submit function inside a rendering loop. To change the data associated with the point, you call point-editing functions, such as Q3Point_GetPosition and Q3Point_SetPosition . Finally, when you have finished using the point, you must call Q3Object_Dispose to have QuickDraw 3D delete the point from its internal database.

It's much simpler to draw a point in immediate mode. You do not need to call any QuickDraw 3D routine to create a point in immediate mode; instead, you merely have to maintain the point data yourself, typically in a structure of type TQ3PointData . To draw a point in immediate mode, you call the Q3Point_Submit function, passing it a pointer to that structure. When you're using immediate mode, however, you need to know exactly what types of objects you're drawing and hard code the appropriate routines in your source code.

Immediate mode rendering does not require any memory permanently allocated to QuickDraw 3D, but it might require QuickDraw 3D to perform temporary allocations while rendering is occurring.

In general, if most of a model remains unchanged from frame to frame, you should use retained mode imaging to create and draw the model. If, however, many parts of the model do change from frame to frame, you should probably use immediate mode imaging, creating and rendering a model on a shape-by-shape basis. You can, of course, use a combination of retained and immediate mode imaging: you can create retained objects for the parts of a model that remain static and draw quickly changing objects in immediate mode.

分享到:
评论

相关推荐

    Direct3D 6.1 立即模式

    在Direct3D 6.1中,立即模式(Immediate Mode)是一种常用的渲染模式。与之相对的是保留模式(Retained Mode),立即模式更适合于实时渲染和游戏开发,因为它允许开发者直接控制每个渲染操作,无需保存场景状态。...

    d3drm.dll Direct3D Retained Mode DLL

    Direct3D是DirectX的一个关键组件,分为两种模式:Retained Mode和Immediate Mode。**Retained Mode** 模式主要是为了简化2D和3D图形的创建和管理,它允许开发者以对象的形式存储图形,便于修改和重复使用。与之相对...

    即时模式:Rust即时模式图形用户界面

    即时模式(Immediate Mode)是一种图形用户界面(GUI)的设计模式,与传统的保留模式(Retained Mode)相对。在即时模式中,程序直接控制屏幕的渲染,每次用户交互时都会重新绘制整个界面。这种方式允许开发者拥有更...

    imgui-1.88, C/C++立即模式完美ui, 开发人机界面必备

    ImGui的核心理念是“立即模式”(Immediate Mode GUI),与传统的“保留模式”(Retained Mode GUI)有所不同。在立即模式下,UI元素的状态在每次绘制时都会被重新计算,这样可以避免状态维护和更新的复杂性,使得代码更...

    HTML5 canvas高效调优

    混合渲染结合了即时模式 (Immediate Mode) 和保留模式 (Retained Mode) 的优点,可以根据实际场景选择最适合的渲染方式。这种方式能够在保持灵活性的同时,提高渲染效率。 - **即时模式**:适用于需要频繁更新的...

    ATM_Java_源代码(OOA、OOD设计模式)

    Note that the machine will simulate ejecting your card when you indicate you do not wish to perform any more transactions (unless, of course, your card is retained due to too many invalid PINs). ...

    百里香:Rust中的可热立即模式用户界面工具包

    百里香(Thyme)是一个基于Rust编程语言构建的用户界面(UI)工具包,其特点是支持热立即模式(Immediate Mode GUI)。在Rust的世界里,GUI开发往往需要面对性能、安全性和易于使用等多方面的挑战,而Thyme正是为...

    DirectX+3D图形与动画程序设计

    2. **Immediate Mode**:在这种模式下,程序员需要手动控制所有的渲染步骤,包括顶点数据的提交、纹理映射、光照计算等。虽然这种方式对程序员的要求较高,但是可以提供更高的性能和更大的灵活性。 #### DirectX...

    egui-0.17.0.zip

    它的主要特点在于其即时模式的界面构建方式,这与传统的保留模式(Retained Mode)GUI库有所不同。在即时模式下,GUI元素的状态和布局在每次渲染时都会被重新计算,这种方式使得代码更简洁,更易于理解和调试,同时...

    graphicLibrary123123_source_firmgkc_eatenmb8_ToBeTold_源码.zip

    5. **渲染技术**:图形库可能使用各种渲染技术,如 Immediate Mode、 retained mode 或基于向量的渲染。理解这些技术的优缺点可以帮助优化性能和用户体验。 6. **多平台支持**:为了实现跨平台兼容,图形库可能需要...

    UG数控编程加工平面铣PPT教案.pptx

    Material Retained、Material Removed、Side Trimmed等模式可以根据生成的边界类型选用。 底平面是UG数控编程加工平面铣的基础概念之一。底平面位于最低(最后的)切削层面。所有的切削层面都是平行于底平面的生成...

    3D游戏开发高级应用

    在实际开发中,立即模式(Immediate Mode)是本文的重点,它允许开发者直接控制3D图形的绘制,更自由地构建和更新场景。保留模式(Retained Mode)则提供更高级的场景图形管理,适合复杂场景的构建,但本文未作深入...

    NX二次开发UF-DRF-ask-retained-state 函数介绍

    NX二次开发UF_DRF_ask_retained_state 函数介绍,Ufun提供了一系列丰富的 API 函数,可以帮助用户实现自动化、定制化和扩展 NX 软件的功能。无论您是从事机械设计、制造、模具设计、逆向工程、CAE 分析等领域的专业...

    NX二次开发UF-DRF-is-annotation-retained 函数介绍

    NX二次开发UF_DRF_is_annotation_retained 函数介绍,Ufun提供了一系列丰富的 API 函数,可以帮助用户实现自动化、定制化和扩展 NX 软件的功能。无论您是从事机械设计、制造、模具设计、逆向工程、CAE 分析等领域的...

    NX二次开发UF-DRF-set-retained-state 函数介绍

    NX二次开发UF_DRF_set_retained_state 函数介绍,Ufun提供了一系列丰富的 API 函数,可以帮助用户实现自动化、定制化和扩展 NX 软件的功能。无论您是从事机械设计、制造、模具设计、逆向工程、CAE 分析等领域的专业...

    retained:大规模的活动和保留跟踪

    保留:大规模的活动和保留跟踪 使用Redis位图,可以轻松地按日,小时或分钟的间隔按比例跟踪活动和保持度。 要求 Ruby 2.0.0或更高版本 雷迪斯 安装保留 ...Retained的默认设置是在redis://localhost:63

    retained-intron-neoantigen-pipeline:从RNA-Seq数据衍生的内含子保留事件中调用新抗原的管道

    保留内含子新抗原管道 该管道从源自RNA-Seq数据并通过KMA软件包识别的内含子保留事件中调用基于RNA的新抗原(有关此操作的更多详细信息,请参见下面的运行说明)。 跑步: 下载NetMHCPan-3.0( )并更改...

    行图形绘制与多屏拼接显示技术综述并行图形绘制与多屏拼接显示技术综述

    - **立即模式(Immediate Mode):**在这种模式下,模型数据集中在客户端,并通过网络传输几何指令给服务器端进行绘制。这种方式的优点是使用灵活且兼容性强,但每次绘制都需要传输大量数据,因此网络带宽成为瓶颈。...

Global site tag (gtag.js) - Google Analytics