From 7ac79d1ee01a4f25ea7e622e48207b6881fb3c64 Mon Sep 17 00:00:00 2001 From: AcChosen <49845629+AcChosen@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:41:35 -0500 Subject: [PATCH] Updated VRSL DMX: Creating Custom DMX Shaders (markdown) --- VRSL-DMX:-Creating-Custom-DMX-Shaders.md | 27 ++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/VRSL-DMX:-Creating-Custom-DMX-Shaders.md b/VRSL-DMX:-Creating-Custom-DMX-Shaders.md index 4b89518..5fd7861 100644 --- a/VRSL-DMX:-Creating-Custom-DMX-Shaders.md +++ b/VRSL-DMX:-Creating-Custom-DMX-Shaders.md @@ -5,10 +5,14 @@ VRSL DMX is intended to be used more like a data protocol rather than a discrete [Here](https://youtu.be/xObiwrySNZ4) is the video tutorial version of this page. -VRSL DMX works similarly to audiolink in that there is a single CGINC file that you need to include to start creating DMX-compatible world shaders. The file is called `VRSLDMX.cginc` and you can use it with this strip of code: +VRSL DMX works similarly to audiolink in that there is a single CGINC file that you need to include to start creating DMX-compatible world shaders. For avatar shaders, the same file can be found in the`VRSL-AvatarCarePackage.unitypackage` file. The file is called `VRSLDMX.cginc`. For world shaders, you can get to it with this line of code: `#include "Packages/com.acchosen.vr-stage-lighting/Runtime/Shaders/VRSLDMX.cginc"` +For avatar shaders, it would be this line: +`#include "Assets/VRSL Addons/VRSL-AvatarCarePackage/VRSLDMX.cginc"` + + This file contains a few instanced defined properties, standard defined properties, and some functions needed to read DMX from the grid node. Once you have this file in, there are some properties you may want to define first before you get started writing. ## Example Code @@ -68,8 +72,11 @@ Shader "Unlit/VRSL-TutorialV2" float4 vertex : SV_POSITION; nointerpolation float4 finalColor : TEXCOORD1; //final output color from DMX }; - //Main CGINC File + //Main CGINC File For World Shaders #include "Packages/com.acchosen.vr-stage-lighting/Runtime/Shaders/VRSLDMX.cginc" + + //Main CGINC File For Avatar Shaders + //#include "Assets/VRSL Addons/VRSL-AvatarCarePackage/VRSLDMX.cginc" sampler2D _MainTex; float4 _MainTex_ST; @@ -233,11 +240,23 @@ To add your custom DMX shader/material to the VRSL DMX Script, `VRStageLighting_ ![](https://imgur.com/ezAt7b6.png) -# Testing Avatar Shaders +# Testing Avatar Shaders (Without Udon) Testing DMX shaders would normally require you to have dmx software and the dmx grid node set up to take data in and set up the mappings and such. However, this is extremely tedious and not very practical, especially for avatar creators who simply want to make sure their avatar is working properly and not have to set up an entire dmx scene and software just to test these features. -In the standard VR Stage Lighting package, however, there are special example scenes that have recorded video of DMX data that avatar authors can use to test their avatars without needing to have an entire software suite setup. +In the `VRSL-AvatarCarePackage.unitypackage` file, there is a special prefab called the `VRSL-AvatarDMXTesting-Prefab`. This prefab is a script with cameras that plays back pre-recorded dmx videos and automatically outputs the data to the standard global texture names, as if VRSL was properly built in the scene, getting data. The data that is sent is simple patterns across many channels and many universes for you to test your inputs on your avatars. The script also contains settings to determine which mode it is (currently only Horizontal and Vertical are supported) and whether or not extended mode (9-universe mode) is enabled. Depending on the settings, similar but different videos will be played. + +You can set your avatar's universe and channel settings to match the ones shown in the video to test different channels. Most of the cubes are the same 5-channel fixtures as shown in the example. There are also 15-channel fixtures getting random data on channel 400 in universes 1-3 you can test as well. When you are done testing, be sure to disable this prefab before uploading your avatar + +![](https://i.imgur.com/5CYaaOP.png) + +Importing this care package and dropping this prefab into your avatar scene should be all you need to test your shader and your material settings for your DMX compatible avatar. + + +## Testing Avatar Shaders (With Udon) + + +In the standard VR Stage Lighting package, there are special example scenes that have recorded videos of DMX data that avatar authors can use to test their avatars without needing to have an entire software suite setup. The two scenes are called `VRSL-ExampleScene-AvatarTest-Editor` and `VRSL-ExampleScene-AvatarTest-InGame` respectively. As the names imply, one is for testing the avatar shader in the editor and the other is for testing the avatar in the world. These scenes are located in `Packages\com.acchosen.vr-stage-lighting\Runtime\Example Scenes\DMX-AvatarTesting`