diff --git a/!Prefabs & Examples/ImagePoster.prefab b/!Prefabs & Examples/ImagePoster.prefab index e25c21b..ca667da 100644 --- a/!Prefabs & Examples/ImagePoster.prefab +++ b/!Prefabs & Examples/ImagePoster.prefab @@ -30,7 +30,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0} m_LocalPosition: {x: -4.13, y: 4.49, z: 35.1} - m_LocalScale: {x: 4, y: 5, z: 1} + m_LocalScale: {x: 2.87469, y: 5.11056, z: 0.31941} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} @@ -59,12 +59,13 @@ MonoBehaviour: _udonSharpBackingUdonBehaviour: {fileID: 9181003179774458621} manager: {fileID: 0} uploaderIdOverride: + materialIndex: 0 imageIds: - - 1234 + - 883058 texturePropertyMappings: - _MainTex defaultTextures: - - {fileID: 0} + - {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0} --- !u!33 &2163663917368825931 MeshFilter: m_ObjectHideFlags: 0 @@ -93,7 +94,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 66b314f6e6cbc5a4a97f18dde3864299, type: 2} + - {fileID: 0} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/!Prefabs & Examples/ImagePosterBasic.prefab b/!Prefabs & Examples/ImagePosterBasic.prefab new file mode 100644 index 0000000..a274b73 --- /dev/null +++ b/!Prefabs & Examples/ImagePosterBasic.prefab @@ -0,0 +1,146 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2060822048231195776 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1528446519683287799} + - component: {fileID: 3400302691665751940} + - component: {fileID: 2862955561947265945} + - component: {fileID: 1808872662603266556} + - component: {fileID: 1988980350728663937} + m_Layer: 0 + m_Name: ImagePosterBasic + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1528446519683287799 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2060822048231195776} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -1, z: 0, w: 0} + m_LocalPosition: {x: 4.12, y: 4.11, z: -9.219664} + m_LocalScale: {x: 2.87469, y: 5.11056, z: 0.31941} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: -180, y: 0, z: -180} +--- !u!114 &3400302691665751940 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2060822048231195776} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8a8eb2bbd000b1341a20fd8188c3ef34, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: [] + _udonSharpBackingUdonBehaviour: {fileID: 1988980350728663937} + manager: {fileID: 0} + uploaderIdOverride: + albedoImageId: + emissionImageId: + normalImageId: + defaultAlbedo: {fileID: 0} + albedoColor: {r: 1, g: 1, b: 1, a: 1} + defaultEmission: {fileID: 0} + emissionColor: {r: 1, g: 1, b: 1, a: 1} + defaultNormal: {fileID: 0} + normalIntensity: 1 +--- !u!33 &2862955561947265945 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2060822048231195776} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1808872662603266556 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2060822048231195776} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 66b314f6e6cbc5a4a97f18dde3864299, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &1988980350728663937 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2060822048231195776} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3} + m_Name: + m_EditorClassIdentifier: + interactTextPlacement: {fileID: 0} + interactText: Use + interactTextGO: {fileID: 0} + proximity: 2 + SynchronizePosition: 0 + AllowCollisionOwnershipTransfer: 0 + Reliable: 0 + _syncMethod: 1 + serializedProgramAsset: {fileID: 11400000, guid: 7111a5f4b78f7a94fb3d6ae9aef3b9d4, + type: 2} + programSource: {fileID: 11400000, guid: 5ca3673014ba8e84cbd28b03627eac47, type: 2} + serializedPublicVariablesBytesString: Ai8AAAAAATIAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAFQAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AAAAAAAYBAAAAAAAAACcBBAAAAHQAeQBwAGUAAWgAAABTAHkAcwB0AGUAbQAuAEMAbwBsAGwAZQBjAHQAaQBvAG4AcwAuAEcAZQBuAGUAcgBpAGMALgBMAGkAcwB0AGAAMQBbAFsAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4ALgBJAG4AdABlAHIAZgBhAGMAZQBzAC4ASQBVAGQAbwBuAFYAYQByAGkAYQBiAGwAZQAsACAAVgBSAEMALgBVAGQAbwBuAC4AQwBvAG0AbQBvAG4AXQBdACwAIABtAHMAYwBvAHIAbABpAGIAAQEJAAAAVgBhAHIAaQBhAGIAbABlAHMALwEAAAABaAAAAFMAeQBzAHQAZQBtAC4AQwBvAGwAbABlAGMAdABpAG8AbgBzAC4ARwBlAG4AZQByAGkAYwAuAEwAaQBzAHQAYAAxAFsAWwBWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAEkAbgB0AGUAcgBmAGEAYwBlAHMALgBJAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlACwAIABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgBdAF0ALAAgAG0AcwBjAG8AcgBsAGkAYgABAAAABgEAAAAAAAAAAi8CAAAAAUkAAABWAFIAQwAuAFUAZABvAG4ALgBDAG8AbQBtAG8AbgAuAFUAZABvAG4AVgBhAHIAaQBhAGIAbABlAGAAMQBbAFsAUwB5AHMAdABlAG0ALgBJAG4AdAAzADIALAAgAG0AcwBjAG8AcgBsAGkAYgBdAF0ALAAgAFYAUgBDAC4AVQBkAG8AbgAuAEMAbwBtAG0AbwBuAAIAAAAGAgAAAAAAAAAnAQQAAAB0AHkAcABlAAEXAAAAUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwAsACAAbQBzAGMAbwByAGwAaQBiACcBCgAAAFMAeQBtAGIAbwBsAE4AYQBtAGUAAR8AAABfAF8AXwBVAGQAbwBuAFMAaABhAHIAcABCAGUAaABhAHYAaQBvAHUAcgBWAGUAcgBzAGkAbwBuAF8AXwBfACcBBAAAAHQAeQBwAGUAARYAAABTAHkAcwB0AGUAbQAuAEkAbgB0ADMAMgAsACAAbQBzAGMAbwByAGwAaQBiABcBBQAAAFYAYQBsAHUAZQACAAAABwUHBQcF + publicVariablesUnityEngineObjects: [] + publicVariablesSerializationDataFormat: 0 diff --git a/!Prefabs & Examples/ImagePosterBasic.prefab.meta b/!Prefabs & Examples/ImagePosterBasic.prefab.meta new file mode 100644 index 0000000..a4d937b --- /dev/null +++ b/!Prefabs & Examples/ImagePosterBasic.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6eeb763f709f65f438e1d53fbc28f5ba +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Components/VRCBoardImage.cs b/Components/VRCBoardImage.cs index 22e2bb7..c2c1dcd 100644 --- a/Components/VRCBoardImage.cs +++ b/Components/VRCBoardImage.cs @@ -191,12 +191,18 @@ namespace VRCBoard.Components OnDisable(); EditorUtility.SetDirty(script); } + + if (renderer.sharedMaterials.Length == 0) + { + EditorGUILayout.HelpBox("Material has no material slots.", MessageType.Error); + return; + } Material material = renderer.sharedMaterials[newMaterialIndex]; if (material == null) { - EditorGUILayout.HelpBox("No material assigned to material slot ("+newMaterialIndex+")", MessageType.Warning); + EditorGUILayout.HelpBox("No material assigned to material slot ("+newMaterialIndex+")", MessageType.Error); return; } diff --git a/Components/VRCBoardImageBasic.asset b/Components/VRCBoardImageBasic.asset new file mode 100644 index 0000000..5712bd6 --- /dev/null +++ b/Components/VRCBoardImageBasic.asset @@ -0,0 +1,944 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} + m_Name: VRCBoardImageBasic + m_EditorClassIdentifier: + serializedUdonProgramAsset: {fileID: 11400000, guid: 7111a5f4b78f7a94fb3d6ae9aef3b9d4, + type: 2} + udonAssembly: + assemblyError: + sourceCsScript: {fileID: 11500000, guid: 8a8eb2bbd000b1341a20fd8188c3ef34, type: 3} + scriptVersion: 2 + compiledVersion: 2 + behaviourSyncMode: 1 + hasInteractEvent: 0 + scriptID: -7310484990901071129 + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: [] + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: fieldDefinitions + Entry: 7 + Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition, + UdonSharp.Editor]], mscorlib + - Name: comparer + Entry: 7 + Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String, + mscorlib]], mscorlib + - Name: + Entry: 8 + Data: + - Name: + Entry: 12 + Data: 16 + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: manager + - Name: $v + Entry: 7 + Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: manager + - Name: k__BackingField + Entry: 7 + Data: 3|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRCBoard.VRCBoardManager, Assembly-CSharp + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: 4|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.Udon.UdonBehaviour, VRC.Udon + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 6|UnityEngine.HideInInspector, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _imageInitialized + - Name: $v + Entry: 7 + Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _imageInitialized + - Name: k__BackingField + Entry: 7 + Data: 8|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _dataInitialized + - Name: $v + Entry: 7 + Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _dataInitialized + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 11|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _initialized + - Name: $v + Entry: 7 + Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _initialized + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 9 + Data: 8 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: uploaderIdOverride + - Name: $v + Entry: 7 + Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: uploaderIdOverride + - Name: k__BackingField + Entry: 7 + Data: 15|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 17|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Uploader ID (only applies to images of 'shared' or 'instance' type) + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: albedoImageId + - Name: $v + Entry: 7 + Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: albedoImageId + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 20|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Image IDs + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: emissionImageId + - Name: $v + Entry: 7 + Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: emissionImageId + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: normalImageId + - Name: $v + Entry: 7 + Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: normalImageId + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: defaultAlbedo + - Name: $v + Entry: 7 + Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: defaultAlbedo + - Name: k__BackingField + Entry: 7 + Data: 26|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Texture2D, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 26 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 28|UnityEngine.HeaderAttribute, UnityEngine.CoreModule + - Name: header + Entry: 1 + Data: Defaults + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: albedoColor + - Name: $v + Entry: 7 + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: albedoColor + - Name: k__BackingField + Entry: 7 + Data: 30|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Color, UnityEngine.CoreModule + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 32|UnityEngine.ColorUsageAttribute, UnityEngine.CoreModule + - Name: showAlpha + Entry: 5 + Data: true + - Name: hdr + Entry: 5 + Data: true + - Name: minBrightness + Entry: 4 + Data: 0 + - Name: maxBrightness + Entry: 4 + Data: 8 + - Name: minExposureValue + Entry: 4 + Data: 0.125 + - Name: maxExposureValue + Entry: 4 + Data: 3 + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: defaultEmission + - Name: $v + Entry: 7 + Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: defaultEmission + - Name: k__BackingField + Entry: 9 + Data: 26 + - Name: k__BackingField + Entry: 9 + Data: 26 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: emissionColor + - Name: $v + Entry: 7 + Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: emissionColor + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 9 + Data: 30 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 37|UnityEngine.ColorUsageAttribute, UnityEngine.CoreModule + - Name: showAlpha + Entry: 5 + Data: true + - Name: hdr + Entry: 5 + Data: true + - Name: minBrightness + Entry: 4 + Data: 0 + - Name: maxBrightness + Entry: 4 + Data: 8 + - Name: minExposureValue + Entry: 4 + Data: 0.125 + - Name: maxExposureValue + Entry: 4 + Data: 3 + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: defaultNormal + - Name: $v + Entry: 7 + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: defaultNormal + - Name: k__BackingField + Entry: 9 + Data: 26 + - Name: k__BackingField + Entry: 9 + Data: 26 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: normalIntensity + - Name: $v + Entry: 7 + Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: normalIntensity + - Name: k__BackingField + Entry: 7 + Data: 41|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Single, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 41 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: true + - Name: _fieldAttributes + Entry: 7 + Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _mainType + - Name: $v + Entry: 7 + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _mainType + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _uploaderId + - Name: $v + Entry: 7 + Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _uploaderId + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 9 + Data: 15 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 0 + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: diff --git a/Components/VRCBoardImageBasic.asset.meta b/Components/VRCBoardImageBasic.asset.meta new file mode 100644 index 0000000..3fa81c3 --- /dev/null +++ b/Components/VRCBoardImageBasic.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ca3673014ba8e84cbd28b03627eac47 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Components/VRCBoardImageBasic.cs b/Components/VRCBoardImageBasic.cs new file mode 100644 index 0000000..b8cf56a --- /dev/null +++ b/Components/VRCBoardImageBasic.cs @@ -0,0 +1,179 @@ +using UdonSharp; +using UnityEngine; +using UnityEngine.Serialization; +using VRC.SDK3.Data; + +namespace VRCBoard.Components +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.None)] + public class VRCBoardImageBasic : VRCBoardBaseComponent + { + [Header("Uploader ID (only applies to images of 'shared' or 'instance' type)")] + public string uploaderIdOverride; + + [Header("Image IDs")] + public string albedoImageId; + public string emissionImageId; + public string normalImageId; + + [Header("Defaults")] + public Texture2D defaultAlbedo; + [ColorUsageAttribute(true,true)] public Color albedoColor = Color.white; + public Texture2D defaultEmission; + [ColorUsageAttribute(true,true)] public Color emissionColor = Color.white; + public Texture2D defaultNormal; + public float normalIntensity = 1.0f; + + + private string _mainType = ""; + private string _uploaderId = ""; + + protected override void OnRegister() + { + MaterialPropertyBlock _propertyBlock = new MaterialPropertyBlock(); + Debug.Log("Registering image component"); + if (defaultAlbedo) + _propertyBlock.SetTexture("_MainTexAtlas", defaultAlbedo); + + if (defaultEmission) + _propertyBlock.SetTexture("_EmissionMapAtlas", defaultEmission); + + if (defaultNormal) + _propertyBlock.SetTexture("_NormalMapAtlas", defaultNormal); + + _propertyBlock.SetInteger("_MainTexAtlasIndex", 0); + _propertyBlock.SetInteger("_MainTexAtlasSize", 1); + _propertyBlock.SetInteger("_EmissionMapAtlasIndex", 0); + _propertyBlock.SetInteger("_EmissionMapAtlasSize", 1); + _propertyBlock.SetInteger("_NormalMapAtlasIndex", 0); + _propertyBlock.SetInteger("_NormalMapAtlasSize", 1); + + _propertyBlock.SetColor("_EmissionColor", emissionColor); + _propertyBlock.SetFloat("_NormalMapScale", normalIntensity); + _propertyBlock.SetColor("_MainTexColor", albedoColor); + + GetComponent().SetPropertyBlock(_propertyBlock); + } + + + private string GetUploader() + { + string uploaderId = ""; + if (string.IsNullOrEmpty(uploaderIdOverride)) + { + GetImageAtlasTexture(albedoImageId, null, out Texture2D albedoTexture, out int albedoAtlasPosition, out int albedoAtlasSize, out string albedoType); + if (albedoType == null) + { + Debug.LogError("Failed to get image type for albedo image"); + return ""; + } + _mainType = albedoType; + if (_mainType == "shared") + { + uploaderId = GetRandomUploader(albedoImageId); + } + else + { + DataDictionary ownerInfo = manager.GetSupporterDataFromPlayer(manager.instanceOwner); + if (ownerInfo == null) + { + Debug.LogWarning("Failed to get owner info, user has likely not linked their account."); + return ""; + } + bool ownerSuccess = ownerInfo.TryGetValue("id", out DataToken ownerToken); + if (!ownerSuccess || ownerToken.TokenType != TokenType.String) + { + Debug.LogWarning("Failed to get owner ID from owner info."); + return ""; + } + uploaderId = ownerToken.String; + } + + Debug.Log("image uploader: " + uploaderId); + } else + { + uploaderId = uploaderIdOverride; + } + return uploaderId; + } + + private void TryGetUploader() + { + if (!string.IsNullOrEmpty(_uploaderId)) return; + _uploaderId = GetUploader(); + if (string.IsNullOrEmpty(_uploaderId)) + { + Debug.LogError("Failed to get uploader ID"); + return; + } + RequestImageLoad(albedoImageId, _uploaderId); + RequestImageLoad(emissionImageId, _uploaderId); + RequestImageLoad(normalImageId, _uploaderId); + } + protected override void OnInitialize() + { + TryGetUploader(); + } + protected override void OnImageDataUpdate() + { + TryGetUploader(); + } + + protected override void OnSupporterDataUpdate() + { + TryGetUploader(); + } + + protected override void OnImageLoaded() + { + Debug.Log("Image loaded VRCBoardImage"); + + Texture2D albedoTexture; + int albedoAtlasPosition; + int albedoAtlasSize; + + Texture2D emissionTexture; + int emissionAtlasPosition; + int emissionAtlasSize; + + Texture2D normalTexture; + int normalAtlasPosition; + int normalAtlasSize; + + bool albedoSuccess = GetImageAtlasTexture(albedoImageId, _uploaderId, out albedoTexture, out albedoAtlasPosition, out albedoAtlasSize, out string type1); + bool emissionSuccess = GetImageAtlasTexture(emissionImageId, _uploaderId, out emissionTexture, out emissionAtlasPosition, out emissionAtlasSize, out string type2); + bool normalSuccess = GetImageAtlasTexture(normalImageId, _uploaderId, out normalTexture, out normalAtlasPosition, out normalAtlasSize, out string type3); + + MaterialPropertyBlock _propertyBlock = new MaterialPropertyBlock(); + + if (albedoSuccess && albedoTexture) { + _propertyBlock.SetTexture("_MainTexAtlas", albedoTexture); + _propertyBlock.SetInteger("_MainTexAtlasIndex", albedoAtlasPosition); + _propertyBlock.SetInteger("_MainTexAtlasSize", albedoAtlasSize); + } + else + { + return; + } + + if (emissionSuccess && emissionTexture) { + _propertyBlock.SetTexture("_EmissionMapAtlas", emissionTexture); + _propertyBlock.SetInteger("_EmissionMapAtlasIndex", emissionAtlasPosition); + _propertyBlock.SetInteger("_EmissionMapAtlasSize", emissionAtlasSize); + } + + if (normalSuccess && normalTexture) { + _propertyBlock.SetTexture("_NormalMapAtlas", normalTexture); + _propertyBlock.SetInteger("_NormalMapAtlasIndex", normalAtlasPosition); + _propertyBlock.SetInteger("_NormalMapAtlasSize", normalAtlasSize); + } + + _propertyBlock.SetColor("_EmissionColor", emissionColor); + _propertyBlock.SetFloat("_NormalMapScale", normalIntensity); + _propertyBlock.SetColor("_MainTexColor", albedoColor); + + GetComponent().SetPropertyBlock(_propertyBlock); + } + } +} + diff --git a/Components/VRCBoardImageBasic.cs.meta b/Components/VRCBoardImageBasic.cs.meta new file mode 100644 index 0000000..85d859b --- /dev/null +++ b/Components/VRCBoardImageBasic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a8eb2bbd000b1341a20fd8188c3ef34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Materials/Editor.meta b/Materials/Editor.meta new file mode 100644 index 0000000..aeec0b3 --- /dev/null +++ b/Materials/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: beb1ece4e81f7d54481022aa41ad1214 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Materials/Editor/VRCBoardShaderEditor.cs b/Materials/Editor/VRCBoardShaderEditor.cs new file mode 100644 index 0000000..c09e56f --- /dev/null +++ b/Materials/Editor/VRCBoardShaderEditor.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UdonSharp; +using UnityEngine; +using UnityEditor; + +namespace VRCBoard +{ + [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] + public class VRCBoardShaderEditor : ShaderGUI + { + // Start is called before the first frame update + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) + { + EditorGUILayout.LabelField("Please use the VRCBoardImageBasic component to edit the material properties."); + //base.OnGUI(materialEditor, properties); + } + } + +} diff --git a/Materials/Editor/VRCBoardShaderEditor.cs.meta b/Materials/Editor/VRCBoardShaderEditor.cs.meta new file mode 100644 index 0000000..c05fa1c --- /dev/null +++ b/Materials/Editor/VRCBoardShaderEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 54050364012eda64b93ac4539faa4a15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Materials/VRCBoardImage.mat b/Materials/VRCBoardImage.mat index 06594aa..d24837d 100644 --- a/Materials/VRCBoardImage.mat +++ b/Materials/VRCBoardImage.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: VRCBoardImage - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: 8391ead9ad6feee41a7c2f7f6ccd5f81, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] diff --git a/Materials/VRCBoardImageShader.shader b/Materials/VRCBoardImageShader.shader new file mode 100644 index 0000000..36e1073 --- /dev/null +++ b/Materials/VRCBoardImageShader.shader @@ -0,0 +1,98 @@ +Shader "VRCBoard/VRCBoardAtlasShader" +{ + Properties + { + // _MainTex + _MainTexAtlas("Albedo", 2D) = "white" {} + [HideInInspector] _MainTexAtlasSize("Atlas Size", int) = 1 + [HideInInspector] _MainTexAtlasIndex("Atlas Position", int) = 0 + [HideInInspector] _MainTexColor("Color", Color) = (1,1,1,1) + + // _EmissionMap + _EmissionMapAtlas("Emission", 2D) = "black" {} + [HideInInspector] _EmissionMapAtlasSize("Emission Atlas Size", int) = 1 + [HideInInspector] _EmissionMapAtlasIndex("Emission Atlas Position", int) = 0 + [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1) + + // _NormalMap + _NormalMapAtlas("Normal", 2D) = "bump" {} + [HideInInspector] _NormalMapAtlasSize("Normal Atlas Size", int) = 1 + [HideInInspector] _NormalMapAtlasIndex("Normal Atlas Position", int) = 0 + [HideInInspector] _NormalMapScale("Normal Scale", float) = 1 + + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + + CGPROGRAM + #pragma surface surf Standard fullforwardshadows + + #pragma target 3.0 + + sampler2D _MainTexAtlas; + sampler2D _EmissionMapAtlas; + sampler2D _NormalMapAtlas; + + uint _MainTexAtlasSize; + uint _MainTexAtlasIndex; + float4 _MainTexColor; + + + uint _EmissionMapAtlasSize; + uint _EmissionMapAtlasIndex; + float4 _EmissionColor; + + uint _NormalMapAtlasSize; + uint _NormalMapAtlasIndex; + float _NormalMapScale; + + struct Input + { + float2 uv_MainTexAtlas; + float2 uv_EmissionMapAtlas; + float2 uv_NormalMapAtlas; + }; + + // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. + // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. + // #pragma instancing_options assumeuniformscaling + UNITY_INSTANCING_BUFFER_START(Props) + UNITY_INSTANCING_BUFFER_END(Props) + + void surf (Input IN, inout SurfaceOutputStandard o) + { + _MainTexAtlasIndex = _MainTexAtlasIndex+_MainTexAtlasSize; + _EmissionMapAtlasIndex = _EmissionMapAtlasIndex+_EmissionMapAtlasSize; + _NormalMapAtlasIndex = _NormalMapAtlasIndex+_NormalMapAtlasSize; + + float2 MainTexAtlasUV = float2( + (float(_MainTexAtlasIndex % _MainTexAtlasSize) + IN.uv_MainTexAtlas.x) / _MainTexAtlasSize, + 1.0 - (float(_MainTexAtlasIndex / _MainTexAtlasSize) - IN.uv_MainTexAtlas.y) / _MainTexAtlasSize + ); + + float2 EmissionMapAtlasUV = float2( + (float(_EmissionMapAtlasIndex % _EmissionMapAtlasSize) + IN.uv_EmissionMapAtlas.x) / _EmissionMapAtlasSize, + 1.0 - (float(_EmissionMapAtlasIndex / _EmissionMapAtlasSize) - IN.uv_EmissionMapAtlas.y) / _EmissionMapAtlasSize + ); + + float2 NormalMapAtlasUV = float2( + (float(_NormalMapAtlasIndex % _NormalMapAtlasSize) + IN.uv_NormalMapAtlas.x) / _NormalMapAtlasSize, + 1.0 - (float(_NormalMapAtlasIndex / _NormalMapAtlasSize) - IN.uv_NormalMapAtlas.y) / _NormalMapAtlasSize + ); + + + fixed4 c = tex2D (_MainTexAtlas, MainTexAtlasUV); + fixed4 e = tex2D (_EmissionMapAtlas, EmissionMapAtlasUV); + fixed4 n = tex2D (_NormalMapAtlas, NormalMapAtlasUV); + + o.Albedo = c.rgb * _MainTexColor.rgb; + o.Emission = e.rgb * _EmissionColor.rgb; + o.Normal = UnpackNormal(n); + } + ENDCG + } + FallBack "Diffuse" + CustomEditor "VRCBoard.VRCBoardShaderEditor" +} diff --git a/Materials/VRCBoardImageShader.shader.meta b/Materials/VRCBoardImageShader.shader.meta new file mode 100644 index 0000000..05427c5 --- /dev/null +++ b/Materials/VRCBoardImageShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8391ead9ad6feee41a7c2f7f6ccd5f81 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: