Class ExternalTexture


  • public class ExternalTexture
    extends java.lang.Object
    Creates an Android SurfaceTexture and Surface that can be displayed by Sceneform. Useful for displaying video, or anything else that can be drawn to a SurfaceTexture.

    The getFilamentEngine OpenGL ES texture is automatically created by Sceneform. Also, SurfaceTexture.updateTexImage() is automatically called and should not be called manually.

    Call Material.setExternalTexture(String, ExternalTexture) to use an ExternalTexture. The material parameter MUST be of type 'samplerExternal'.

    • Constructor Summary

      Constructors 
      Constructor Description
      ExternalTexture()
      Creates an ExternalTexture with a new Android SurfaceTexture and Surface.
      ExternalTexture​(int textureId, int width, int height)
      Creates an ExternalTexture from an OpenGL ES textureId without a SurfaceTexture.
    • Constructor Detail

      • ExternalTexture

        public ExternalTexture()
        Creates an ExternalTexture with a new Android SurfaceTexture and Surface.
      • ExternalTexture

        public ExternalTexture​(int textureId,
                               int width,
                               int height)
        Creates an ExternalTexture from an OpenGL ES textureId without a SurfaceTexture. For internal use only.
    • Method Detail

      • getSurfaceTexture

        public android.graphics.SurfaceTexture getSurfaceTexture()
        Gets the surface texture created for this ExternalTexture.
      • getSurface

        public android.view.Surface getSurface()
        Gets the surface created for this ExternalTexture that draws to getSurfaceTexture()
      • getFilamentTexture

        public com.google.android.filament.Texture getFilamentTexture()
      • getFilamentStream

        public com.google.android.filament.Stream getFilamentStream()