On-screen Rendering vs. Off-screen Rendering

 

* <b>On-screen Rendering vs. Off-screen Rendering</b>

 * <p>

 * The Canvas3D class is used either for on-screen rendering or 

 * off-screen rendering.

 * On-screen Canvas3Ds are added to AWT or Swing Container objects

 * like any other canvas.  Java 3D automatically and continuously

 * renders to all on-screen canvases that are attached to an active

 * View object.  On-screen Canvas3Ds can be either single or double

 * buffered and they can be either stereo or monoscopic.

 * <p>

 * Off-screen Canvas3Ds must not be added to any Container.  Java 3D

 * renders to off-screen canvases in response to the

 * <code>renderOffScreenBuffer</code> method.  Off-screen Canvas3Ds

 * are single buffered.  However, on many systems, the actual

 * rendering is done to an off-screen hardware buffer or to a 3D

 * library-specific buffer and only copied to the off-screen buffer of

 * the Canvas when the rendering is complete, at "buffer swap" time.

 * Off-screen Canvas3Ds are monoscopic.

 * <p>

 * The setOffScreenBuffer method sets the off-screen buffer for this 

 * Canvas3D. The specified image is written into by the Java 3D renderer. 

 * The size of the specified ImageComponent determines the size, in 

 * pixels, of this Canvas3D - the size inherited from Component is 

 * ignored. Note that the size, physical width, and physical height of the

 * associated Screen3D must be set

 * explicitly prior to rendering. Failure to do so will result in an 

 * exception.

 

屏幕渲染VS非屏幕渲染

Canvas3D 有两种渲染方式 on-screen rendering 和 off-screen rendering

和其他canvas对象一样,通过屏幕渲染方式的 Canvas3D 对象被添加到AWT 或者 Swing 对象中。Java 3D 自动并且持续渲染所有的附加在活动View对象上的canvases 对象。屏幕渲染Canvas3D 对象可以有一个或者两个缓冲区(buffer)并且缓冲区可以是立体对象数据或者平面对象数据。

非屏幕渲染的Canvas3D对象不能被添加到任何容器中。Java 3D通过响应renderOffScreenBuffer方法渲染。

非屏幕对象是单缓冲的。

但是,在很多操作系统中,当渲染完成后,在 “buffer swap”时间段内,渲染数据被放置在一个非屏幕硬件中或者一个3D应用程序包指定的缓冲区中,并且渲染数据只能被拷贝到Canvas对象的非屏幕缓冲区中。

非屏幕渲染的Canvas3D 对象是平面的。

 

如果通过setOffScreenBuffer 该方法指定渲染buffer ,则ImageComponent 决定Java 3D 渲染后的图像大小。需要注意的是,必须指定图像的物理大小参数,不然会出现程序异常。

 

我的理解:

  1.在非屏幕渲染情况下,Canvas3D对象不能被添加到继承了Container类得任何类所生成的对象中,例如Panel,jframe...

  2.非屏幕渲染对象只有一个存储渲染数据的Buffer对象。

  3.根据操作系统的不同,渲染数据有可能被放置到硬件缓冲区或者3d应用程序包的缓冲区中,这时就需要将该数据拷贝到Canvas3d对象的缓冲区中,在这种情况下渲染数据只能被拷贝到非屏幕缓冲区。

  4.非屏幕渲染的Canvas3D 对象是平面的,可能是由于我们眼睛通过屏幕看到的图像只能是平面图,缓冲区只存储眼睛所能看到的图像数据。

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值