ScruffyRules / _VRChat_VideoPlayer

Information about how to support video player textures on avatars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_VRChat_VideoPlayer

This is the readme/help for _VRChat_VideoPlayer texture
This isn't a video player prefab
SDK2 only
If you want a video player prefab head over to iwaSyncVideo or try and use the one in the SDK

For World Creators

I've provided a zip package here which contains a prefab you can drag and drop into your world.

How to setup

  1. Drag the _VRChat_VideoPlayer prefab into your world
  2. Put your VideoPlayer's RenderTexture into the Button's OnClick Object slot
  3. Set the function to RenderTexture.SetGlobalShaderProperty
  4. Set the function argument to _VRChat_VideoPlayer
  5. You're done!

Render Texture settings

I'd recommend setting your RenderTexture to these settings:

  • Width: 1280
  • Height: 720
  • Color Format: ARGB32
  • Depth Buffer: No Depth Buffer
  • sRGB: Enabled
  • Wrap Mode: Repeat

Stream Players

This currently doesn't support Stream Players because they can only output to a texture slot not a RenderTexture

For Avatar Creators

You'll have to use a shader that supports it.

Supported Shaders:

  • Poiyomi's Paid Video Shader

For Shader Developers

DO NOT add a property for this name, it will override the RenderTexture.

You need to add this

sampler2D _VRChat_VideoPlayer;
float4 _VRChat_VideoPlayer_TexelSize;

and then to use it you need to do

if (_VRChat_VideoPlayer_TexelSize.z != 0) { // For optimisation
    float4 vrc_videoplayer = tex2D(_VRChat_VideoPlayer, i.uv); // Use your (Custom?) UVs
    if (vrc_videoplayer.a == 1) { // This says if you're in a world that supports it or not
        return vrc_videoplayer; // You can do anything with this, I usually add it after lighting
    }
}

About

Information about how to support video player textures on avatars

License:MIT License