VideoMaterial
A material specialized for rendering spatial videos.
This material supports immersive spatial video experiences by providing essential tools to achieve a variety of visual effects. Additionally, a ShaderGraphMaterial can be attached to apply rendering effects directly to the texture used by VideoMaterial during rendering.
Notes:
When a ShaderGraphMaterial is attached, it should be detached once it is no longer needed by the current VideoMaterial. Any previously attached ShaderGraphMaterial will be automatically released unless it has been marked as a global resource via the `.toGlobal()' method as shown in the following example:
val bundle = AssetBundle.load("asset://your_shaderGraphMaterial_name.bundle")
val shaderMat = ShaderGraphMaterial.loadFromAssetBundle(bundle, "relative_path_in_AssetBundle")
shaderMat.toGlobal()
videoMaterial.attachShaderGraphMaterial(shaderMat)Detaching a ShaderGraphMaterial will release it if it is not marked as a global resource. To make a material global, call
.toGlobal()like shown in the example above.
See also
Constructors
Creates a VideoMaterial with the specified BlendingMode, VideoDimensionMode, and MaterialCullingMode.
Creates a VideoMaterial with the specified BlendingMode, VideoDimensionMode, and MaterialCullingMode.
Functions
Attaches a valid ShaderGraphMaterial to the VideoMaterial.
Bind a SurfaceRenderTexture instance with current video material.
Detaches the previously attached ShaderGraphMaterial from the VideoMaterial.
Gets the bind SurfaceRenderTexture of the VideoMaterial.
Gets the MaterialCullingMode of the VideoMaterial.
Gets the state of depth testing for the VideoMaterial.
Gets the state of depth writing for the VideoMaterial.
Gets the VideoDimensionMode of the VideoMaterial.
Gets the attached ShaderGraphMaterial of the VideoMaterial.
Sets the MaterialCullingMode of the VideoMaterial.
Enables or disables depth testing for the VideoMaterial.
Enables or disables depth writing for the VideoMaterial.
Sets the VideoDimensionMode of the VideoMaterial.
Sets the image HardwareBuffer of the VideoMaterial in the following modes: VideoDimensionMode.MONO, VideoDimensionMode.SIDE_BY_SIDE, and VideoDimensionMode.TOP_AND_DOWN.
Sets the image of the VideoMaterial in VideoDimensionMode.MULTIPLE_VIEW mode.
Sets the TextureResource of the VideoMaterial in the following modes: VideoDimensionMode.MONO, VideoDimensionMode.SIDE_BY_SIDE, and VideoDimensionMode.TOP_AND_DOWN.
Sets the TextureResource of the VideoMaterial in VideoDimensionMode.MULTIPLE_VIEW.
Unbind surface render texture with current video material.