Set up your Render Texture to display video
Use a Render Texture as a video target.
Read time 2 minutesLast updated a day ago
Use a Render Texture to display your video content on the surface of multiple GameObjects that share the Render Texture or to apply post-processing effects to the video.
To display your video content on a Render Texture:
Prepare your Render Texture for video
To set up a good starting point for your Render Texture with video content:
- Click on your Render Texture to open the Inspector window.
- Make sure the resolution of the Render Texture matches the resolution of your video content.
- Set Anti-aliasing to None.
- Set Color Format to R8G8B8A8_UNORM. If you notice excessive banding with your Render Texture, particularly in dark areas where the color transitions look unnatural, set Color Format to R16G16B16A16_UNORM.
- Set Depth Stencil Format to None.
- Disable Mipmap.
- Set Wrap Mode to Clamp.
- Set Filter Mode to Point. Point sampling keeps the video pixel-exact where the Render Texture maps one-to-one onto pixels on the screen, which the matching resolution in step 2 provides.
-
- Disable anisotropic filtering via script:
renderTexture.anisoLevel = 0;
When done, your Render Texture is ready for your video content.
Set a Render Texture as your Video Player's target
To have your video play on your Render Texture, you need to set up your Video Player component to target your Render Texture:
- Click on the GameObject that contains the Video Player component. The Inspector window opens.
- Set Render Mode to .Render Texture
?
- Assign your Render Texture to Target Texture.
Your Video Player component now targets your optimized Render Texture.