diff --git a/Runtime/CBIRPReflectionProbe.cs b/Runtime/CBIRPReflectionProbe.cs index 6e22375..931e7aa 100644 --- a/Runtime/CBIRPReflectionProbe.cs +++ b/Runtime/CBIRPReflectionProbe.cs @@ -1,8 +1,14 @@ - -using UdonSharp; +using UdonSharp; using UnityEngine; using VRC.SDKBase; using VRC.Udon; +using UdonSharpEditor; + +#if UNITY_EDITOR && !COMPILER_UDONSHARP +using UnityEditor; +using System.Collections; +using System.Collections.Generic; +#endif namespace CBIRP { @@ -56,8 +62,10 @@ void Start() public void UpdateProbe() { meshRenderer.sortingOrder = 128 - probe.importance; - - _propertyBlock = new MaterialPropertyBlock(); + if (_propertyBlock == null) + { + _propertyBlock = new MaterialPropertyBlock(); + } //float intensity = probe.textureHDRDecodeValues.x; _data0.x = probe.intensity; @@ -75,7 +83,13 @@ public void UpdateProbe() meshRenderer.SetPropertyBlock(_propertyBlock); } -#if UNITY_EDITOR +#if UNITY_EDITOR && !COMPILER_UDONSHARP + + private void Update() + { + Debug.Log("aaa"); + } + public void OnValidate() { if (!_initialized) @@ -89,4 +103,24 @@ public void OnValidate() } #endif } + +#if UNITY_EDITOR && !COMPILER_UDONSHARP + [CustomEditor(typeof(CBIRPReflectionProbe))] + public class CBIRPReflectionProbeEditor : Editor + { + public override void OnInspectorGUI() + { + if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return; + + base.OnInspectorGUI(); + + if (Application.isPlaying) + { + return; + } + var probe = (CBIRPReflectionProbe)target; + probe.UpdateProbe(); + } + } +#endif } \ No newline at end of file diff --git a/Shaders/CBIRP_Internal_Uniforms_Lights.mat b/Shaders/CBIRP_Internal_Uniforms_Lights.mat index ee25bcd..606d37e 100644 --- a/Shaders/CBIRP_Internal_Uniforms_Lights.mat +++ b/Shaders/CBIRP_Internal_Uniforms_Lights.mat @@ -20,5 +20,6 @@ Material: serializedVersion: 3 m_TexEnvs: [] m_Floats: + - _Clear: 0 - _ReflectionProbe: 0 m_Colors: [] diff --git a/Shaders/Standard.shader.meta b/Shaders/Standard.shader.meta index 3d07871..fa34a3f 100644 --- a/Shaders/Standard.shader.meta +++ b/Shaders/Standard.shader.meta @@ -8,7 +8,7 @@ ShaderImporter: - _MetallicGlossMap: {instanceID: 0} - _EmissionMap: {instanceID: 0} nonModifiableTextures: - - _DFG: {fileID: 2800000, guid: 3ce3b734ded22b244bb4e74ad36cd7a3, type: 3} + - _DFG: {fileID: 2800000, guid: 6c47db6712dbfed4cbf194607b81a12f, type: 3} - _Udon_CBIRP_Uniforms: {fileID: 8600000, guid: 2f0d588e7ddaa0e4db6e999fe9b6c088, type: 2} - _Udon_CBIRP_Culling: {fileID: 8600000, guid: d81d6aa0aa098cf41a9aa549d3913657, diff --git a/Shaders/dfg-multiscatter 1.exr b/Shaders/dfg-multiscatter 1.exr new file mode 100644 index 0000000..31e8c9d Binary files /dev/null and b/Shaders/dfg-multiscatter 1.exr differ diff --git a/Shaders/dfg-multiscatter 1.exr.meta b/Shaders/dfg-multiscatter 1.exr.meta new file mode 100644 index 0000000..94767f3 --- /dev/null +++ b/Shaders/dfg-multiscatter 1.exr.meta @@ -0,0 +1,116 @@ +fileFormatVersion: 2 +guid: 6c47db6712dbfed4cbf194607b81a12f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 0 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 3 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: