Commit 73e9da08 authored by 18신대성's avatar 18신대성 Committed by 18손재민

Volumetric Light 카메라랑 플레이어에 적용

parent 7f35e799
......@@ -1346,7 +1346,7 @@ Transform:
- {fileID: 494213313239497179}
- {fileID: 7259129854443835404}
- {fileID: 5896328348636738805}
- {fileID: 6898176959538870970}
- {fileID: 8595559763684514445}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -1441,7 +1441,7 @@ MonoBehaviour:
anim: {fileID: 0}
currentFloor: {fileID: 0}
selectPointer: {fileID: 6250617794677575084}
aimLight: {fileID: 1841943088953102479}
aimLight: {fileID: 2401818891807728848}
--- !u!1 &494213313239918029
GameObject:
m_ObjectHideFlags: 0
......@@ -2493,7 +2493,38 @@ Transform:
m_Father: {fileID: 494213313239497109}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: -0.43300003, y: 180.887, z: 116.005005}
--- !u!1 &2393636697257586900
--- !u!1 &3233955354714130270
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7259129854443835404}
m_Layer: 8
m_Name: Head
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7259129854443835404
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3233955354714130270}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.723, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 494213313239497139}
m_Father: {fileID: 494213313239497131}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &3282366221125495561
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
......@@ -2501,22 +2532,25 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6898176959538870970}
- component: {fileID: 1841943088953102479}
- component: {fileID: 8595559763684514445}
- component: {fileID: 2283781400988830345}
- component: {fileID: 3848187736642518088}
- component: {fileID: 886384046876709786}
- component: {fileID: 2401818891807728848}
m_Layer: 8
m_Name: Spot Light
m_Name: V-Light Spot 0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &6898176959538870970
--- !u!4 &8595559763684514445
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2393636697257586900}
m_GameObject: {fileID: 3282366221125495561}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
......@@ -2524,97 +2558,207 @@ Transform:
m_Father: {fileID: 494213313239497131}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!108 &1841943088953102479
Light:
--- !u!20 &2283781400988830345
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2393636697257586900}
m_Enabled: 1
serializedVersion: 9
m_Type: 0
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_Intensity: 0
m_Range: 2.5
m_SpotAngle: 60
m_InnerSpotAngle: 1
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_GameObject: {fileID: 3282366221125495561}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 1}
m_projectionMatrixMode: 0
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.1
far clip plane: 5
field of view: 45
orthographic: 0
orthographic size: 2.5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!1 &3233955354714130270
GameObject:
m_Bits: 2147483375
m_RenderingPath: 0
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!33 &3848187736642518088
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7259129854443835404}
m_Layer: 8
m_Name: Head
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7259129854443835404
Transform:
m_GameObject: {fileID: 3282366221125495561}
m_Mesh: {fileID: 0}
--- !u!23 &886384046876709786
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3233955354714130270}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.723, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 494213313239497139}
m_Father: {fileID: 494213313239497131}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_GameObject: {fileID: 3282366221125495561}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!114 &2401818891807728848
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3282366221125495561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b1e5529f2795e6344b38c49382e29006, type: 3}
m_Name:
m_EditorClassIdentifier:
lockTransforms: 0
renderWireFrame: 0
lightType: 0
lightMultiplier: 0
spotExponent: 20
constantAttenuation: 1
linearAttenuation: 10
quadraticAttenuation: 100
aspect: 1
slices: 40
colorTint: {r: 1, g: 0, b: 0, a: 1}
noiseSpeed: {x: 0, y: 0, z: 0}
useDithering: 1
ditherAmount: 0.5
useSoftBlend: 0
useCurves: 0
worldScrollAmount: 0
shadowMode: 1
shadowMapRes: 128
shadowBlurPasses: 0
shadowBlurSize: 1
renderFullShadows: 0
_renderShadowMapInUpdate: 0
spotRange: 5
spotNear: 0.1
spotAngle: 60
orthoSize: 0.5
spotEmission: {fileID: 0}
spotNoise: {fileID: 0}
spotShadow: {fileID: 0}
pointLightRadius: 1
pointEmission: {fileID: 0}
pointNoise: {fileID: 0}
pointShadow: {fileID: 0}
areaVolume: {fileID: 0}
volumeShape: 0
shapeValue: 0
volumeTextureOffset: {x: 0, y: 0, z: 0}
volumeTextureScale: 0.5
lightGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 0, g: 0, b: 0, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumAlphaKeys: 2
fallOffCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
_boundsCentreOffset: {x: 0, y: 0, z: 0}
_fallOffTexture: {fileID: 0}
spotMaterial: {fileID: 2100000, guid: 0ae03080a8dadc6448d3d12b54ed4f3c, type: 2}
pointMaterial: {fileID: 2100000, guid: dd36a29b2d153244ba3d06d8217c876c, type: 2}
areaMaterial: {fileID: 2100000, guid: 3d9186b180a5843f8810c59a305735cf, type: 2}
orthoMaterial: {fileID: 2100000, guid: 5c70705a1fd5647609ad8326ef5e2024, type: 2}
renderDepthShader: {fileID: 4800000, guid: 26c171c785261784f8909aae5f3697e4, type: 3}
meshContainer: {fileID: 0}
--- !u!1 &4293599007436274797
GameObject:
m_ObjectHideFlags: 0
......
This diff is collapsed.
......@@ -26,7 +26,7 @@ RenderSettings:
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 2100000, guid: 1d3f5254e25764546b2211aa1dd32efe, type: 2}
m_SkyboxMaterial: {fileID: 2100000, guid: 36f9d35b500106b42b6a47c516bf7b38, type: 2}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.6918458, g: 0.28275156, b: 0.1380949, a: 1}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -795,6 +795,16 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_Name
value: GameManager
objectReference: {fileID: 0}
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2122327709, guid: 42247a938bb6e554eb00dc08303a72d6, type: 3}
propertyPath: uiGenerator
value:
......@@ -811,16 +821,6 @@ PrefabInstance:
propertyPath: bulletUIGenerator
value:
objectReference: {fileID: 158856773}
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_Name
value: GameManager
objectReference: {fileID: 0}
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalPosition.x
......
......@@ -21,7 +21,7 @@ public class Player : MonoBehaviour
public Floor currentFloor;
public GameObject selectPointer;
public Light aimLight;
public VLight aimLight;
/// <summary>
/// Set this player as the current player.
......@@ -98,12 +98,12 @@ public class Player : MonoBehaviour
while (time <= endTime)
{
yield return null;
aimLight.intensity += 15 * Time.deltaTime;
aimLight.lightMultiplier += 3 * Time.deltaTime;
aimLight.spotAngle -= 30 * Time.deltaTime;
time = Time.time;
if (!Input.GetMouseButton(0))
{
aimLight.intensity = 0;
aimLight.lightMultiplier = 0;
aimLight.spotAngle = 60;
aimLight.gameObject.SetActive(false);
break;
......@@ -111,7 +111,7 @@ public class Player : MonoBehaviour
}
if (time > endTime)
{
aimLight.intensity = 0;
aimLight.lightMultiplier = 0;
aimLight.spotAngle = 60;
aimLight.gameObject.SetActive(false);
GameManager.inst.isPlayerShooting = true;
......
fileFormatVersion: 2
guid: a1f8c5c3c944233449ec13b38a151f0c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f07db13dfb0673e428689dd9f747fbeb
folderAsset: yes
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: d68a0c63c6822405babcf015ebad85af
NativeFormatImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: 20abb5400351b3c48ba2701629ee9bc4
NativeFormatImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: 11ac7a8957849e549a52d805defa40d4
NativeFormatImporter:
userData:
fileFormatVersion: 2
guid: 023a07862b8e93349a6d30a9463eba7f
folderAsset: yes
DefaultImporter:
userData:
using UnityEditor;
using UnityEngine;
/*
* VLight
* Copyright Brian Su 2011-2019
*/
public class VolumeLightAbout : EditorWindow
{
private Texture _logoImage;
[MenuItem("Help/About V-Lights...", false, 1010)]
private static void Init()
{
VolumeLightAbout window = EditorWindow.CreateInstance<VolumeLightAbout>();
window.ShowUtility();
#if UNITY_5 || UNITY_2017 || UNITY_2018 || UNITY_2019
window.titleContent = new GUIContent("About V-Lights");
#else
window.title = "About V-Lights";
#endif
}
private void OnGUI()
{
GUILayout.BeginHorizontal();
GUILayout.Space(20);
GUILayout.BeginVertical();
if (_logoImage == null)
{
_logoImage = Resources.Load("VLights/Logo") as Texture;
}
GUI.DrawTexture(new Rect(-60, -64, 256, 256), _logoImage);
GUILayout.Space(64);
GUILayout.FlexibleSpace();
GUILayout.Label("Version 1.3");
GUILayout.FlexibleSpace();
GUILayout.Label("(c) 2011-2019 Brian Su");
GUILayout.EndVertical();
GUILayout.EndHorizontal();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 5b65a7549f135594a9058468c2d0c22c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using UnityEditor;
/*
* VLight
* Copyright Brian Su 2011-2019
*/
public class VolumeLightCreator : EditorWindow
{
[MenuItem("GameObject/Create Other/V-Lights Volume Area (Beta)", false, 100)]
public static void Area()
{
if (ShowWarning())
{
var volumeLightContainer = CreateVolumeLight(VLight.LightTypes.Area);
Selection.activeGameObject = volumeLightContainer.gameObject;
volumeLightContainer.transform.rotation = Quaternion.identity;
Undo.RegisterCreatedObjectUndo(volumeLightContainer, "V-Lights Create Volume Area (Beta)");
}
}
[MenuItem("GameObject/Create Other/V-Lights Spot", false, 100)]
public static void StandardLight()
{
if (ShowWarning())
{
var volumeLightContainer = CreateVolumeLight(VLight.LightTypes.Spot);
Selection.activeGameObject = volumeLightContainer.gameObject;
Undo.RegisterCreatedObjectUndo(volumeLightContainer, "V-Lights Create Light");
}
}
[MenuItem("GameObject/Create Other/V-Lights Spot With Light", false, 100)]
public static void SpotWithLight()
{
if (ShowWarning())
{
var volumeLightContainer = CreateVolumeLight(VLight.LightTypes.Spot);
var pointLight = new GameObject("Spot light");
var light = pointLight.AddComponent<Light>();
light.shadows = LightShadows.Soft;
light.type = LightType.Spot;
light.spotAngle = 45;
light.range = 6;
pointLight.transform.parent = volumeLightContainer.transform;
pointLight.transform.localPosition = Vector3.zero;
pointLight.transform.Rotate(90, 0, 0);
Selection.activeGameObject = volumeLightContainer.gameObject;
Undo.RegisterCreatedObjectUndo(volumeLightContainer, "V-Lights Create Light");
Undo.RegisterCreatedObjectUndo(pointLight, "V-Lights Create Light");
}
}
[MenuItem("GameObject/Create Other/V-Lights Point", false, 100)]
public static void PointLight()
{
if (ShowWarning())
{
var volumeLightContainer = CreateVolumeLight(VLight.LightTypes.Point);
Selection.activeGameObject = volumeLightContainer.gameObject;
Undo.RegisterCreatedObjectUndo(volumeLightContainer, "V-Lights Create Light");
}
}
[MenuItem("GameObject/Create Other/V-Lights Point With Light", false, 100)]
public static void PointWithLight()
{
if (ShowWarning())
{
var volumeLightContainer = CreateVolumeLight(VLight.LightTypes.Point);
var pointLight = new GameObject("Point light");
var light = pointLight.AddComponent<Light>();
light.shadows = LightShadows.Soft;
light.type = LightType.Point;
light.spotAngle = 45;
light.range = 6;
pointLight.transform.parent = volumeLightContainer.transform;
pointLight.transform.localPosition = Vector3.zero;
Selection.activeGameObject = volumeLightContainer.gameObject;
Undo.RegisterCreatedObjectUndo(volumeLightContainer, "V-Lights Create Light");
Undo.RegisterCreatedObjectUndo(pointLight, "V-Lights Create Light");
}
}
[MenuItem("GameObject/Create Other/V-Lights Orthographic", false, 100)]
public static void OrthographicLight()
{
if (ShowWarning())
{
var volumeLightContainer = CreateVolumeLight(VLight.LightTypes.Orthographic);
Selection.activeGameObject = volumeLightContainer.gameObject;
Undo.RegisterCreatedObjectUndo(volumeLightContainer, "V-Lights Create Orthographic Light");
}
}
private static VLight CreateVolumeLight(VLight.LightTypes type)
{
var otherLights = GameObject.FindObjectsOfType(typeof(VLight)) as VLight[];
var volumeLightContainer = new GameObject("V-Light " + type + " " + otherLights.Length);
if (SceneView.lastActiveSceneView != null)
{
SceneView.lastActiveSceneView.MoveToView(volumeLightContainer.transform);
}
var light = volumeLightContainer.AddComponent<VLight>();
var cam = volumeLightContainer.GetComponent<Camera>();
cam.enabled = false;
cam.fieldOfView = 45;
cam.nearClipPlane = 0.1f;
cam.farClipPlane = 1;
cam.renderingPath = RenderingPath.VertexLit;
cam.orthographicSize = 2.5f;
switch (type)
{
case VLight.LightTypes.Spot:
light.spotRange = 1;
light.lightType = VLight.LightTypes.Spot;
break;
case VLight.LightTypes.Point:
cam.orthographic = true;
cam.nearClipPlane = -cam.farClipPlane;
cam.orthographicSize = cam.farClipPlane * 2;
light.pointLightRadius = 1;
light.lightType = VLight.LightTypes.Point;
break;
case VLight.LightTypes.Area:
cam.orthographic = true;
cam.nearClipPlane = -cam.farClipPlane;
cam.orthographicSize = cam.farClipPlane * 2;
light.pointLightRadius = 1;
light.lightType = VLight.LightTypes.Area;
light.lightMultiplier = 0.05f;
light.pointLightRadius = 2.0f;
break;
case VLight.LightTypes.Orthographic:
cam.orthographic = true;
cam.nearClipPlane = 0;
cam.farClipPlane = 2;
light.spotRange = 2;
light.lightType = VLight.LightTypes.Orthographic;
light.orthoSize = 0.5f;
break;
}
var layer = LayerMask.NameToLayer(VLightManager.VOLUMETRIC_LIGHT_LAYER_NAME);
if (layer != -1)
{
volumeLightContainer.layer = layer;
cam.cullingMask = ~(1 << layer);
}
volumeLightContainer.transform.Rotate(90, 0, 0);
return light;
}
private static bool ShowWarning()
{
bool continueAfterWarning = true;
if (LayerMask.NameToLayer(VLightManager.VOLUMETRIC_LIGHT_LAYER_NAME) == -1)
{
continueAfterWarning = EditorUtility.DisplayDialog("Warning",
"You don't have a layer in your project called\n\"" + VLightManager.VOLUMETRIC_LIGHT_LAYER_NAME + "\".\n" +
"Without this layer realtime shadows, interleaved sampling and high speed off screen rendering will not work. Continue using volumetric lights?", "Continue", "Cancel");
}
return continueAfterWarning;
}
}
fileFormatVersion: 2
guid: 55b4949bb89ea9640a2fd9c208fcc90e
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEditor;
/*
* VLight
* Copyright Brian Su 2011-2019
*/
[CustomEditor(typeof(VLightManager))]
public class VolumeLightManagerEditor : Editor
{
public VLightManager Manager
{
get { return target as VLightManager; }
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 16df8e95234c7be489d87db4f65b894c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using UnityEditor;
/*
* VLight
* Copyright Brian Su 2011-2019
*/
[CustomEditor(typeof(VLight))]
[CanEditMultipleObjects]
public class VolumeLightSlicedBasedEditor : Editor
{
public VLight Light
{
get { return target as VLight; }
}
public override void OnInspectorGUI()
{
Light.MeshRender.hideFlags = HideFlags.None;
var property = serializedObject.FindProperty("renderWireFrame");
property.boolValue = GUILayout.Toggle(property.boolValue, "Render wireframe");
EditorUtility.SetSelectedRenderState(Light.MeshRender, property.boolValue ? EditorSelectedRenderState.Wireframe : EditorSelectedRenderState.Hidden);
serializedObject.ApplyModifiedProperties();
base.OnInspectorGUI();
GUILayout.Space(20);
var curvesProp = serializedObject.FindProperty("useCurves");
if(curvesProp.boolValue)
{
GUILayout.Label("Falloff gradient");
var tex = serializedObject.FindProperty("_fallOffTexture");
if(tex.objectReferenceValue != null)
{
var rect = GUILayoutUtility.GetRect(100, 100);
GUI.DrawTexture(rect, tex.objectReferenceValue as Texture2D);
}
}
GUILayout.Label("Generate a baked shadow map");
if(GUILayout.Button("Bake shadow map", GUILayout.Width(200)))
{
Light.RenderBakedShadowMap();
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 656ea40d6798eab499e146d617f423e1
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: e3247d39b7252244995e7dbb1b2eee57
folderAsset: yes
DefaultImporter:
userData:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: VLights Default Area
m_Shader: {fileID: 4800000, guid: 31813853d68d3484491c0955535404e8, type: 3}
m_ShaderKeywords:
- VLIGHT_USE_CURVE_OFF
- _SHAPE_CUBE
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs: {}
m_Floats:
data:
first:
name: _Shape
second: 0
data:
first:
name: _VolumeParams
second: .5
m_Colors:
data:
first:
name: _VolumeOffset
second: {r: 0, g: 0, b: 0, a: .5}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
fileFormatVersion: 2
guid: 3d9186b180a5843f8810c59a305735cf
NativeFormatImporter:
userData:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: VLights Default Light
m_Shader: {fileID: 4800000, guid: 6aac0894b3c1e44529fc89af12517e0f, type: 3}
m_ShaderKeywords:
- _VLIGHTSETTINGS_SHADOWEDCURVE
- _VLIGHTSETTINGS_CURVE_SHADOW
- VLIGHTSETTING_CURVE
- SHADOW_ENABLED
- VLIGHT_USE_CURVE
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _ShadowTexture
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Dither
second: 0
data:
first:
name: _Shadow
second: 0
data:
first:
name: _Curve
second: 0
m_Colors: {}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
fileFormatVersion: 2
guid: 0ae03080a8dadc6448d3d12b54ed4f3c
NativeFormatImporter:
userData:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: VLights Default Orthographic
m_Shader: {fileID: 4800000, guid: a580fe83e417a4fc282ecdb374837af8, type: 3}
m_ShaderKeywords: SHADOW_ENABLED VLIGHTSETTING_CURVE VLIGHT_USE_CURVE _VLIGHTSETTINGS_CURVE_SHADOW
_VLIGHTSETTINGS_SHADOWEDCURVE
m_LightmapFlags: 5
m_CustomRenderQueue: 3000
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _ShadowTexture
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Dither
second: 0
data:
first:
name: _Shadow
second: 0
data:
first:
name: _Curve
second: 0
data:
first:
name: _InvFade
second: 1
m_Colors: {}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
fileFormatVersion: 2
guid: 5c70705a1fd5647609ad8326ef5e2024
timeCreated: 1463140865
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: VLights Default Point Light
m_Shader: {fileID: 4800000, guid: fba27a6fca09246dab46cfb730cd71b2, type: 3}
m_ShaderKeywords:
- VLIGHT_USE_CURVE
- _SHADOW_OFF
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _ShadowTexture
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Dither
second: 0
data:
first:
name: _Shadow
second: 0
data:
first:
name: _Curve
second: 0
m_Colors: {}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
fileFormatVersion: 2
guid: dd36a29b2d153244ba3d06d8217c876c
NativeFormatImporter:
userData:
Thanks for purchasing VLights volumetric lights.
**NOTE**
This package requires that you set a new layer called "vlight" in your scene to use the interleaved sampling effect.
The layer name can be changed by modifying VLightManager.cs VOLUMETRIC_LIGHT_LAYER_NAME variable.
**NOTE**
If you are using water4 please remove vlight later from the PlanarReflection script for best results.
Updates
10/3/2019
Now free
Upgraded to unity 2017 and 2018
7/2/2018
Deprecated JS code
Fixed shadow mapping
21/11/2017
Long overdue update
Fix for VR displays
Unity 2017 Fixes
3/11/2016
Fixed some unity 5.4 warnings
Added shadowmap support for iOS
Added high precision floating point frame buffer
9/6/2016
Fixed shaders getting stripped.
15/5/2016
Orthographic Light sources
Fixed spot light clipping
Fixed point light shadows
Aspect ratio for non uniform lights
14/4/2016
Fixed scene selection bug in Unity 5.3.4
3/02/2016
Added in experimental bilateral filtering with depth aware upsampling.
Fixes for Unity Water 4 recursive rendering
Interleaved sampling optimisations
Speed tree shadows
Unity 5 is the minimum version now
18/10/2015
Fixed dither in linear light
Fixed shadow baking
Unity 4.6.9 min
Added world space offset of noise
Fixes for UFPS
08/06/2015
Added in curve based attenuation.
Added in area volumes.
Improved performance by removing update loop.
You can now bake shadow maps in the editor.
Complete redo of editor.
Fixed up some memory leaks with rendertextures.
Added in dithered sampling to improve qualty without post effects.
Refactored some code.
16/03/2015
Fixed some shader compiler errors in Unity 5. Added in some more context help.
03/03/2015
Unity 5.0 fixes
28/05/2014
Fixed 4.5 shader compiler errors
15/03/2014
Support for multiple cameras. Removed need for camera tags. Fixed some shader referencing bugs.
31/10/2013
dx11 shader fixes
25/9/2013
-Fixed memory leak on Unity 4.2. Optimised performance. Added in workaround to RenderPath.Vertexlit RenderWithShader crash bug on Unity.
1/8/2013
-Fixed interleaved sampling in Unity 4.2.
25/7/2013
-Cleaned up the material properties.
-All shaders now use a version 2 of the shader.
-This should automatically switch if you are upgrading.
-Fixed some null reference exceptions when upgrading.
-Fixed deferred rendering flag again:(
18/7/2013 This is a major update so I suggest backing up your project before upgrading.
-Option to turn off wireframe
-Improved blur using horizontal/vertical guassian blur. Blur steps are now in texel sizes
-Gave option to only use blur and not interleaved sampling
-Removed manual depth buffer
-All shaders are now only 2.0
-Cleaned up vlight editor
-All parameters except texture settings are done on the script
-Multi-editing is supported. Light manager editor is deprecated
-Lights can now be prefabs
23/4/2013 Fixed interleaved sampling posteffect when using skyboxes in 4.1 new renderwithshader.
14/4/2013 Fixed interleaved sampling again Unity 4.1 Set the depth flags using an OR flag to prevent messing with any other
depth effects. Also fixed cameras that have non-standard projection matricies.
17/3/2013 Fixed interleaved sampling in Unity 4.1. Seem like deferred rendering no longer support _CameraDepthTexture.
Reverted to 3.5 as the min version.
9/12/2012 Compiler fixes for dx11
21/11/2012 Compiler fixes to unity 4.0
Compatible with linear and gamma space color in unity 3.5
Added in experimental section
Flickering fixed
Not necessary to use the bounding box hack.
VLights allows you to create realtime volumetric lights in Unity.
Simply click GameObject -> Create Other -> VLight type to create a new light.
For details on customizing your light click Help -> V-Lights
Visit
http://vlights-system.blogspot.com/
for more information.
Support can be contacted at brianvlights@gmail.com
fileFormatVersion: 2
guid: 25f1dc6bdbdfc481589b6de77adf96ca
TextScriptImporter:
userData:
fileFormatVersion: 2
guid: 24ed739f68a96e245b0f08841a42e55f
folderAsset: yes
DefaultImporter:
userData:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b4e8ef830ce004097be4377a328c8778, type: 3}
m_Name: VLight Shader Library
m_EditorClassIdentifier:
_shaders:
- {fileID: 4800000, guid: 6aac0894b3c1e44529fc89af12517e0f, type: 3}
- {fileID: 4800000, guid: 31813853d68d3484491c0955535404e8, type: 3}
- {fileID: 4800000, guid: a580fe83e417a4fc282ecdb374837af8, type: 3}
- {fileID: 4800000, guid: fba27a6fca09246dab46cfb730cd71b2, type: 3}
fileFormatVersion: 2
guid: 7747d300c01744201b6feaaa4716d88b
timeCreated: 1468025833
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0d1ce01046d02744ca94178a3152e3ba
folderAsset: yes
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: 37f22541fdf8e7544b73693fad89040a
NativeFormatImporter:
userData:
fileFormatVersion: 2
guid: 3d8cc38162427b846b37a1e6379b5b6e
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
fileFormatVersion: 2
guid: 3eca692084c96504c98d4704671e86a1
folderAsset: yes
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: dd8485350cfb544c694366b31a6470f9
timeCreated: 1468643418
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 33aecc28af498476d8738bb1581039be
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: bf05a9ffc06b5c64ea4eba604fcaf133
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: fdb75e06270298e4f8fdff49ab43a9a0
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: aa8354999612446eebb239c3a4c7f265
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: c9dfc95c146b37849ba2111c20a4137d
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: 5c22d234f2d184ac2ad854979d6376d6
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: a06076f3929a5cd4fba837965c578eec
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: dbd204c3a13ced04da0429dc4b2a50f6
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: b30a7f071d2e743fbb24803200e1367e
timeCreated: 1468559503
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a76ca2802e52ffa4caeda3ef202dbb81
folderAsset: yes
DefaultImporter:
userData:
fileFormatVersion: 2
guid: 141c32265547a834ab54569b57613b9b
folderAsset: yes
DefaultImporter:
userData:
using UnityEngine;
public class MouseOrbitDemo : MonoBehaviour
{
//Copied from the standard assets and renamed to MouseOrbitDemo to avoid any conflicts. Feel free to delete this file.
public Transform target = null;
public float distance = 8.0f;
public float xSpeed = 250.0f;
public float ySpeed = 120.0f;
public float yMinLimit = -90f;
public float yMaxLimit = 90f;
private float x = 0.0f;
private float y = 0.0f;
private void Start ()
{
var angles = transform.eulerAngles;
x = angles.y;
y = angles.x;
// Make the rigid body not change rotation
if (GetComponent<Rigidbody> ())
GetComponent<Rigidbody> ().freezeRotation = true;
}
private void LateUpdate ()
{
if (target)
{
x += Input.GetAxis ("Mouse X") * xSpeed * 0.02f;
y -= Input.GetAxis ("Mouse Y") * ySpeed * 0.02f;
y = ClampAngle (y, yMinLimit, yMaxLimit);
var rotation = Quaternion.Euler (y, x, 0);
var position = rotation * new Vector3 (0.0f, 0.0f, -distance) + target.position;
transform.rotation = rotation;
transform.position = position;
}
}
private static float ClampAngle (float angle, float min, float max)
{
if (angle < -360)
angle += 360;
if (angle > 360)
angle -= 360;
return Mathf.Clamp (angle, min, max);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 6d060dfa9bd40cf4eb63db528444cd34
timeCreated: 1518000026
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d30870c9f73b87441975da666aa21741
folderAsset: yes
DefaultImporter:
userData:
fileFormatVersion: 2
guid: 315cc901cafd14c4887450a160c2ec3f
timeCreated: 1455530095
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences:
- postEffectShader: {fileID: 4800000, guid: 591bcfb596f3c0b45877be2dae7d5425, type: 3}
- volumeLightShader: {fileID: 4800000, guid: aface9889da643e4e9c581d463a53cd0, type: 3}
- _downScaleDepthShader: {fileID: 4800000, guid: 0d3008434efc14e968d55bd7784df9e2,
type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e566b5d2eaff68943adba1ad98bb02b6
folderAsset: yes
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: 42e47d623531f476db5467f9e2a16e87
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
namespace com.brian.vlights
{
// [CreateAssetMenuAttribute]
public class ShaderLibrary : ScriptableObject
{
[SerializeField]
private Shader[] _shaders;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: b4e8ef830ce004097be4377a328c8778
timeCreated: 1468025752
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 05cc03959b79b435d999777514117908
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using UnityEngine;
using System.Collections;
/*
* VLight
* Copyright Brian Su 2011-2019
*/
namespace VLights
{
public static class VLightShaderUtil
{
public const string POST_SHADER_NAME = "Hidden/V-Light/Post";
public const string DEPTH_SHADER_NAME = "V-Light/Volumetric Light Depth";
public const string INTERLEAVED_SHADER_NAME = "V-Light/Volumetric Light Depth";
public const string DOWNSCALEDEPTH_SHADER_NAME = "Hidden/V-Light/Downscale Depth";
}
}
fileFormatVersion: 2
guid: fbc4aa8e73d734b6a8b0a518c19323d3
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: b1ed9fbeb82d12840b30f1ac437f6007
folderAsset: yes
DefaultImporter:
userData:
This diff is collapsed.
fileFormatVersion: 2
guid: b1e5529f2795e6344b38c49382e29006
labels:
- light
- volumetric
- shadow
- realtime
- effect
- fx
- volume
- lighting
timeCreated: 1463140884
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences:
- spotEmission: {instanceID: 0}
- spotNoise: {instanceID: 0}
- spotShadow: {instanceID: 0}
- pointEmission: {instanceID: 0}
- pointNoise: {instanceID: 0}
- pointShadow: {instanceID: 0}
- areaVolume: {instanceID: 0}
- _fallOffTexture: {instanceID: 0}
- _ditherTexture: {instanceID: 0}
- spotMaterial: {fileID: 2100000, guid: 0ae03080a8dadc6448d3d12b54ed4f3c, type: 2}
- pointMaterial: {fileID: 2100000, guid: dd36a29b2d153244ba3d06d8217c876c, type: 2}
- areaMaterial: {fileID: 2100000, guid: 3d9186b180a5843f8810c59a305735cf, type: 2}
- orthoMaterial: {fileID: 2100000, guid: 5c70705a1fd5647609ad8326ef5e2024, type: 2}
- renderDepthShader: {fileID: 4800000, guid: 26c171c785261784f8909aae5f3697e4, type: 3}
- meshContainer: {instanceID: 0}
executionOrder: 200
icon: {fileID: 808945810, guid: 0000000000000000d000000000000000, type: 2}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: 2a0716bd323620d4183ceda78db9bce3
folderAsset: yes
DefaultImporter:
userData:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment