Google cardBoard Android API (六):DistortionRenderer
来源:互联网 发布:fullscreen软件 编辑:程序博客网 时间:2024/06/08 18:38
Encapsulates the rendering operations to correct lens distortion.
This class is not thread-safe. For performance reasons, exposed public methods in this class are assumed to run in mutual exclusion (e.g. in the same or non-overlapping threads).
Public Constructors
Public Methods
Inherited Methods
Public Constructors
public DistortionRenderer ()
Public Methods
public void afterDrawFrame ()
Performs distortion correction.
Must be called after drawing a frame to correct its distortion. Note that this method is only allowed to modify the parts of the OpenGL state machine which are backed up and restored using a GLStateBackup object.
public void beforeDrawFrame ()
Performs the required setup to correct distortion.
Must be called before drawing a frame that should be undistorted.
public boolean haveViewportsChanged ()
Checks if the distortion-corrected dimensions of the viewports have changed since the last call to updateViewports
.
Returns
true
if the dimensions have changed,false
otherwise.
public void onFovChanged (HeadMountedDisplay hmd, FieldOfView leftFov,FieldOfView rightFov, float virtualEyeToScreenDistance)
To be called when a change in the field of view of any eye happens.
Must be called at least once prior to beforeDrawFrame()
. Calling this method betweenbeforeDrawFrame()
and afterDrawFrame()
calls will raise an IllegalStateException
.
This method might recompute the mesh used for distortion correction, but no changes involving GL calls will take place until beforeDrawFrame()
is called.
Parameters
public void setRestoreGLStateEnabled (boolean enabled)
Enables or disables restoration of the application's GL state after postprocessing.
If this flag is enabled, the framework ensures that the GL state at the beginning of the next frame is equivalent to the GL state at the end of the last frame.
Enabled by default.
Parameters
true
to enable GL state restoration, false
to disable.public void setVignetteEnabled (boolean enabled)
Enables or disables vignetting around frame edge.
If this flag is enabled, the distortion shader applies a darkening effect to the edges of the visible viewport, simulating vignetting.
Enabled by default.
Parameters
true
to enable vignette effect, false
to disable.public void undistortTexture (int textureId)
Undistorts the provided texture by rendering into the current output target.
This method should not be directly called when using the beforeDrawFrame()
andafterDrawFrame()
methods.
Parameters
public void updateViewports (Viewport leftViewport, Viewport rightViewport)
Updates the eye viewports to their effective dimensions after distortion correction.
Parameters
- Google cardBoard Android API (六):DistortionRenderer
- Google cardBoard Android API (一):CardboardActivity
- Google cardBoard Android API (二):CardboardDeviceParams
- Google cardBoard Android API (三):CardboardView
- Google cardBoard Android API (四):Constants
- Google cardBoard Android API (五):Distortion
- Google cardBoard Android API (七):Eye
- Google cardBoard Android API (八):Eye.Type
- Google cardBoard Android API (九):FieldOfView
- Google cardBoard Android API (十):HeadMountedDisplay
- Google cardBoard Android API (十一):HeadMountedDisplayManager
- Google cardBoard Android API (十二):HeadTransform
- Google cardBoard Android API (十三):ScreenParams
- Google cardBoard Android API (十四):ViewPort
- Google cardBoard Android API (十五):两个接口中的CardboardView.Renderer
- Google cardBoard Android API (十六):两个接口中的CardboardView.StereoRenderer
- Google cardBoard Android API (十七):Enums--CardboardDeviceParams.VerticalAlignmentType
- Google cardBoard Android的两个jar包,以及Demo
- 二维码生成(CIFilter生成二维码,清晰度高的二维码,自定义颜色的二维码,带logo的二维码)
- ftp文件服务器的安装和配置
- 敏捷开发XP
- iOS-仿百思不得姐app
- C++中的 typedef Vec<uchar, 3> Vec3b; 是何意?
- Google cardBoard Android API (六):DistortionRenderer
- sqlite插入数据效率提升解决方案
- Java国际化
- Homebrew的安装遇到400 Bad Request错误
- 模块加载——modprobe和insmod的区别
- C/C++拾起
- Zookeeper学习(十一):ZooKeeper 实现命名服务
- JS组件Bootstrap Table使用方法详解
- oracle 创建、删除唯一性约束