public void SaveCurrentToDefault() { deaultShowLightmapSettings = showLightmapSettings; defaultRealtimeGlobalIllumination = realtimeGlobalIllumination; defaultBakedGlobalIllumination = bakedGlobalIllumination; defaultLightmappingMode = lightmappingMode; defaultIndirectRelolution = indirectRelolution; defaultLightmapResolution = lightmapResolution; defaultLightmapPadding = lightmapPadding; defaultUseHighResolutionLightmapSize = useHighResolutionLightmapSize; defaultCompressLightmaps = compressLightmaps; defaultAmbientOcclusion = ambientOcclusion; defaultMaxDistance = maxDistance; defaultIndirectContribution = indirectContribution; defaultDirectContribution = directContribution; defaultUseDirectionalMode = useDirectionalMode; defaultLightIndirectIntensity = lightIndirectIntensity; defaultLightBoostIntensity = lightBoostIntensity; defaultFinalGather = finalGather; defaultFinalGatherRayCount = finalGatherRayCount; defaultFinalGatherDenoising = finalGatherDenoising; defaultAutoLightmapGeneration = autoLightmapGeneration; defaultReflectionProbeName = reflectionProbeName; defaultReflectionProbeSpawnType = reflectionProbeSpawnType; defaultReflectionProbeMode = reflectionProbeMode; defaultReflectionProbeRefresh = reflectionProbeRefresh; defaultReflectionCubemapCompression = reflectionCubemapCompression; defaultReflectionProbeTimeSlicingMode = reflectionProbeTimeSlicingMode; defaultReflectionProbeScale = reflectionProbeScale; defaultReflectionProbeOffset = reflectionProbeOffset; defaultReflectionProbesPerRow = reflectionProbesPerRow; defaultReflectionProbeClipPlaneDistance = reflectionProbeClipPlaneDistance; defaultReflectionProbeBlendDistance = reflectionProbeBlendDistance; defaultReflectionprobeCullingMask = reflectionprobeCullingMask; defaultReflectionProbeShadowDistance = reflectionProbeShadowDistance; defaultReflectionProbeResolution = reflectionProbeResolution; defaultLightProbesPerRow = lightProbesPerRow; defaultLightProbeSpawnType = lightProbeSpawnType; defaultLightProbeSpawnRadius = lightProbeSpawnRadius; defaultSeaLevel = seaLevel; #if UNITY_2018_3_OR_NEWER && UNITY_EDITOR defaultFilterMode = filterMode; #endif }
public void RevertToDefault() { showLightmapSettings = deaultShowLightmapSettings; realtimeGlobalIllumination = defaultRealtimeGlobalIllumination; bakedGlobalIllumination = defaultBakedGlobalIllumination; lightmappingMode = defaultLightmappingMode; indirectRelolution = defaultIndirectRelolution; lightmapResolution = defaultLightmapResolution; lightmapPadding = defaultLightmapPadding; useHighResolutionLightmapSize = defaultUseHighResolutionLightmapSize; compressLightmaps = defaultCompressLightmaps; ambientOcclusion = defaultAmbientOcclusion; maxDistance = defaultMaxDistance; indirectContribution = defaultIndirectContribution; directContribution = defaultDirectContribution; useDirectionalMode = defaultUseDirectionalMode; lightIndirectIntensity = defaultLightIndirectIntensity; lightBoostIntensity = defaultLightBoostIntensity; finalGather = defaultFinalGather; finalGatherRayCount = defaultFinalGatherRayCount; finalGatherDenoising = defaultFinalGatherDenoising; autoLightmapGeneration = defaultAutoLightmapGeneration; reflectionProbeName = defaultReflectionProbeName; reflectionProbeSpawnType = defaultReflectionProbeSpawnType; reflectionProbeMode = defaultReflectionProbeMode; reflectionProbeRefresh = defaultReflectionProbeRefresh; reflectionCubemapCompression = defaultReflectionCubemapCompression; reflectionProbeTimeSlicingMode = defaultReflectionProbeTimeSlicingMode; reflectionProbeScale = defaultReflectionProbeScale; reflectionProbeOffset = defaultReflectionProbeOffset; reflectionProbesPerRow = defaultReflectionProbesPerRow; reflectionProbeClipPlaneDistance = defaultReflectionProbeClipPlaneDistance; reflectionProbeBlendDistance = defaultReflectionProbeBlendDistance; reflectionprobeCullingMask = defaultReflectionprobeCullingMask; reflectionProbeShadowDistance = defaultReflectionProbeShadowDistance; reflectionProbeResolution = defaultReflectionProbeResolution; lightProbesPerRow = defaultLightProbesPerRow; lightProbeSpawnType = defaultLightProbeSpawnType; lightProbeSpawnRadius = defaultLightProbeSpawnRadius; seaLevel = defaultSeaLevel; #if UNITY_2018_3_OR_NEWER && UNITY_EDITOR filterMode = defaultFilterMode; #endif }
public ReflectionProbeSettings(ReflectionProbe probe) { this.mode = probe.mode; this.refreshMode = probe.refreshMode; this.timeSlicingMode = probe.timeSlicingMode; this.importance = probe.importance; this.intensity = probe.intensity; this.boxProjection = probe.boxProjection; this.blendDistance = probe.blendDistance; this.size = probe.size; this.center = probe.center; this.resolution = probe.resolution; this.hdr = probe.hdr; this.shadowDistance = probe.shadowDistance; this.clearFlags = probe.clearFlags; this.backgroundColor = probe.backgroundColor; this.cullingMask = probe.cullingMask; this.nearClipPlane = probe.nearClipPlane; this.farClipPlane = probe.farClipPlane; }
public void Initialize() { mode = ReflectionProbeMode.Realtime; refreshMode = ReflectionProbeRefreshMode.ViaScripting; timeSlicingMode = ReflectionProbeTimeSlicingMode.AllFacesAtOnce; importance = 1; intensity = 1; boxProjection = true; blendDistance = 50; size = Vector3.one * 100; center = Vector3.zero; resolution = 128; hdr = true; shadowDistance = 100; clearFlags = ReflectionProbeClearFlags.Skybox; backgroundColor = Color.black; cullingMask = -1; nearClipPlane = 0.3f; farClipPlane = 1000; }
public override bool OnInspectorGUI(Volume[] selectedVolumes) { System.Collections.Generic.IEnumerable <ReflectionProbeVolume> rpVolumes = selectedVolumes.Cast <ReflectionProbeVolume>(); bool invalidate = false; GUILayout.Label("Reflection Probe", "OL Title"); GUILayout.BeginVertical(); { EditorGUI.indentLevel = 1; GUILayout.BeginVertical("grey_border"); { GUILayout.Space(4); EditorGUILayout.LabelField("General Settings", EditorStyles.boldLabel); ReflectionProbeMode oldType; type = (ReflectionProbeMode)EditorGUILayout.EnumPopup("Type", oldType = type); if (oldType != type) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.type = type; } invalidate = true; } if (type == ReflectionProbeMode.Custom) { EditorGUILayout.HelpBox("Editing custom probes is currently not supported by volumes. This can be set manually on the volume component.", MessageType.Info); /* * bool oldDynamicObjects; * dynamicObjects = EditorGUILayout.Toggle( new GUIContent( "Dynamic Objects" ), oldDynamicObjects = dynamicObjects ); * if( oldDynamicObjects != dynamicObjects ) * { * foreach( ReflectionProbeVolume volume in rpVolumes ) * volume.dynamicObjects = dynamicObjects; * * invalidate = true; * } * * Cubemap oldCustomCube; * customCube = (Cubemap)EditorGUILayout.ObjectField( "Custom Cube", oldCustomCube = customCube, typeof( Cubemap ), false ); * if( oldCustomCube != customCube ) * { * foreach( ReflectionProbeVolume volume in rpVolumes ) * volume.customCube = customCube; * * invalidate = true; * } */ } if (type == ReflectionProbeMode.Realtime) { EditorGUI.indentLevel = 2; ReflectionProbeRefreshMode oldRefreshMode; refreshMode = (ReflectionProbeRefreshMode)EditorGUILayout.EnumPopup("Refresh Mode", oldRefreshMode = refreshMode); if (oldRefreshMode != refreshMode) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.refreshMode = refreshMode; } invalidate = true; } ReflectionProbeTimeSlicingMode oldTimeMode; timeMode = (ReflectionProbeTimeSlicingMode)EditorGUILayout.EnumPopup("Time Slicing", oldTimeMode = timeMode); if (oldTimeMode != timeMode) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.timeMode = timeMode; } invalidate = true; } EditorGUI.indentLevel = 1; } GUILayout.Space(4); } GUILayout.EndVertical(); GUILayout.BeginVertical("grey_border"); { GUILayout.Space(4); EditorGUILayout.LabelField("Runtime Settings", EditorStyles.boldLabel); int oldImportance; importance = EditorGUILayout.IntField("Importance", oldImportance = importance); if (oldImportance != importance) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.importance = importance; } invalidate = true; } float oldIntensity; intensity = EditorGUILayout.FloatField("Intensity", oldIntensity = intensity); if (oldIntensity != intensity) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.intensity = intensity; } invalidate = true; } bool oldBoxProj; boxProjection = EditorGUILayout.Toggle("Box Projection", oldBoxProj = boxProjection); if (oldBoxProj != boxProjection) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.boxProjection = boxProjection; } invalidate = true; } float oldBlendDist; blendDistance = EditorGUILayout.FloatField("Blend Distance", oldBlendDist = blendDistance); if (oldBlendDist != blendDistance) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.blendDistance = blendDistance; } invalidate = true; } EditorGUILayout.HelpBox("Size and origin is set by the volume", MessageType.Info); GUILayout.Space(4); } GUILayout.EndVertical(); GUILayout.BeginVertical("grey_border"); { GUILayout.Space(4); EditorGUILayout.LabelField("Cubemap Capture Settings", EditorStyles.boldLabel); ReflectionCubeResolution oldRes; resolution = (ReflectionCubeResolution)EditorGUILayout.EnumPopup("Resolution", oldRes = resolution); if (oldRes != resolution) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.resolution = resolution; } invalidate = true; } bool oldHDR; hdr = EditorGUILayout.Toggle("HDR", oldHDR = hdr); if (oldHDR != hdr) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.hdr = hdr; } invalidate = true; } float oldShadowDist; shadowDist = EditorGUILayout.FloatField("Shadow Distance", oldShadowDist = shadowDist); if (oldShadowDist != shadowDist) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.shadowDist = shadowDist; } invalidate = true; } ReflectionProbeClearFlags oldCFlags; clearFlags = (ReflectionProbeClearFlags)EditorGUILayout.EnumPopup("Clear Flags", oldCFlags = clearFlags); if (oldCFlags != clearFlags) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.clearFlags = clearFlags; } invalidate = true; } Color oldColor; background = EditorGUILayout.ColorField("Background", oldColor = background); if (oldColor != background) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.background = background; } invalidate = true; } LayerMask oldMask; cullingMask = SabreGUILayout.LayerMaskField(new GUIContent("Culling Mask"), oldMask = cullingMask); //EditorGUILayout.MaskField( "Culling Mask", oldMask = cullingMask ); if (oldMask != cullingMask) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.cullingMask = cullingMask; } invalidate = true; } Vector2 oldClip; clippingPlanes = EditorGUILayout.Vector2Field(new GUIContent("Clipping Planes", "X = Near, Y = Far"), oldClip = clippingPlanes); if (oldClip != clippingPlanes) { foreach (ReflectionProbeVolume volume in rpVolumes) { volume.clippingPlanes = clippingPlanes; } invalidate = true; } EditorGUILayout.HelpBox("Occlusion is currently not supported by volumes. This can be set on the volume component.", MessageType.Info); GUILayout.Space(4); } GUILayout.EndVertical(); if (type == ReflectionProbeMode.Custom) { EditorGUILayout.HelpBox("This probe is set to Custom, and is not handled by volumes.", MessageType.Info); } else if (type == ReflectionProbeMode.Realtime) { EditorGUILayout.HelpBox("This probe is set to Realtime, and its baking is handled by unity. The results are stored in the GI Cache.", MessageType.Info); } EditorGUI.indentLevel = 0; } GUILayout.EndVertical(); return(invalidate); }