├── .gitignore ├── Assets ├── Resources.meta ├── Resources │ ├── DOTweenSettings.asset │ ├── DOTweenSettings.asset.meta │ ├── Material.meta │ ├── Material │ │ ├── Normal.mat │ │ ├── Normal.mat.meta │ │ ├── RayScreen.mat │ │ ├── RayScreen.mat.meta │ │ ├── Skybox_Sunset.mat │ │ ├── Skybox_Sunset.mat.meta │ │ ├── color.mat │ │ └── color.mat.meta │ ├── Model.meta │ ├── Model │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── No Name.mat │ │ │ └── No Name.mat.meta │ │ ├── Pyramid.FBX │ │ ├── Pyramid.FBX.meta │ │ ├── Trillion.FBX │ │ ├── Trillion.FBX.meta │ │ ├── diamond.FBX │ │ └── diamond.FBX.meta │ ├── Script.meta │ ├── Script │ │ ├── CameraLookController.cs │ │ ├── CameraLookController.cs.meta │ │ ├── MagicCircle.cs │ │ ├── MagicCircle.cs.meta │ │ ├── OnFocus.cs │ │ ├── OnFocus.cs.meta │ │ ├── RayTrace.cs │ │ ├── RayTrace.cs.meta │ │ ├── TweenTransform.cs │ │ └── TweenTransform.cs.meta │ ├── Shader.meta │ ├── Shader │ │ ├── RayTracing.shader │ │ ├── RayTracing.shader.meta │ │ ├── WorldNormal.shader │ │ └── WorldNormal.shader.meta │ ├── Texture.meta │ ├── Texture │ │ ├── MagicCricle.png │ │ ├── MagicCricle.png.meta │ │ ├── preview.png │ │ ├── preview.png.meta │ │ ├── sunset.hdr │ │ └── sunset.hdr.meta │ ├── plugin.meta │ └── plugin │ │ ├── DOTween.meta │ │ └── DOTween │ │ ├── DOTween.XML │ │ ├── DOTween.XML.meta │ │ ├── DOTween.dll │ │ ├── DOTween.dll.mdb │ │ ├── DOTween.dll.mdb.meta │ │ ├── DOTween.dll.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── DOTweenEditor.XML │ │ ├── DOTweenEditor.XML.meta │ │ ├── DOTweenEditor.dll │ │ ├── DOTweenEditor.dll.mdb │ │ ├── DOTweenEditor.dll.mdb.meta │ │ ├── DOTweenEditor.dll.meta │ │ ├── Imgs.meta │ │ └── Imgs │ │ │ ├── DOTweenIcon.png │ │ │ ├── DOTweenIcon.png.meta │ │ │ ├── Footer.png │ │ │ ├── Footer.png.meta │ │ │ ├── Footer_dark.png │ │ │ ├── Footer_dark.png.meta │ │ │ ├── Header.jpg │ │ │ └── Header.jpg.meta │ │ ├── Modules.meta │ │ ├── Modules │ │ ├── DOTweenModuleAudio.cs │ │ ├── DOTweenModuleAudio.cs.meta │ │ ├── DOTweenModulePhysics.cs │ │ ├── DOTweenModulePhysics.cs.meta │ │ ├── DOTweenModulePhysics2D.cs │ │ ├── DOTweenModulePhysics2D.cs.meta │ │ ├── DOTweenModuleSprite.cs │ │ ├── DOTweenModuleSprite.cs.meta │ │ ├── DOTweenModuleUI.cs │ │ ├── DOTweenModuleUI.cs.meta │ │ ├── DOTweenModuleUnityVersion.cs │ │ ├── DOTweenModuleUnityVersion.cs.meta │ │ ├── DOTweenModuleUtils.cs │ │ └── DOTweenModuleUtils.cs.meta │ │ ├── readme.txt │ │ └── readme.txt.meta ├── Scenes.meta ├── Scenes │ ├── RayTrace.meta │ ├── RayTrace.unity │ ├── RayTrace.unity.meta │ └── RayTrace │ │ ├── LightingData.asset │ │ ├── LightingData.asset.meta │ │ ├── ReflectionProbe-0.exr │ │ └── ReflectionProbe-0.exr.meta ├── Standard Assets.meta └── Standard Assets │ ├── Editor.meta │ ├── Editor │ ├── ImageEffects.meta │ └── ImageEffects │ │ ├── BloomAndFlaresEditor.cs │ │ ├── BloomAndFlaresEditor.cs.meta │ │ ├── BloomEditor.cs │ │ └── BloomEditor.cs.meta │ ├── Effects.meta │ └── Effects │ ├── ImageEffects.meta │ └── ImageEffects │ ├── Scripts.meta │ ├── Scripts │ ├── Bloom.cs │ ├── Bloom.cs.meta │ ├── BloomAndFlares.cs │ ├── BloomAndFlares.cs.meta │ ├── BloomOptimized.cs │ ├── BloomOptimized.cs.meta │ ├── PostEffectsBase.cs │ ├── PostEffectsBase.cs.meta │ ├── PostEffectsHelper.cs │ └── PostEffectsHelper.cs.meta │ ├── Shaders.meta │ └── Shaders │ ├── _BloomAndFlares.meta │ └── _BloomAndFlares │ ├── Blend.shader │ ├── Blend.shader.meta │ ├── BlendForBloom.shader │ ├── BlendForBloom.shader.meta │ ├── BlendOneOne.shader │ ├── BlendOneOne.shader.meta │ ├── BlurAndFlares.shader │ ├── BlurAndFlares.shader.meta │ ├── BrightPassFilter.shader │ ├── BrightPassFilter.shader.meta │ ├── BrightPassFilter2.shader │ ├── BrightPassFilter2.shader.meta │ ├── LensFlareCreate.shader │ ├── LensFlareCreate.shader.meta │ ├── MobileBloom.shader │ ├── MobileBloom.shader.meta │ ├── MobileBlur.shader │ ├── MobileBlur.shader.meta │ ├── MultiPassHollywoodFlares.shader │ ├── MultiPassHollywoodFlares.shader.meta │ ├── SeparableBlurPlus.shader │ ├── SeparableBlurPlus.shader.meta │ ├── VignetteShader.shader │ └── VignetteShader.shader.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── SimpleRayTracing.gif /.gitignore: -------------------------------------------------------------------------------- 1 | !*.dll 2 | [Ll]ibrary/ 3 | [Tt]emp/ 4 | [Oo]bj/ 5 | [Bb]uild/ 6 | [Bb]uilds/ 7 | [Pp]rojectSettings/ProjectVersion.txt 8 | 9 | # Autogenerated VS/MD solution and project files 10 | *.csproj 11 | *.unityproj 12 | *.sln 13 | *.suo 14 | *.tmp 15 | *.user 16 | *.userprefs 17 | *.pidb 18 | *.booproj 19 | *.svd 20 | 21 | # Unity3D Generated File On Crash Reports 22 | sysinfo.txt 23 | 24 | *.apk 25 | *.unitypackage 26 | Packages/ 27 | .vs/ 28 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dedc92bf9a1af034cb83e9ec2b92a3b0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/DOTweenSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 16995157, guid: a811bde74b26b53498b4f6d872b09b6d, type: 3} 12 | m_Name: DOTweenSettings 13 | m_EditorClassIdentifier: 14 | useSafeMode: 1 15 | timeScale: 1 16 | useSmoothDeltaTime: 0 17 | maxSmoothUnscaledTime: 0.15 18 | rewindCallbackMode: 0 19 | showUnityEditorReport: 0 20 | logBehaviour: 0 21 | drawGizmos: 1 22 | defaultRecyclable: 0 23 | defaultAutoPlay: 3 24 | defaultUpdateType: 0 25 | defaultTimeScaleIndependent: 0 26 | defaultEaseType: 6 27 | defaultEaseOvershootOrAmplitude: 1.70158 28 | defaultEasePeriod: 0 29 | defaultAutoKill: 1 30 | defaultLoopType: 0 31 | storeSettingsLocation: 0 32 | modules: 33 | showPanel: 0 34 | audioEnabled: 1 35 | physicsEnabled: 1 36 | physics2DEnabled: 1 37 | spriteEnabled: 1 38 | uiEnabled: 1 39 | textMeshProEnabled: 0 40 | tk2DEnabled: 0 41 | showPlayingTweens: 0 42 | showPausedTweens: 0 43 | -------------------------------------------------------------------------------- /Assets/Resources/DOTweenSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d44a5ab616107464385af90124d4c888 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Material.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7031bb02160d7d45bdf2e20c15c2dfd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Material/Normal.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Normal 10 | m_Shader: {fileID: 4800000, guid: a944b64df3e77ca49bd401e171baff25, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 1, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/Resources/Material/Normal.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e208218cd5e1a9c4b8dc3b5c94ee6d36 3 | timeCreated: 1533118723 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Material/RayScreen.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: RayScreen 10 | m_Shader: {fileID: 4800000, guid: 7d12a802f9f379442b744ed874278ad2, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MagicTexture: 42 | m_Texture: {fileID: 2800000, guid: 305644a6a0097ef4294871787adc69f3, type: 3} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MainTex: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _MetallicGlossMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _OcclusionMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _ParallaxMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - _SkyBox: 62 | m_Texture: {fileID: 8900000, guid: 656a59a5ff93c46498416d97e5c16b66, type: 3} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | m_Floats: 66 | - _BumpScale: 1 67 | - _Cutoff: 0.5 68 | - _DetailNormalMapScale: 1 69 | - _DstBlend: 0 70 | - _GlossMapScale: 1 71 | - _Glossiness: 0.5 72 | - _GlossyReflections: 1 73 | - _Metallic: 0 74 | - _Mode: 0 75 | - _OcclusionStrength: 1 76 | - _Parallax: 0.02 77 | - _SmoothnessTextureChannel: 0 78 | - _SpecularHighlights: 1 79 | - _SrcBlend: 1 80 | - _UVSec: 0 81 | - _ZWrite: 1 82 | m_Colors: 83 | - _Color: {r: 1, g: 1, b: 1, a: 1} 84 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 85 | - _HdrColor: {r: 8.63612, g: 24.420319, b: 28.167034, a: 1} 86 | - _MainColor: {r: 1, g: 1, b: 1, a: 1} 87 | - _ReflectedColor: {r: 0.7075472, g: 0.678023, b: 0.630785, a: 1} 88 | - _RefractedColor: {r: 0.78039217, g: 1, b: 0.92919105, a: 1} 89 | -------------------------------------------------------------------------------- /Assets/Resources/Material/RayScreen.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7d4cc1c7ef7eed419acfa7c6799fbe6 3 | timeCreated: 1531881192 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Material/Skybox_Sunset.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Skybox_Sunset 10 | m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: 1000 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _Tex: 58 | m_Texture: {fileID: 8900000, guid: 656a59a5ff93c46498416d97e5c16b66, type: 3} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | m_Floats: 62 | - _BumpScale: 1 63 | - _Cutoff: 0.5 64 | - _DetailNormalMapScale: 1 65 | - _DstBlend: 0 66 | - _Exposure: 1.3 67 | - _Glossiness: 0.5 68 | - _Metallic: 0 69 | - _Mode: 0 70 | - _OcclusionStrength: 1 71 | - _Parallax: 0.02 72 | - _Rotation: 0 73 | - _SrcBlend: 1 74 | - _UVSec: 0 75 | - _ZWrite: 1 76 | m_Colors: 77 | - _Color: {r: 1, g: 1, b: 1, a: 1} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | - _Tint: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0.5} 80 | -------------------------------------------------------------------------------- /Assets/Resources/Material/Skybox_Sunset.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4067de1a02072244798361060c5e7325 3 | timeCreated: 1461296179 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Material/color.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: color 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 1, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/Resources/Material/color.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50eb08c2d670a7b48b052c34acacafce 3 | timeCreated: 1532068576 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Model.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e683c7c4e4de3d94c9ec559938519945 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Model/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efbb38b5990a7e14d96e58663ca94ecb 3 | folderAsset: yes 4 | timeCreated: 1538110573 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Model/Materials/No Name.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: No Name 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 1, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/Resources/Model/Materials/No Name.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b847147cf35491e4898b2014553e6b40 3 | timeCreated: 1538110573 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Model/Pyramid.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/Model/Pyramid.FBX -------------------------------------------------------------------------------- /Assets/Resources/Model/Pyramid.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30d4adc77626b054a9c773c86732ca0d 3 | ModelImporter: 4 | serializedVersion: 22 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2100000: No Name 9 | 2300000: //RootNode 10 | 3300000: //RootNode 11 | 4300000: Pyramid 12 | externalObjects: {} 13 | materials: 14 | importMaterials: 1 15 | materialName: 0 16 | materialSearch: 1 17 | materialLocation: 1 18 | animations: 19 | legacyGenerateAnimations: 4 20 | bakeSimulation: 0 21 | resampleCurves: 1 22 | optimizeGameObjects: 0 23 | motionNodeName: 24 | rigImportErrors: 25 | rigImportWarnings: 26 | animationImportErrors: 27 | animationImportWarnings: 28 | animationRetargetingWarnings: 29 | animationDoRetargetingWarnings: 0 30 | importAnimatedCustomProperties: 0 31 | importConstraints: 0 32 | animationCompression: 1 33 | animationRotationError: 0.5 34 | animationPositionError: 0.5 35 | animationScaleError: 0.5 36 | animationWrapMode: 0 37 | extraExposedTransformPaths: [] 38 | extraUserProperties: [] 39 | clipAnimations: [] 40 | isReadable: 1 41 | meshes: 42 | lODScreenPercentages: [] 43 | globalScale: 1 44 | meshCompression: 0 45 | addColliders: 0 46 | importVisibility: 1 47 | importBlendShapes: 1 48 | importCameras: 1 49 | importLights: 1 50 | swapUVChannels: 0 51 | generateSecondaryUV: 0 52 | useFileUnits: 1 53 | optimizeMeshForGPU: 1 54 | keepQuads: 0 55 | weldVertices: 1 56 | preserveHierarchy: 0 57 | indexFormat: 0 58 | secondaryUVAngleDistortion: 8 59 | secondaryUVAreaDistortion: 15.000001 60 | secondaryUVHardAngle: 88 61 | secondaryUVPackMargin: 4 62 | useFileScale: 1 63 | tangentSpace: 64 | normalSmoothAngle: 60 65 | normalImportMode: 0 66 | tangentImportMode: 3 67 | normalCalculationMode: 4 68 | importAnimation: 1 69 | copyAvatar: 0 70 | humanDescription: 71 | serializedVersion: 2 72 | human: [] 73 | skeleton: [] 74 | armTwist: 0.5 75 | foreArmTwist: 0.5 76 | upperLegTwist: 0.5 77 | legTwist: 0.5 78 | armStretch: 0.05 79 | legStretch: 0.05 80 | feetSpacing: 0 81 | rootMotionBoneName: 82 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 83 | hasTranslationDoF: 0 84 | hasExtraRoot: 0 85 | skeletonHasParents: 1 86 | lastHumanDescriptionAvatarSource: {instanceID: 0} 87 | animationType: 0 88 | humanoidOversampling: 1 89 | additionalBone: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Assets/Resources/Model/Trillion.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/Model/Trillion.FBX -------------------------------------------------------------------------------- /Assets/Resources/Model/Trillion.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a7794cf5a422ad45bcfdb9a61829028 3 | ModelImporter: 4 | serializedVersion: 22 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2100000: No Name 9 | 2300000: //RootNode 10 | 3300000: //RootNode 11 | 4300000: Trillion 12 | externalObjects: {} 13 | materials: 14 | importMaterials: 1 15 | materialName: 0 16 | materialSearch: 1 17 | materialLocation: 1 18 | animations: 19 | legacyGenerateAnimations: 4 20 | bakeSimulation: 0 21 | resampleCurves: 1 22 | optimizeGameObjects: 0 23 | motionNodeName: 24 | rigImportErrors: 25 | rigImportWarnings: 26 | animationImportErrors: 27 | animationImportWarnings: 28 | animationRetargetingWarnings: 29 | animationDoRetargetingWarnings: 0 30 | importAnimatedCustomProperties: 0 31 | importConstraints: 0 32 | animationCompression: 1 33 | animationRotationError: 0.5 34 | animationPositionError: 0.5 35 | animationScaleError: 0.5 36 | animationWrapMode: 0 37 | extraExposedTransformPaths: [] 38 | extraUserProperties: [] 39 | clipAnimations: [] 40 | isReadable: 1 41 | meshes: 42 | lODScreenPercentages: [] 43 | globalScale: 1 44 | meshCompression: 0 45 | addColliders: 0 46 | importVisibility: 1 47 | importBlendShapes: 1 48 | importCameras: 1 49 | importLights: 1 50 | swapUVChannels: 0 51 | generateSecondaryUV: 0 52 | useFileUnits: 1 53 | optimizeMeshForGPU: 1 54 | keepQuads: 0 55 | weldVertices: 1 56 | preserveHierarchy: 0 57 | indexFormat: 0 58 | secondaryUVAngleDistortion: 8 59 | secondaryUVAreaDistortion: 15.000001 60 | secondaryUVHardAngle: 88 61 | secondaryUVPackMargin: 4 62 | useFileScale: 1 63 | tangentSpace: 64 | normalSmoothAngle: 60 65 | normalImportMode: 0 66 | tangentImportMode: 3 67 | normalCalculationMode: 4 68 | importAnimation: 1 69 | copyAvatar: 0 70 | humanDescription: 71 | serializedVersion: 2 72 | human: [] 73 | skeleton: [] 74 | armTwist: 0.5 75 | foreArmTwist: 0.5 76 | upperLegTwist: 0.5 77 | legTwist: 0.5 78 | armStretch: 0.05 79 | legStretch: 0.05 80 | feetSpacing: 0 81 | rootMotionBoneName: 82 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 83 | hasTranslationDoF: 0 84 | hasExtraRoot: 0 85 | skeletonHasParents: 1 86 | lastHumanDescriptionAvatarSource: {instanceID: 0} 87 | animationType: 0 88 | humanoidOversampling: 1 89 | additionalBone: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Assets/Resources/Model/diamond.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/Model/diamond.FBX -------------------------------------------------------------------------------- /Assets/Resources/Model/diamond.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fddab39dbb661d34dbaf2d5307e4ee76 3 | ModelImporter: 4 | serializedVersion: 22 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2100000: No Name 9 | 2300000: //RootNode 10 | 3300000: //RootNode 11 | 4300000: NGon001 12 | 4300002: Diamond 13 | externalObjects: {} 14 | materials: 15 | importMaterials: 1 16 | materialName: 0 17 | materialSearch: 1 18 | materialLocation: 1 19 | animations: 20 | legacyGenerateAnimations: 4 21 | bakeSimulation: 0 22 | resampleCurves: 1 23 | optimizeGameObjects: 0 24 | motionNodeName: 25 | rigImportErrors: 26 | rigImportWarnings: 27 | animationImportErrors: 28 | animationImportWarnings: 29 | animationRetargetingWarnings: 30 | animationDoRetargetingWarnings: 0 31 | importAnimatedCustomProperties: 0 32 | importConstraints: 0 33 | animationCompression: 1 34 | animationRotationError: 0.5 35 | animationPositionError: 0.5 36 | animationScaleError: 0.5 37 | animationWrapMode: 0 38 | extraExposedTransformPaths: [] 39 | extraUserProperties: [] 40 | clipAnimations: [] 41 | isReadable: 1 42 | meshes: 43 | lODScreenPercentages: [] 44 | globalScale: 1 45 | meshCompression: 0 46 | addColliders: 0 47 | importVisibility: 1 48 | importBlendShapes: 1 49 | importCameras: 1 50 | importLights: 1 51 | swapUVChannels: 0 52 | generateSecondaryUV: 0 53 | useFileUnits: 1 54 | optimizeMeshForGPU: 1 55 | keepQuads: 0 56 | weldVertices: 1 57 | preserveHierarchy: 0 58 | indexFormat: 0 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVPackMargin: 4 63 | useFileScale: 1 64 | tangentSpace: 65 | normalSmoothAngle: 60 66 | normalImportMode: 0 67 | tangentImportMode: 3 68 | normalCalculationMode: 4 69 | importAnimation: 1 70 | copyAvatar: 0 71 | humanDescription: 72 | serializedVersion: 2 73 | human: [] 74 | skeleton: [] 75 | armTwist: 0.5 76 | foreArmTwist: 0.5 77 | upperLegTwist: 0.5 78 | legTwist: 0.5 79 | armStretch: 0.05 80 | legStretch: 0.05 81 | feetSpacing: 0 82 | rootMotionBoneName: 83 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 84 | hasTranslationDoF: 0 85 | hasExtraRoot: 0 86 | skeletonHasParents: 1 87 | lastHumanDescriptionAvatarSource: {instanceID: 0} 88 | animationType: 0 89 | humanoidOversampling: 1 90 | additionalBone: 0 91 | userData: 92 | assetBundleName: 93 | assetBundleVariant: 94 | -------------------------------------------------------------------------------- /Assets/Resources/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9947ccd5d9ab7549ba8973fc704d719 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Script/CameraLookController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.SceneManagement; 5 | using UnityEngine.UI; 6 | using DG.Tweening; 7 | 8 | // 响应鼠标点击和拖拽,控制摄像机缩放旋转 9 | public class CameraLookController : MonoBehaviour 10 | { 11 | public List TargetList; 12 | 13 | public List CameraPosList; 14 | 15 | public float LerpSpeed; 16 | 17 | public float RotateDrag; 18 | 19 | private Vector3 LookPos, DesirePos; 20 | 21 | public int CurGoIndex = 0; 22 | 23 | public float Sensitivity = 100; 24 | 25 | Vector2 RotateSpeed; 26 | 27 | float Distance; 28 | 29 | Vector2 LastPos = Vector2.zero; 30 | 31 | public bool FreeMode = false; 32 | 33 | public float TempTime; 34 | 35 | public Image Bg; 36 | 37 | Vector3 dampSpeed; 38 | 39 | float DoubleTouchLastDis; 40 | 41 | void Start() 42 | { 43 | LookPos = TargetList[CurGoIndex].transform.position; 44 | DesirePos = CameraPosList[CurGoIndex].transform.position; 45 | Distance = Vector3.Distance(DesirePos, LookPos); 46 | //Screen.SetResolution(1440,810,true); 47 | } 48 | 49 | void Update() 50 | { 51 | if(FreeMode) 52 | { 53 | CheckPickUp(); 54 | 55 | CaculateRotate(); 56 | } 57 | else 58 | { 59 | TempTime += Time.deltaTime; 60 | 61 | if (TempTime > 1) 62 | { 63 | FreeMode = true; 64 | 65 | LookPos = TargetList[CurGoIndex].transform.position; 66 | 67 | DesirePos = CameraPosList[CurGoIndex].transform.position; 68 | 69 | Distance = Vector3.Distance(DesirePos, LookPos); 70 | } 71 | 72 | Vector3 lookPos = SmoothStep(LookPos, TargetList[CurGoIndex].transform.position, TempTime); 73 | 74 | Vector3 desirePos = SmoothStep(DesirePos, CameraPosList[CurGoIndex].transform.position, TempTime); 75 | 76 | transform.position = desirePos; 77 | 78 | transform.LookAt(lookPos); 79 | } 80 | } 81 | 82 | void CheckPickUp() 83 | { 84 | if(Input.GetMouseButtonDown(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began)) 85 | { 86 | RaycastHit hit = new RaycastHit(); 87 | Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); 88 | if (Physics.Raycast(ray, out hit, Mathf.Infinity)) 89 | { 90 | GameObject go = hit.collider.gameObject; 91 | if(go.tag != "IgnoreCast" && TargetList.Contains(go)) 92 | { 93 | if(CurGoIndex != TargetList.IndexOf(go)) 94 | { 95 | TargetList[CurGoIndex].BroadcastMessage("OnCancleSelect", SendMessageOptions.DontRequireReceiver); 96 | 97 | go.BroadcastMessage("OnSelect"); 98 | 99 | CurGoIndex = TargetList.IndexOf(go); 100 | 101 | FreeMode = false; 102 | 103 | TempTime = 0; 104 | 105 | DesirePos = transform.position; 106 | 107 | RotateSpeed = Vector2.zero; 108 | } 109 | } 110 | } 111 | 112 | } 113 | } 114 | 115 | Vector3 SmoothStep(Vector3 from, Vector3 to, float lerpTime) 116 | { 117 | Vector3 vec; 118 | vec.x = Mathf.SmoothStep(from.x, to.x, lerpTime); 119 | vec.y = Mathf.SmoothStep(from.y, to.y, lerpTime); 120 | vec.z = Mathf.SmoothStep(from.z, to.z, lerpTime); 121 | 122 | return vec; 123 | } 124 | 125 | void CaculateRotate() 126 | { 127 | if (Input.GetMouseButton(0) || (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Moved)) 128 | { 129 | Vector2 pos = Input.mousePosition; 130 | 131 | if (LastPos.Equals(Vector2.zero)) 132 | LastPos = pos; 133 | 134 | Vector2 move = pos - LastPos; 135 | 136 | //if (move.magnitude > 400) 137 | //Debug.Log("Error"); 138 | 139 | LastPos = pos; 140 | 141 | RotateSpeed += move * Time.deltaTime; 142 | } 143 | else 144 | { 145 | LastPos = Vector2.zero; 146 | } 147 | 148 | if (RotateSpeed.magnitude - RotateDrag * Time.deltaTime > 0.1f) 149 | { 150 | float scale = (RotateSpeed.magnitude - RotateDrag * Time.deltaTime) / RotateSpeed.magnitude; 151 | 152 | RotateSpeed.Scale(Vector2.one * scale); 153 | } 154 | else 155 | RotateSpeed = Vector2.zero; 156 | 157 | Vector3 eulerAngles = transform.eulerAngles; 158 | 159 | eulerAngles.y += RotateSpeed.x; 160 | eulerAngles.x = Mathf.Clamp(eulerAngles.x - RotateSpeed.y, 1, 80); 161 | 162 | transform.eulerAngles = eulerAngles; 163 | 164 | float zoom = 1; 165 | 166 | if(Input.touchCount >= 2) 167 | { 168 | Touch touch1 = Input.GetTouch(0); 169 | Touch touch2 = Input.GetTouch(1); 170 | 171 | float doubleTouchCurrDis = Vector2.Distance(touch1.position, touch2.position); 172 | 173 | if (DoubleTouchLastDis == 0) 174 | DoubleTouchLastDis = doubleTouchCurrDis; 175 | 176 | zoom = DoubleTouchLastDis / doubleTouchCurrDis; 177 | 178 | DoubleTouchLastDis = doubleTouchCurrDis; 179 | } 180 | else 181 | { 182 | DoubleTouchLastDis = 0; 183 | } 184 | 185 | Distance *= (1 - Input.GetAxis("Mouse ScrollWheel")) * zoom; 186 | 187 | transform.position = LookPos + -transform.forward * Distance; 188 | } 189 | 190 | public void OnBtnClick() 191 | { 192 | Bg.DOFade(1,1f); 193 | 194 | Invoke("SwitchToScene",1f); 195 | } 196 | 197 | void SwitchToScene() 198 | { 199 | SceneManager.LoadScene("NieOcean"); 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /Assets/Resources/Script/CameraLookController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 050a6594bd969e54d977c89972fda34e 3 | timeCreated: 1533286626 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Resources/Script/MagicCircle.cs: -------------------------------------------------------------------------------- 1 | using DG.Tweening; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | // 控制魔法阵渐入渐出动画 7 | public class MagicCircle : MonoBehaviour 8 | { 9 | public RayTrace rayTrace; 10 | 11 | void OnSelect() 12 | { 13 | DOTween.To(()=> rayTrace.MagicAlpha, a => rayTrace.MagicAlpha = a, 0.2f, 1); 14 | var t = DOTween.To(() => rayTrace.MagicAlpha, a => rayTrace.MagicAlpha = a, 1, 1); 15 | t.SetDelay(1); 16 | } 17 | 18 | void OnCancleSelect() 19 | { 20 | DOTween.To(() => rayTrace.MagicAlpha, a => rayTrace.MagicAlpha = a, 0, 2); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Resources/Script/MagicCircle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 060a2d75608a5ff4aa1d4c898554517f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/Script/OnFocus.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using DG.Tweening; 6 | 7 | // 物体旋转动画 8 | public class OnFocus : MonoBehaviour 9 | { 10 | public Vector3 FocusAngle; 11 | 12 | bool AutoRotateFlag; 13 | 14 | void OnSelect () 15 | { 16 | GetComponent().isKinematic = true; 17 | transform.DORotate(FocusAngle, 1); 18 | Vector3 pos = transform.position; 19 | pos.y = 1; 20 | transform.DOMove(pos, 1); 21 | AutoRotateFlag = true; 22 | StartCoroutine(AutoRotate()); 23 | } 24 | 25 | IEnumerator AutoRotate() 26 | { 27 | yield return new WaitForSeconds(1); 28 | 29 | float time = Time.time; 30 | Vector3 eulerAngles = transform.eulerAngles; 31 | while (AutoRotateFlag) 32 | { 33 | float t = Time.time - time; 34 | 35 | Vector3 angle; 36 | if(gameObject.name == "Diamond") 37 | { 38 | angle = new Vector3(Mathf.Sin(t / 12f) * 360f, Mathf.Sin(t / 10f) * 540f, Mathf.Sin(t / 8f) * 360f); 39 | } 40 | else 41 | { 42 | angle = new Vector3(0f, t * 360f / 6, 0f); 43 | } 44 | 45 | 46 | transform.eulerAngles = eulerAngles + angle; 47 | yield return null; 48 | } 49 | } 50 | 51 | void OnCancleSelect () 52 | { 53 | GetComponent().isKinematic = false; 54 | AutoRotateFlag = false; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Resources/Script/OnFocus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c046c86ee35b2d4a82547bd575bfc9f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/Script/RayTrace.cs: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 IceDust 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | */ 8 | 9 | using UnityEngine; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | 13 | [ExecuteInEditMode] 14 | public class RayTrace : MonoBehaviour 15 | { 16 | public List Models; 17 | 18 | public Material material; 19 | 20 | public Light PointLight; 21 | 22 | public Transform MagicCricle; 23 | 24 | private List BoundingSpere; 25 | 26 | public float MagicAlpha; 27 | 28 | void OnEnable() 29 | { 30 | CaculateBoundingSpere(); 31 | } 32 | 33 | void OnRenderImage(RenderTexture src, RenderTexture dst) 34 | { 35 | Graphics.Blit(src,dst, material); 36 | } 37 | 38 | void Update() 39 | { 40 | if (material) 41 | { 42 | SetRenderData(); 43 | } 44 | } 45 | 46 | /// 47 | /// 设置材质数据 48 | /// 49 | void SetRenderData() 50 | { 51 | List list = new List(); 52 | 53 | int count = 0; 54 | foreach (GameObject model in Models) 55 | { 56 | Matrix4x4 localToWorldMatrix = model.transform.localToWorldMatrix; 57 | 58 | Mesh mesh = model.GetComponent().sharedMesh; 59 | 60 | Vector3 origin = localToWorldMatrix.MultiplyPoint((Vector3)BoundingSpere[count]); 61 | 62 | list.Add(new Vector4(origin.x, origin.y, origin.z, BoundingSpere[count].w * model.transform.lossyScale.x)); //加入包围球数据 63 | 64 | list.Add(new Vector4(mesh.triangles.Length, 0)); //加入顶点长度数据 65 | 66 | count++; 67 | 68 | for (int i = 0; i < mesh.triangles.Length; i++) //材质数据 69 | { 70 | Vector4 vec = localToWorldMatrix.MultiplyPoint(mesh.vertices[mesh.triangles[i]]); 71 | 72 | if (model.name == "Quad") 73 | vec.w = 1; 74 | 75 | if (model.name == "Trillion") 76 | vec.w = 2; 77 | 78 | if (model.name == "Pyramid") 79 | vec.w = 3; 80 | 81 | if (model.name == "HdrPyramid") 82 | vec.w = 4; 83 | 84 | list.Add(vec); 85 | 86 | } 87 | } 88 | 89 | material.SetVectorArray("_Vertices", list); 90 | 91 | material.SetVector("_LightPos", PointLight.transform.position); 92 | 93 | material.SetVector("_MagicOrigin", MagicCricle.position); 94 | 95 | material.SetFloat("_MagicAlpha", MagicAlpha); 96 | } 97 | 98 | /// 99 | /// 计算所有几何体的包围球 100 | /// 101 | void CaculateBoundingSpere() 102 | { 103 | BoundingSpere = new List(); 104 | foreach (GameObject model in Models) 105 | { 106 | Mesh mesh = model.GetComponent().sharedMesh; 107 | float maxX = -Mathf.Infinity, maxY = -Mathf.Infinity, maxZ = -Mathf.Infinity, minX = Mathf.Infinity, minY = Mathf.Infinity, minZ = Mathf.Infinity; 108 | 109 | foreach (var vert in mesh.vertices) 110 | { 111 | if (vert.x > maxX) maxX = vert.x; 112 | if (vert.y > maxY) maxY = vert.y; 113 | if (vert.z > maxZ) maxZ = vert.z; 114 | if (vert.x < minX) minX = vert.x; 115 | if (vert.y < minY) minY = vert.y; 116 | if (vert.z < minZ) minZ = vert.z; 117 | } 118 | 119 | float x = maxX - minX; 120 | float y = maxY - minY; 121 | float z = maxZ - minZ; 122 | 123 | Vector3 origin = new Vector3(0.5f * (maxX + minX), 0.5f * (maxY + minY), 0.5f * (maxZ + minZ)); 124 | 125 | float r = x > y ? x * 0.5f : y * 0.5f; 126 | r = r > z ? r : z * 0.5f; 127 | 128 | foreach (var vert in mesh.vertices) 129 | { 130 | if (Vector3.Distance(vert, origin) > r) 131 | r = Vector3.Distance(vert, origin); 132 | } 133 | BoundingSpere.Add(new Vector4(origin.x, origin.y, origin.z, r)); 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /Assets/Resources/Script/RayTrace.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dba6400dd1ec61f4bb9919752386dbbc 3 | timeCreated: 1508918515 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Resources/Script/TweenTransform.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class TweenTransform : MonoBehaviour { 6 | 7 | public float RotateSpeed; 8 | 9 | 10 | void Start () 11 | { 12 | 13 | } 14 | 15 | void Update () 16 | { 17 | transform.RotateAround(transform.position, Vector3.up, RotateSpeed * Time.deltaTime); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/Resources/Script/TweenTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b1b89cba70ea724ab076f65b6ae3958 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 093614e360449fb43bc702ab8d97190d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Shader/RayTracing.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d12a802f9f379442b744ed874278ad2 3 | timeCreated: 1531724926 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Shader/WorldNormal.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/WorldNormal" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | } 7 | SubShader 8 | { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 100 11 | Cull Off 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | // make fog work 19 | #pragma multi_compile_fog 20 | #include "UnityCG.cginc" 21 | 22 | struct appdata 23 | { 24 | float4 vertex : POSITION; 25 | float2 uv : TEXCOORD0; 26 | float3 normal : NORMAL; 27 | }; 28 | 29 | struct v2f 30 | { 31 | float2 uv : TEXCOORD0; 32 | UNITY_FOG_COORDS(1) 33 | float4 vertex : SV_POSITION; 34 | float3 worldNormal : TEXCOORD2; 35 | }; 36 | 37 | sampler2D _MainTex; 38 | float4 _MainTex_ST; 39 | 40 | v2f vert (appdata v) 41 | { 42 | v2f o; 43 | o.vertex = UnityObjectToClipPos(v.vertex); 44 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 45 | o.worldNormal = UnityObjectToWorldNormal(v.normal); 46 | UNITY_TRANSFER_FOG(o,o.vertex); 47 | return o; 48 | } 49 | 50 | fixed4 frag (v2f i) : SV_Target 51 | { 52 | // sample the texture 53 | fixed4 col = float4(i.worldNormal,1); 54 | return col; 55 | } 56 | ENDCG 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Resources/Shader/WorldNormal.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a944b64df3e77ca49bd401e171baff25 3 | timeCreated: 1533118737 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Texture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7adf5b61ee10d8744b393c5f8838798e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/MagicCricle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/Texture/MagicCricle.png -------------------------------------------------------------------------------- /Assets/Resources/Texture/MagicCricle.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 305644a6a0097ef4294871787adc69f3 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 4 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | sRGBTexture: 1 10 | linearTexture: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: 0.25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 6 23 | cubemapConvolution: 0 24 | seamlessCubemap: 0 25 | textureFormat: 1 26 | maxTextureSize: 2048 27 | textureSettings: 28 | filterMode: -1 29 | aniso: -1 30 | mipBias: -1 31 | wrapMode: 1 32 | nPOTScale: 1 33 | lightmap: 0 34 | compressionQuality: 50 35 | spriteMode: 0 36 | spriteExtrude: 1 37 | spriteMeshType: 1 38 | alignment: 0 39 | spritePivot: {x: 0.5, y: 0.5} 40 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 41 | spritePixelsToUnits: 100 42 | alphaUsage: 1 43 | alphaIsTransparency: 0 44 | spriteTessellationDetail: -1 45 | textureType: 0 46 | textureShape: 1 47 | maxTextureSizeSet: 0 48 | compressionQualitySet: 0 49 | textureFormatSet: 0 50 | platformSettings: 51 | - buildTarget: DefaultTexturePlatform 52 | maxTextureSize: 2048 53 | textureFormat: -1 54 | textureCompression: 1 55 | compressionQuality: 50 56 | crunchedCompression: 0 57 | allowsAlphaSplitting: 0 58 | overridden: 0 59 | - buildTarget: Standalone 60 | maxTextureSize: 2048 61 | textureFormat: -1 62 | textureCompression: 1 63 | compressionQuality: 50 64 | crunchedCompression: 0 65 | allowsAlphaSplitting: 0 66 | overridden: 0 67 | - buildTarget: Android 68 | maxTextureSize: 2048 69 | textureFormat: -1 70 | textureCompression: 1 71 | compressionQuality: 50 72 | crunchedCompression: 0 73 | allowsAlphaSplitting: 0 74 | overridden: 0 75 | - buildTarget: iPhone 76 | maxTextureSize: 2048 77 | textureFormat: -1 78 | textureCompression: 1 79 | compressionQuality: 50 80 | crunchedCompression: 0 81 | allowsAlphaSplitting: 0 82 | overridden: 0 83 | spriteSheet: 84 | serializedVersion: 2 85 | sprites: [] 86 | outline: [] 87 | spritePackingTag: 88 | userData: 89 | assetBundleName: 90 | assetBundleVariant: 91 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/Texture/preview.png -------------------------------------------------------------------------------- /Assets/Resources/Texture/preview.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fb258299a5172f449e556ee67dbdaa4 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapU: -1 36 | wrapV: -1 37 | wrapW: -1 38 | nPOTScale: 1 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 2048 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | - serializedVersion: 2 71 | buildTarget: Standalone 72 | maxTextureSize: 2048 73 | resizeAlgorithm: 0 74 | textureFormat: -1 75 | textureCompression: 1 76 | compressionQuality: 50 77 | crunchedCompression: 0 78 | allowsAlphaSplitting: 0 79 | overridden: 0 80 | androidETC2FallbackOverride: 0 81 | - serializedVersion: 2 82 | buildTarget: Android 83 | maxTextureSize: 2048 84 | resizeAlgorithm: 0 85 | textureFormat: -1 86 | textureCompression: 1 87 | compressionQuality: 50 88 | crunchedCompression: 0 89 | allowsAlphaSplitting: 0 90 | overridden: 0 91 | androidETC2FallbackOverride: 0 92 | spriteSheet: 93 | serializedVersion: 2 94 | sprites: [] 95 | outline: [] 96 | physicsShape: [] 97 | bones: [] 98 | spriteID: 99 | vertices: [] 100 | indices: 101 | edges: [] 102 | weights: [] 103 | spritePackingTag: 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /Assets/Resources/Texture/sunset.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/Texture/sunset.hdr -------------------------------------------------------------------------------- /Assets/Resources/Texture/sunset.hdr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 656a59a5ff93c46498416d97e5c16b66 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 8900000: generatedCubemap 6 | externalObjects: {} 7 | serializedVersion: 5 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 4096 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 2 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spritePixelsToUnits: 100 48 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 49 | spriteGenerateFallbackPhysicsShape: 1 50 | alphaUsage: 1 51 | alphaIsTransparency: 0 52 | spriteTessellationDetail: -1 53 | textureType: 0 54 | textureShape: 2 55 | singleChannelComponent: 0 56 | maxTextureSizeSet: 0 57 | compressionQualitySet: 0 58 | textureFormatSet: 0 59 | platformSettings: 60 | - serializedVersion: 2 61 | buildTarget: DefaultTexturePlatform 62 | maxTextureSize: 4096 63 | resizeAlgorithm: 1 64 | textureFormat: -1 65 | textureCompression: 2 66 | compressionQuality: 50 67 | crunchedCompression: 0 68 | allowsAlphaSplitting: 0 69 | overridden: 0 70 | androidETC2FallbackOverride: 0 71 | - serializedVersion: 2 72 | buildTarget: Standalone 73 | maxTextureSize: 4096 74 | resizeAlgorithm: 1 75 | textureFormat: -1 76 | textureCompression: 2 77 | compressionQuality: 50 78 | crunchedCompression: 0 79 | allowsAlphaSplitting: 0 80 | overridden: 0 81 | androidETC2FallbackOverride: 0 82 | - serializedVersion: 2 83 | buildTarget: Android 84 | maxTextureSize: 4096 85 | resizeAlgorithm: 1 86 | textureFormat: -1 87 | textureCompression: 2 88 | compressionQuality: 50 89 | crunchedCompression: 0 90 | allowsAlphaSplitting: 0 91 | overridden: 0 92 | androidETC2FallbackOverride: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | physicsShape: [] 98 | bones: [] 99 | spriteID: 100 | vertices: [] 101 | indices: 102 | edges: [] 103 | weights: [] 104 | spritePackingTag: 105 | userData: 106 | assetBundleName: 107 | assetBundleVariant: 108 | -------------------------------------------------------------------------------- /Assets/Resources/plugin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 792f6e8e24d920d43ab56e3deda9bc98 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49ddcf0501f91504aa9bf8a77cd225cf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/DOTween.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34192c5e0d14aee43a0e86cc4823268a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/DOTween.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/DOTween.dll -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/DOTween.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/DOTween.dll.mdb -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/DOTween.dll.mdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f007001a22b3d24dae350342c4d19c8 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/DOTween.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a811bde74b26b53498b4f6d872b09b6d 3 | PluginImporter: 4 | serializedVersion: 2 5 | iconMap: {} 6 | executionOrder: {} 7 | isPreloaded: 0 8 | isOverridable: 0 9 | platformData: 10 | data: 11 | first: 12 | Any: 13 | second: 14 | enabled: 1 15 | settings: {} 16 | data: 17 | first: 18 | Editor: Editor 19 | second: 20 | enabled: 0 21 | settings: 22 | DefaultValueInitialized: true 23 | data: 24 | first: 25 | Windows Store Apps: WindowsStoreApps 26 | second: 27 | enabled: 0 28 | settings: 29 | CPU: AnyCPU 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4630a8426af304849824a2b909f25932 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DOTweenEditor 5 | 6 | 7 | 8 | 9 | Checks that the given editor texture use the correct import settings, 10 | and applies them if they're incorrect. 11 | 12 | 13 | 14 | 15 | Returns TRUE if setup is required 16 | 17 | 18 | 19 | 20 | Returns TRUE if the file/directory at the given path exists. 21 | 22 | Path, relative to Unity's project folder 23 | 24 | 25 | 26 | 27 | Converts the given project-relative path to a full path, 28 | with backward (\) slashes). 29 | 30 | 31 | 32 | 33 | Converts the given full path to a path usable with AssetDatabase methods 34 | (relative to Unity's project folder, and with the correct Unity forward (/) slashes). 35 | 36 | 37 | 38 | 39 | Connects to a asset. 40 | If the asset already exists at the given path, loads it and returns it. 41 | Otherwise, either returns NULL or automatically creates it before loading and returning it 42 | (depending on the given parameters). 43 | 44 | Asset type 45 | File path (relative to Unity's project folder) 46 | If TRUE and the requested asset doesn't exist, forces its creation 47 | 48 | 49 | 50 | Full path for the given loaded assembly, assembly file included 51 | 52 | 53 | 54 | 55 | Adds the given global define if it's not already present 56 | 57 | 58 | 59 | 60 | Removes the given global define if it's present 61 | 62 | 63 | 64 | 65 | Returns TRUE if the given global define is present in all the 66 | or only in the given , depending on passed parameters. 67 | 68 | 69 | to use. Leave NULL to check in all of them. 70 | 71 | 72 | 73 | Not used as menu item anymore, but as a utiity function 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e2c6224d345d9249acfa6e8ef40bb2d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.dll -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.dll.mdb -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.dll.mdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f46310a8b0a8f04a92993c37c713243 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/DOTweenEditor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45d5034162d6cf04dbe46da84fc7d074 3 | PluginImporter: 4 | serializedVersion: 2 5 | iconMap: {} 6 | executionOrder: {} 7 | isPreloaded: 0 8 | isOverridable: 0 9 | platformData: 10 | data: 11 | first: 12 | Any: 13 | second: 14 | enabled: 0 15 | settings: {} 16 | data: 17 | first: 18 | Editor: Editor 19 | second: 20 | enabled: 1 21 | settings: 22 | DefaultValueInitialized: true 23 | data: 24 | first: 25 | Windows Store Apps: WindowsStoreApps 26 | second: 27 | enabled: 0 28 | settings: 29 | CPU: AnyCPU 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1299170ff4e88942b95d8ec8ad64883 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/DOTweenIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/Editor/Imgs/DOTweenIcon.png -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/DOTweenIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8da095e39e9b4df488dfd436f81116d6 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 1 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: -3 29 | maxTextureSize: 128 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: 1 33 | aniso: 1 34 | mipBias: -1 35 | wrapU: 1 36 | wrapV: 1 37 | wrapW: 1 38 | nPOTScale: 0 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 128 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | spriteSheet: 71 | serializedVersion: 2 72 | sprites: [] 73 | outline: [] 74 | physicsShape: [] 75 | bones: [] 76 | spriteID: 77 | vertices: [] 78 | indices: 79 | edges: [] 80 | weights: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/Footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/Editor/Imgs/Footer.png -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/Footer.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7051dba417b3d53409f2918f1ea4938d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 1 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: -3 29 | maxTextureSize: 256 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: 1 33 | aniso: 1 34 | mipBias: -1 35 | wrapU: 1 36 | wrapV: 1 37 | wrapW: 1 38 | nPOTScale: 0 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 256 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | spriteSheet: 71 | serializedVersion: 2 72 | sprites: [] 73 | outline: [] 74 | physicsShape: [] 75 | bones: [] 76 | spriteID: 77 | vertices: [] 78 | indices: 79 | edges: [] 80 | weights: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/Footer_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/Editor/Imgs/Footer_dark.png -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/Footer_dark.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 519694efe2bb2914788b151fbd8c01f4 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapU: -1 36 | wrapV: -1 37 | wrapW: -1 38 | nPOTScale: 1 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 1024 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | spriteSheet: 71 | serializedVersion: 2 72 | sprites: [] 73 | outline: [] 74 | physicsShape: [] 75 | bones: [] 76 | spriteID: 77 | vertices: [] 78 | indices: 79 | edges: [] 80 | weights: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/Header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Resources/plugin/DOTween/Editor/Imgs/Header.jpg -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Editor/Imgs/Header.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78a59ca99f8987941adb61f9e14a06a7 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 1 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: -3 29 | maxTextureSize: 512 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: 1 33 | aniso: 1 34 | mipBias: -1 35 | wrapU: 1 36 | wrapV: 1 37 | wrapW: 1 38 | nPOTScale: 0 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 512 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | spriteSheet: 71 | serializedVersion: 2 72 | sprites: [] 73 | outline: [] 74 | physicsShape: [] 75 | bones: [] 76 | spriteID: 77 | vertices: [] 78 | indices: 79 | edges: [] 80 | weights: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5cced8d3321af343a222892df933c95 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModuleAudio.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b766d08851589514b97afb23c6f30a70 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModulePhysics.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dae9aa560b4242648a3affa2bfabc365 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModulePhysics2D.cs: -------------------------------------------------------------------------------- 1 | // Author: Daniele Giardini - http://www.demigiant.com 2 | // Created: 2018/07/13 3 | 4 | #if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER 5 | using System; 6 | using UnityEngine; 7 | 8 | #pragma warning disable 1591 9 | namespace DG.Tweening 10 | { 11 | public static class DOTweenModulePhysics2D 12 | { 13 | #region Shortcuts 14 | 15 | #region Rigidbody2D Shortcuts 16 | 17 | /// Tweens a Rigidbody2D's position to the given value. 18 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations 19 | /// The end value to reachThe duration of the tween 20 | /// If TRUE the tween will smoothly snap all values to integers 21 | public static Tweener DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false) 22 | { 23 | return DOTween.To(() => target.position, target.MovePosition, endValue, duration) 24 | .SetOptions(snapping).SetTarget(target); 25 | } 26 | 27 | /// Tweens a Rigidbody2D's X position to the given value. 28 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations 29 | /// The end value to reachThe duration of the tween 30 | /// If TRUE the tween will smoothly snap all values to integers 31 | public static Tweener DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false) 32 | { 33 | return DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration) 34 | .SetOptions(AxisConstraint.X, snapping).SetTarget(target); 35 | } 36 | 37 | /// Tweens a Rigidbody2D's Y position to the given value. 38 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations 39 | /// The end value to reachThe duration of the tween 40 | /// If TRUE the tween will smoothly snap all values to integers 41 | public static Tweener DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false) 42 | { 43 | return DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration) 44 | .SetOptions(AxisConstraint.Y, snapping).SetTarget(target); 45 | } 46 | 47 | /// Tweens a Rigidbody2D's rotation to the given value. 48 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations 49 | /// The end value to reachThe duration of the tween 50 | public static Tweener DORotate(this Rigidbody2D target, float endValue, float duration) 51 | { 52 | return DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration) 53 | .SetTarget(target); 54 | } 55 | 56 | #region Special 57 | 58 | /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis. 59 | /// Returns a Sequence instead of a Tweener. 60 | /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations. 61 | /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position 62 | /// The end value to reach 63 | /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) 64 | /// Total number of jumps 65 | /// The duration of the tween 66 | /// If TRUE the tween will smoothly snap all values to integers 67 | public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) 68 | { 69 | if (numJumps < 1) numJumps = 1; 70 | float startPosY = 0; 71 | float offsetY = -1; 72 | bool offsetYSet = false; 73 | Sequence s = DOTween.Sequence(); 74 | Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) 75 | .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() 76 | .SetLoops(numJumps * 2, LoopType.Yoyo) 77 | .OnStart(() => startPosY = target.position.y); 78 | s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration) 79 | .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) 80 | ).Join(yTween) 81 | .SetTarget(target).SetEase(DOTween.defaultEaseType); 82 | yTween.OnUpdate(() => { 83 | if (!offsetYSet) { 84 | offsetYSet = true; 85 | offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; 86 | } 87 | Vector3 pos = target.position; 88 | pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); 89 | target.MovePosition(pos); 90 | }); 91 | return s; 92 | } 93 | 94 | #endregion 95 | 96 | #endregion 97 | 98 | #endregion 99 | } 100 | } 101 | #endif 102 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModulePhysics2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 230fe34542e175245ba74b4659dae700 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModuleSprite.cs: -------------------------------------------------------------------------------- 1 | // Author: Daniele Giardini - http://www.demigiant.com 2 | // Created: 2018/07/13 3 | 4 | #if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER 5 | using System; 6 | using UnityEngine; 7 | using DG.Tweening.Core; 8 | 9 | #pragma warning disable 1591 10 | namespace DG.Tweening 11 | { 12 | public static class DOTweenModuleSprite 13 | { 14 | #region Shortcuts 15 | 16 | #region SpriteRenderer 17 | 18 | /// Tweens a SpriteRenderer's color to the given value. 19 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations 20 | /// The end value to reachThe duration of the tween 21 | public static Tweener DOColor(this SpriteRenderer target, Color endValue, float duration) 22 | { 23 | return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target); 24 | } 25 | 26 | /// Tweens a Material's alpha color to the given value. 27 | /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations 28 | /// The end value to reachThe duration of the tween 29 | public static Tweener DOFade(this SpriteRenderer target, float endValue, float duration) 30 | { 31 | return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration) 32 | .SetTarget(target); 33 | } 34 | 35 | /// Tweens a SpriteRenderer's color using the given gradient 36 | /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). 37 | /// Also stores the image as the tween's target so it can be used for filtered operations 38 | /// The gradient to useThe duration of the tween 39 | public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration) 40 | { 41 | Sequence s = DOTween.Sequence(); 42 | GradientColorKey[] colors = gradient.colorKeys; 43 | int len = colors.Length; 44 | for (int i = 0; i < len; ++i) { 45 | GradientColorKey c = colors[i]; 46 | if (i == 0 && c.time <= 0) { 47 | target.color = c.color; 48 | continue; 49 | } 50 | float colorDuration = i == len - 1 51 | ? duration - s.Duration(false) // Verifies that total duration is correct 52 | : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); 53 | s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); 54 | } 55 | return s; 56 | } 57 | 58 | #endregion 59 | 60 | #region Blendables 61 | 62 | #region SpriteRenderer 63 | 64 | /// Tweens a SpriteRenderer's color to the given value, 65 | /// in a way that allows other DOBlendableColor tweens to work together on the same target, 66 | /// instead than fight each other as multiple DOColor would do. 67 | /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations 68 | /// The value to tween toThe duration of the tween 69 | public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration) 70 | { 71 | endValue = endValue - target.color; 72 | Color to = new Color(0, 0, 0, 0); 73 | return DOTween.To(() => to, x => { 74 | Color diff = x - to; 75 | to = x; 76 | target.color += diff; 77 | }, endValue, duration) 78 | .Blendable().SetTarget(target); 79 | } 80 | 81 | #endregion 82 | 83 | #endregion 84 | 85 | #endregion 86 | } 87 | } 88 | #endif 89 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModuleSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 188918ab119d93148aa0de59ccf5286b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModuleUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a060394c03331a64392db53a10e7f2d1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63c02322328255542995bd02b47b0457 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModuleUtils.cs: -------------------------------------------------------------------------------- 1 | // Author: Daniele Giardini - http://www.demigiant.com 2 | // Created: 2018/07/13 3 | 4 | using System; 5 | using UnityEngine; 6 | using DG.Tweening.Core; 7 | using DG.Tweening.Plugins.Core.PathCore; 8 | using DG.Tweening.Plugins.Options; 9 | 10 | #pragma warning disable 1591 11 | namespace DG.Tweening 12 | { 13 | /// 14 | /// Utility functions that deal with available Modules. 15 | /// Modules defines: 16 | /// - DOTAUDIO 17 | /// - DOTPHYSICS 18 | /// - DOTPHYSICS2D 19 | /// - DOTSPRITE 20 | /// - DOTUI 21 | /// Extra defines set and used for implementation of external assets: 22 | /// - DOTWEEN_TMP ► TextMesh Pro 23 | /// - DOTWEEN_TK2D ► 2D Toolkit 24 | /// 25 | public static class DOTweenModuleUtils 26 | { 27 | static bool _initialized; 28 | 29 | /// 30 | /// Called via Reflection by DOTweenComponent on Awake 31 | /// 32 | public static void Init() 33 | { 34 | if (_initialized) return; 35 | 36 | _initialized = true; 37 | DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath; 38 | } 39 | 40 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 41 | // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████ 42 | // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 43 | 44 | public static class Physics 45 | { 46 | // Called via DOTweenExternalCommand callback 47 | public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans) 48 | { 49 | #if true // PHYSICS_MARKER 50 | if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot; 51 | else trans.rotation = newRot; 52 | #else 53 | trans.rotation = newRot; 54 | #endif 55 | } 56 | 57 | // Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached 58 | public static bool HasRigidbody2D(Component target) 59 | { 60 | #if true // PHYSICS2D_MARKER 61 | return target.GetComponent() != null; 62 | #else 63 | return false; 64 | #endif 65 | } 66 | 67 | #region Called via Reflection 68 | 69 | 70 | // Called via Reflection by DOTweenPathInspector 71 | // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached 72 | public static bool HasRigidbody(Component target) 73 | { 74 | #if true // PHYSICS_MARKER 75 | return target.GetComponent() != null; 76 | #else 77 | return false; 78 | #endif 79 | } 80 | 81 | // Called via Reflection by DOTweenPath 82 | public static TweenerCore CreateDOTweenPathTween( 83 | MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode 84 | ){ 85 | TweenerCore t; 86 | #if true // PHYSICS_MARKER 87 | Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null; 88 | if (tweenRigidbody && rBody != null) { 89 | t = isLocal 90 | ? rBody.DOLocalPath(path, duration, pathMode) 91 | : rBody.DOPath(path, duration, pathMode); 92 | } else { 93 | t = isLocal 94 | ? target.transform.DOLocalPath(path, duration, pathMode) 95 | : target.transform.DOPath(path, duration, pathMode); 96 | } 97 | #else 98 | t = isLocal 99 | ? target.transform.DOLocalPath(path, duration, pathMode) 100 | : target.transform.DOPath(path, duration, pathMode); 101 | #endif 102 | return t; 103 | } 104 | 105 | #endregion 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/Modules/DOTweenModuleUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bcaf917d9cf5b84090421a5a2abe42e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/readme.txt: -------------------------------------------------------------------------------- 1 | DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant 2 | 3 | // IMPORTANT!!! ///////////////////////////////////////////// 4 | // Upgrading DOTween from versions older than 1.2.000 /////// 5 | // (or DOTween Pro older than 1.0.000) ////////////////////// 6 | ------------------------------------------------------------- 7 | If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully. 8 | 1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry 9 | 2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath 10 | 3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup 11 | 4) From the Add/Remove Modules panel that opens, activate/deactivate Modules for Unity systems and for external assets (Pro version only) 12 | 13 | // GET STARTED ////////////////////////////////////////////// 14 | 15 | - After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween. 16 | - In your code, add "using DG.Tweening" to each class where you want to use DOTween. 17 | - You're ready to tween. Check out the links below for full documentation and license info. 18 | 19 | 20 | // LINKS /////////////////////////////////////////////////////// 21 | 22 | DOTween website (documentation, examples, etc): http://dotween.demigiant.com 23 | DOTween license: http://dotween.demigiant.com/license.php 24 | DOTween repository (Google Code): https://code.google.com/p/dotween/ 25 | Demigiant website (documentation, examples, etc): http://www.demigiant.com 26 | 27 | // NOTES ////////////////////////////////////////////////////// 28 | 29 | - DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences -------------------------------------------------------------------------------- /Assets/Resources/plugin/DOTween/readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fccfc62abf2eb0a4db614853430894fd 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f704ae4b4f98ae41a0bce26658850c1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/RayTrace.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05deaf0bfec57bf48922a9cfaef1bf31 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/RayTrace.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acaf0eeeba8243343956cc48716d0e64 3 | timeCreated: 1531737651 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/RayTrace/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Scenes/RayTrace/LightingData.asset -------------------------------------------------------------------------------- /Assets/Scenes/RayTrace/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feda23391be14fc4882e80317da2694e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 25800000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/RayTrace/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/Assets/Scenes/RayTrace/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/Scenes/RayTrace/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15bfdb018194d634a97385fd71beb114 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 8900000: generatedCubemap 6 | externalObjects: {} 7 | serializedVersion: 5 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 1 28 | seamlessCubemap: 1 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 2 34 | aniso: 0 35 | mipBias: 0 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spritePixelsToUnits: 100 48 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 49 | spriteGenerateFallbackPhysicsShape: 1 50 | alphaUsage: 1 51 | alphaIsTransparency: 0 52 | spriteTessellationDetail: -1 53 | textureType: 0 54 | textureShape: 2 55 | singleChannelComponent: 0 56 | maxTextureSizeSet: 0 57 | compressionQualitySet: 0 58 | textureFormatSet: 0 59 | platformSettings: 60 | - serializedVersion: 2 61 | buildTarget: DefaultTexturePlatform 62 | maxTextureSize: 2048 63 | resizeAlgorithm: 0 64 | textureFormat: -1 65 | textureCompression: 1 66 | compressionQuality: 100 67 | crunchedCompression: 0 68 | allowsAlphaSplitting: 0 69 | overridden: 0 70 | androidETC2FallbackOverride: 0 71 | spriteSheet: 72 | serializedVersion: 2 73 | sprites: [] 74 | outline: [] 75 | physicsShape: [] 76 | bones: [] 77 | spriteID: 78 | vertices: [] 79 | indices: 80 | edges: [] 81 | weights: [] 82 | spritePackingTag: 83 | userData: 84 | assetBundleName: 85 | assetBundleVariant: 86 | -------------------------------------------------------------------------------- /Assets/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04e45c54474ae6647acfda96cf5a9f16 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f7308500f322e644817ccfc3e0a17a5 3 | folderAsset: yes 4 | timeCreated: 1436977287 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/ImageEffects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 225198e07aaae3547a6d1f6e7177555f 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/ImageEffects/BloomAndFlaresEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.ImageEffects 6 | { 7 | [CustomEditor (typeof(BloomAndFlares))] 8 | class BloomAndFlaresEditor : Editor 9 | { 10 | SerializedProperty tweakMode; 11 | SerializedProperty screenBlendMode; 12 | 13 | SerializedObject serObj; 14 | 15 | SerializedProperty hdr; 16 | SerializedProperty sepBlurSpread; 17 | SerializedProperty useSrcAlphaAsMask; 18 | 19 | SerializedProperty bloomIntensity; 20 | SerializedProperty bloomthreshold; 21 | SerializedProperty bloomBlurIterations; 22 | 23 | SerializedProperty lensflares; 24 | 25 | SerializedProperty hollywoodFlareBlurIterations; 26 | 27 | SerializedProperty lensflareMode; 28 | SerializedProperty hollyStretchWidth; 29 | SerializedProperty lensflareIntensity; 30 | SerializedProperty lensflarethreshold; 31 | SerializedProperty flareColorA; 32 | SerializedProperty flareColorB; 33 | SerializedProperty flareColorC; 34 | SerializedProperty flareColorD; 35 | 36 | SerializedProperty lensFlareVignetteMask; 37 | 38 | void OnEnable () { 39 | serObj = new SerializedObject (target); 40 | 41 | screenBlendMode = serObj.FindProperty("screenBlendMode"); 42 | hdr = serObj.FindProperty("hdr"); 43 | 44 | sepBlurSpread = serObj.FindProperty("sepBlurSpread"); 45 | useSrcAlphaAsMask = serObj.FindProperty("useSrcAlphaAsMask"); 46 | 47 | bloomIntensity = serObj.FindProperty("bloomIntensity"); 48 | bloomthreshold = serObj.FindProperty("bloomThreshold"); 49 | bloomBlurIterations = serObj.FindProperty("bloomBlurIterations"); 50 | 51 | lensflares = serObj.FindProperty("lensflares"); 52 | 53 | lensflareMode = serObj.FindProperty("lensflareMode"); 54 | hollywoodFlareBlurIterations = serObj.FindProperty("hollywoodFlareBlurIterations"); 55 | hollyStretchWidth = serObj.FindProperty("hollyStretchWidth"); 56 | lensflareIntensity = serObj.FindProperty("lensflareIntensity"); 57 | lensflarethreshold = serObj.FindProperty("lensflareThreshold"); 58 | flareColorA = serObj.FindProperty("flareColorA"); 59 | flareColorB = serObj.FindProperty("flareColorB"); 60 | flareColorC = serObj.FindProperty("flareColorC"); 61 | flareColorD = serObj.FindProperty("flareColorD"); 62 | lensFlareVignetteMask = serObj.FindProperty("lensFlareVignetteMask"); 63 | 64 | tweakMode = serObj.FindProperty("tweakMode"); 65 | } 66 | 67 | 68 | public override void OnInspectorGUI () { 69 | serObj.Update(); 70 | 71 | GUILayout.Label("HDR " + (hdr.enumValueIndex == 0 ? "auto detected, " : (hdr.enumValueIndex == 1 ? "forced on, " : "disabled, ")) + (useSrcAlphaAsMask.floatValue < 0.1f ? " ignoring alpha channel glow information" : " using alpha channel glow information"), EditorStyles.miniBoldLabel); 72 | 73 | EditorGUILayout.PropertyField (tweakMode, new GUIContent("Tweak mode")); 74 | EditorGUILayout.PropertyField (screenBlendMode, new GUIContent("Blend mode")); 75 | EditorGUILayout.PropertyField (hdr, new GUIContent("HDR")); 76 | 77 | // display info text when screen blend mode cannot be used 78 | Camera cam = (target as BloomAndFlares).GetComponent(); 79 | if (cam != null) { 80 | #if UNITY_5_6_OR_NEWER 81 | if (screenBlendMode.enumValueIndex==0 && ((cam.allowHDR && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) { 82 | #else 83 | if (screenBlendMode.enumValueIndex==0 && ((cam.hdr && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) { 84 | #endif 85 | EditorGUILayout.HelpBox("Screen blend is not supported in HDR. Using 'Add' instead.", MessageType.Info); 86 | } 87 | } 88 | 89 | if (1 == tweakMode.intValue) 90 | EditorGUILayout.PropertyField (lensflares, new GUIContent("Cast lens flares")); 91 | 92 | EditorGUILayout.Separator (); 93 | 94 | EditorGUILayout.PropertyField (bloomIntensity, new GUIContent("Intensity")); 95 | bloomthreshold.floatValue = EditorGUILayout.Slider ("threshold", bloomthreshold.floatValue, -0.05f, 4.0f); 96 | bloomBlurIterations.intValue = EditorGUILayout.IntSlider ("Blur iterations", bloomBlurIterations.intValue, 1, 4); 97 | sepBlurSpread.floatValue = EditorGUILayout.Slider ("Blur spread", sepBlurSpread.floatValue, 0.1f, 10.0f); 98 | 99 | if (1 == tweakMode.intValue) 100 | useSrcAlphaAsMask.floatValue = EditorGUILayout.Slider (new GUIContent("Use alpha mask", "Make alpha channel define glowiness"), useSrcAlphaAsMask.floatValue, 0.0f, 1.0f); 101 | else 102 | useSrcAlphaAsMask.floatValue = 0.0f; 103 | 104 | if (1 == tweakMode.intValue) { 105 | EditorGUILayout.Separator (); 106 | 107 | if (lensflares.boolValue) { 108 | 109 | // further lens flare tweakings 110 | if (0 != tweakMode.intValue) 111 | EditorGUILayout.PropertyField (lensflareMode, new GUIContent("Lens flare mode")); 112 | else 113 | lensflareMode.enumValueIndex = 0; 114 | 115 | EditorGUILayout.PropertyField(lensFlareVignetteMask, new GUIContent("Lens flare mask", "This mask is needed to prevent lens flare artifacts")); 116 | 117 | EditorGUILayout.PropertyField (lensflareIntensity, new GUIContent("Local intensity")); 118 | lensflarethreshold.floatValue = EditorGUILayout.Slider ("Local threshold", lensflarethreshold.floatValue, 0.0f, 1.0f); 119 | 120 | if (lensflareMode.intValue == 0) { 121 | // ghosting 122 | EditorGUILayout.BeginHorizontal (); 123 | EditorGUILayout.PropertyField (flareColorA, new GUIContent("1st Color")); 124 | EditorGUILayout.PropertyField (flareColorB, new GUIContent("2nd Color")); 125 | EditorGUILayout.EndHorizontal (); 126 | 127 | EditorGUILayout.BeginHorizontal (); 128 | EditorGUILayout.PropertyField (flareColorC, new GUIContent("3rd Color")); 129 | EditorGUILayout.PropertyField (flareColorD, new GUIContent("4th Color")); 130 | EditorGUILayout.EndHorizontal (); 131 | } 132 | else if (lensflareMode.intValue == 1) { 133 | // hollywood 134 | EditorGUILayout.PropertyField (hollyStretchWidth, new GUIContent("Stretch width")); 135 | hollywoodFlareBlurIterations.intValue = EditorGUILayout.IntSlider ("Blur iterations", hollywoodFlareBlurIterations.intValue, 1, 4); 136 | 137 | EditorGUILayout.PropertyField (flareColorA, new GUIContent("Tint Color")); 138 | } 139 | else if (lensflareMode.intValue == 2) { 140 | // both 141 | EditorGUILayout.PropertyField (hollyStretchWidth, new GUIContent("Stretch width")); 142 | hollywoodFlareBlurIterations.intValue = EditorGUILayout.IntSlider ("Blur iterations", hollywoodFlareBlurIterations.intValue, 1, 4); 143 | 144 | EditorGUILayout.BeginHorizontal (); 145 | EditorGUILayout.PropertyField (flareColorA, new GUIContent("1st Color")); 146 | EditorGUILayout.PropertyField (flareColorB, new GUIContent("2nd Color")); 147 | EditorGUILayout.EndHorizontal (); 148 | 149 | EditorGUILayout.BeginHorizontal (); 150 | EditorGUILayout.PropertyField (flareColorC, new GUIContent("3rd Color")); 151 | EditorGUILayout.PropertyField (flareColorD, new GUIContent("4th Color")); 152 | EditorGUILayout.EndHorizontal (); 153 | } 154 | } 155 | } else 156 | lensflares.boolValue = false; // disable lens flares in simple tweak mode 157 | 158 | serObj.ApplyModifiedProperties(); 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/ImageEffects/BloomAndFlaresEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4deca87cb459d1642ac8f734856ca84e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/ImageEffects/BloomEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.ImageEffects 6 | { 7 | [CustomEditor (typeof(Bloom))] 8 | class BloomEditor : Editor 9 | { 10 | SerializedProperty tweakMode; 11 | SerializedProperty screenBlendMode; 12 | 13 | SerializedObject serObj; 14 | 15 | SerializedProperty hdr; 16 | SerializedProperty quality; 17 | SerializedProperty sepBlurSpread; 18 | 19 | SerializedProperty bloomIntensity; 20 | SerializedProperty bloomThresholdColor; 21 | SerializedProperty bloomThreshold; 22 | SerializedProperty bloomBlurIterations; 23 | 24 | SerializedProperty hollywoodFlareBlurIterations; 25 | 26 | SerializedProperty lensflareMode; 27 | SerializedProperty hollyStretchWidth; 28 | SerializedProperty lensflareIntensity; 29 | SerializedProperty flareRotation; 30 | SerializedProperty lensFlareSaturation; 31 | SerializedProperty lensflareThreshold; 32 | SerializedProperty flareColorA; 33 | SerializedProperty flareColorB; 34 | SerializedProperty flareColorC; 35 | SerializedProperty flareColorD; 36 | 37 | SerializedProperty lensFlareVignetteMask; 38 | 39 | void OnEnable () { 40 | serObj = new SerializedObject (target); 41 | 42 | screenBlendMode = serObj.FindProperty("screenBlendMode"); 43 | hdr = serObj.FindProperty("hdr"); 44 | quality = serObj.FindProperty("quality"); 45 | 46 | sepBlurSpread = serObj.FindProperty("sepBlurSpread"); 47 | 48 | bloomIntensity = serObj.FindProperty("bloomIntensity"); 49 | bloomThreshold = serObj.FindProperty("bloomThreshold"); 50 | bloomThresholdColor = serObj.FindProperty("bloomThresholdColor"); 51 | bloomBlurIterations = serObj.FindProperty("bloomBlurIterations"); 52 | 53 | lensflareMode = serObj.FindProperty("lensflareMode"); 54 | hollywoodFlareBlurIterations = serObj.FindProperty("hollywoodFlareBlurIterations"); 55 | hollyStretchWidth = serObj.FindProperty("hollyStretchWidth"); 56 | lensflareIntensity = serObj.FindProperty("lensflareIntensity"); 57 | lensflareThreshold = serObj.FindProperty("lensflareThreshold"); 58 | lensFlareSaturation = serObj.FindProperty("lensFlareSaturation"); 59 | flareRotation = serObj.FindProperty("flareRotation"); 60 | flareColorA = serObj.FindProperty("flareColorA"); 61 | flareColorB = serObj.FindProperty("flareColorB"); 62 | flareColorC = serObj.FindProperty("flareColorC"); 63 | flareColorD = serObj.FindProperty("flareColorD"); 64 | lensFlareVignetteMask = serObj.FindProperty("lensFlareVignetteMask"); 65 | 66 | tweakMode = serObj.FindProperty("tweakMode"); 67 | } 68 | 69 | 70 | public override void OnInspectorGUI () { 71 | serObj.Update(); 72 | 73 | EditorGUILayout.LabelField("Glow and Lens Flares for bright screen pixels", EditorStyles.miniLabel); 74 | 75 | EditorGUILayout.PropertyField (quality, new GUIContent("Quality", "High quality preserves high frequencies with bigger blurs and uses a better blending and down-/upsampling")); 76 | 77 | EditorGUILayout.Separator (); 78 | 79 | EditorGUILayout.PropertyField (tweakMode, new GUIContent("Mode")); 80 | EditorGUILayout.PropertyField (screenBlendMode, new GUIContent("Blend")); 81 | EditorGUILayout.PropertyField (hdr, new GUIContent("HDR")); 82 | 83 | EditorGUILayout.Separator (); 84 | 85 | // display info text when screen blend mode cannot be used 86 | Camera cam = (target as Bloom).GetComponent(); 87 | if (cam != null) { 88 | #if UNITY_5_6_OR_NEWER 89 | if (screenBlendMode.enumValueIndex==0 && ((cam.allowHDR && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) { 90 | #else 91 | if (screenBlendMode.enumValueIndex==0 && ((cam.hdr && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) { 92 | #endif 93 | EditorGUILayout.HelpBox("Screen blend is not supported in HDR. Using 'Add' instead.", MessageType.Info); 94 | } 95 | } 96 | 97 | EditorGUILayout.PropertyField (bloomIntensity, new GUIContent("Intensity")); 98 | bloomThreshold.floatValue = EditorGUILayout.Slider ("Threshold", bloomThreshold.floatValue, -0.05f, 4.0f); 99 | if (1 == tweakMode.intValue) { 100 | EditorGUILayout.PropertyField(bloomThresholdColor, new GUIContent(" RGB Threshold")); 101 | } 102 | EditorGUILayout.Separator (); 103 | 104 | bloomBlurIterations.intValue = EditorGUILayout.IntSlider ("Blur Iterations", bloomBlurIterations.intValue, 1, 4); 105 | sepBlurSpread.floatValue = EditorGUILayout.Slider (" Sample Distance", sepBlurSpread.floatValue, 0.1f, 10.0f); 106 | EditorGUILayout.Separator (); 107 | 108 | if (1 == tweakMode.intValue) { 109 | // further lens flare tweakings 110 | if (0 != tweakMode.intValue) 111 | EditorGUILayout.PropertyField (lensflareMode, new GUIContent("Lens Flares")); 112 | else 113 | lensflareMode.enumValueIndex = 0; 114 | 115 | EditorGUILayout.PropertyField (lensflareIntensity, new GUIContent(" Local Intensity", "0 disables lens flares entirely (optimization)")); 116 | lensflareThreshold.floatValue = EditorGUILayout.Slider ("Threshold", lensflareThreshold.floatValue, 0.0f, 4.0f); 117 | 118 | if (Mathf.Abs(lensflareIntensity.floatValue) > Mathf.Epsilon) { 119 | if (lensflareMode.intValue == 0) { 120 | // ghosting 121 | EditorGUILayout.BeginHorizontal (); 122 | EditorGUILayout.PropertyField (flareColorA, new GUIContent(" 1st Color")); 123 | EditorGUILayout.PropertyField (flareColorB, new GUIContent(" 2nd Color")); 124 | EditorGUILayout.EndHorizontal (); 125 | 126 | EditorGUILayout.BeginHorizontal (); 127 | EditorGUILayout.PropertyField (flareColorC, new GUIContent(" 3rd Color")); 128 | EditorGUILayout.PropertyField (flareColorD, new GUIContent(" 4th Color")); 129 | EditorGUILayout.EndHorizontal (); 130 | } 131 | else if (lensflareMode.intValue == 1) { 132 | // hollywood 133 | EditorGUILayout.PropertyField (hollyStretchWidth, new GUIContent(" Stretch width")); 134 | EditorGUILayout.PropertyField (flareRotation, new GUIContent( " Rotation")); 135 | hollywoodFlareBlurIterations.intValue = EditorGUILayout.IntSlider (" Blur Iterations", hollywoodFlareBlurIterations.intValue, 1, 4); 136 | 137 | EditorGUILayout.PropertyField (lensFlareSaturation, new GUIContent(" Saturation")); 138 | EditorGUILayout.PropertyField (flareColorA, new GUIContent(" Tint Color")); 139 | } 140 | else if (lensflareMode.intValue == 2) { 141 | // both 142 | EditorGUILayout.PropertyField (hollyStretchWidth, new GUIContent(" Stretch width")); 143 | hollywoodFlareBlurIterations.intValue = EditorGUILayout.IntSlider (" Blur Iterations", hollywoodFlareBlurIterations.intValue, 1, 4); 144 | 145 | EditorGUILayout.PropertyField (lensFlareSaturation, new GUIContent(" Saturation")); 146 | 147 | EditorGUILayout.BeginHorizontal (); 148 | EditorGUILayout.PropertyField (flareColorA, new GUIContent(" 1st Color")); 149 | EditorGUILayout.PropertyField (flareColorB, new GUIContent(" 2nd Color")); 150 | EditorGUILayout.EndHorizontal (); 151 | 152 | EditorGUILayout.BeginHorizontal (); 153 | EditorGUILayout.PropertyField (flareColorC, new GUIContent(" 3rd Color")); 154 | EditorGUILayout.PropertyField (flareColorD, new GUIContent(" 4th Color")); 155 | EditorGUILayout.EndHorizontal (); 156 | } 157 | 158 | EditorGUILayout.PropertyField(lensFlareVignetteMask, new GUIContent(" Mask", "This mask is needed to prevent lens flare artifacts")); 159 | 160 | } 161 | } 162 | 163 | serObj.ApplyModifiedProperties(); 164 | } 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/ImageEffects/BloomEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43fcc28c40e404d4eabfc88b1dbda7b5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 115d1f9d9bd29064ab981e57c8fc8cdf 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6e0c95a128e14227939c51b5d9ad74e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd3e1490c3d9a7a498538315414d5129 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fceaeb339b971b429c4cc600acabd13 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: 6 | - lensFlareVignetteMask: {fileID: 2800000, guid: 95ef4804fe0be4c999ddaa383536cde8, 7 | type: 3} 8 | - lensFlareShader: {fileID: 4800000, guid: 459fe69d2f6d74ddb92f04dbf45a866b, type: 3} 9 | - screenBlendShader: {fileID: 4800000, guid: 7856cbff0a0ca45c787d5431eb805bb0, type: 3} 10 | - blurAndFlaresShader: {fileID: 4800000, guid: be6e39cf196f146d5be72fbefb18ed75, 11 | type: 3} 12 | - brightPassFilterShader: {fileID: 4800000, guid: 0aeaa4cb29f5d4e9c8455f04c8575c8c, 13 | type: 3} 14 | executionOrder: 0 15 | icon: {instanceID: 0} 16 | userData: 17 | assetBundleName: 18 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomAndFlares.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02536f33053638549ab5c50ff3ecc0de 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: 6 | - lensFlareVignetteMask: {fileID: 2800000, guid: 95ef4804fe0be4c999ddaa383536cde8, 7 | type: 3} 8 | - lensFlareShader: {fileID: 4800000, guid: 459fe69d2f6d74ddb92f04dbf45a866b, type: 3} 9 | - vignetteShader: {fileID: 4800000, guid: 627943dc7a9a74286b70a4f694a0acd5, type: 3} 10 | - separableBlurShader: {fileID: 4800000, guid: a9df009a214e24a5ebbf271595f8d5b6, 11 | type: 3} 12 | - addBrightStuffOneOneShader: {fileID: 4800000, guid: f7898d203e9b94c0dbe2bf9dd5cb32c0, 13 | type: 3} 14 | - screenBlendShader: {fileID: 4800000, guid: 53b3960ee3d3d4a5caa8d5473d120187, type: 3} 15 | - hollywoodFlaresShader: {fileID: 4800000, guid: e2baf3cae8edc4daf94c9adc2154be00, 16 | type: 3} 17 | - brightPassFilterShader: {fileID: 4800000, guid: 186c4c0d31e314f049595dcbaf4ca129, 18 | type: 3} 19 | executionOrder: 0 20 | icon: {instanceID: 0} 21 | userData: 22 | assetBundleName: 23 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.ImageEffects 5 | { 6 | [ExecuteInEditMode] 7 | [RequireComponent (typeof(Camera))] 8 | [AddComponentMenu ("Image Effects/Bloom and Glow/Bloom (Optimized)")] 9 | public class BloomOptimized : PostEffectsBase 10 | { 11 | 12 | public enum Resolution 13 | { 14 | Low = 0, 15 | High = 1, 16 | } 17 | 18 | public enum BlurType 19 | { 20 | Standard = 0, 21 | Sgx = 1, 22 | } 23 | 24 | [Range(0.0f, 1.5f)] 25 | public float threshold = 0.25f; 26 | [Range(0.0f, 2.5f)] 27 | public float intensity = 0.75f; 28 | 29 | [Range(0.25f, 5.5f)] 30 | public float blurSize = 1.0f; 31 | 32 | Resolution resolution = Resolution.Low; 33 | [Range(1, 4)] 34 | public int blurIterations = 1; 35 | 36 | public BlurType blurType= BlurType.Standard; 37 | 38 | public Shader fastBloomShader = null; 39 | private Material fastBloomMaterial = null; 40 | 41 | 42 | public override bool CheckResources () 43 | { 44 | CheckSupport (false); 45 | 46 | fastBloomMaterial = CheckShaderAndCreateMaterial (fastBloomShader, fastBloomMaterial); 47 | 48 | if (!isSupported) 49 | ReportAutoDisable (); 50 | return isSupported; 51 | } 52 | 53 | void OnDisable () 54 | { 55 | if (fastBloomMaterial) 56 | DestroyImmediate (fastBloomMaterial); 57 | } 58 | 59 | void OnRenderImage (RenderTexture source, RenderTexture destination) 60 | { 61 | if (CheckResources() == false) 62 | { 63 | Graphics.Blit (source, destination); 64 | return; 65 | } 66 | 67 | int divider = resolution == Resolution.Low ? 4 : 2; 68 | float widthMod = resolution == Resolution.Low ? 0.5f : 1.0f; 69 | 70 | fastBloomMaterial.SetVector ("_Parameter", new Vector4 (blurSize * widthMod, 0.0f, threshold, intensity)); 71 | source.filterMode = FilterMode.Bilinear; 72 | 73 | var rtW= source.width/divider; 74 | var rtH= source.height/divider; 75 | 76 | // downsample 77 | RenderTexture rt = RenderTexture.GetTemporary (rtW, rtH, 0, source.format); 78 | rt.filterMode = FilterMode.Bilinear; 79 | Graphics.Blit (source, rt, fastBloomMaterial, 1); 80 | 81 | var passOffs= blurType == BlurType.Standard ? 0 : 2; 82 | 83 | for(int i = 0; i < blurIterations; i++) 84 | { 85 | fastBloomMaterial.SetVector ("_Parameter", new Vector4 (blurSize * widthMod + (i*1.0f), 0.0f, threshold, intensity)); 86 | 87 | // vertical blur 88 | RenderTexture rt2 = RenderTexture.GetTemporary (rtW, rtH, 0, source.format); 89 | rt2.filterMode = FilterMode.Bilinear; 90 | Graphics.Blit (rt, rt2, fastBloomMaterial, 2 + passOffs); 91 | RenderTexture.ReleaseTemporary (rt); 92 | rt = rt2; 93 | 94 | // horizontal blur 95 | rt2 = RenderTexture.GetTemporary (rtW, rtH, 0, source.format); 96 | rt2.filterMode = FilterMode.Bilinear; 97 | Graphics.Blit (rt, rt2, fastBloomMaterial, 3 + passOffs); 98 | RenderTexture.ReleaseTemporary (rt); 99 | rt = rt2; 100 | } 101 | 102 | fastBloomMaterial.SetTexture ("_Bloom", rt); 103 | 104 | Graphics.Blit (source, destination, fastBloomMaterial, 0); 105 | 106 | RenderTexture.ReleaseTemporary (rt); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4975a6e437fc3b149a8cd508ce5bdd69 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: 6 | - fastBloomShader: {fileID: 4800000, guid: 68a00c837b82e4c6d92e7da765dc5f1d, type: 3} 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.ImageEffects 6 | { 7 | [ExecuteInEditMode] 8 | [RequireComponent (typeof(Camera))] 9 | public class PostEffectsBase : MonoBehaviour 10 | { 11 | protected bool supportHDRTextures = true; 12 | protected bool supportDX11 = false; 13 | protected bool isSupported = true; 14 | 15 | private List createdMaterials = new List (); 16 | 17 | protected Material CheckShaderAndCreateMaterial ( Shader s, Material m2Create) 18 | { 19 | if (!s) 20 | { 21 | Debug.Log("Missing shader in " + ToString ()); 22 | enabled = false; 23 | return null; 24 | } 25 | 26 | if (s.isSupported && m2Create && m2Create.shader == s) 27 | return m2Create; 28 | 29 | if (!s.isSupported) 30 | { 31 | NotSupported (); 32 | Debug.Log("The shader " + s.ToString() + " on effect "+ToString()+" is not supported on this platform!"); 33 | return null; 34 | } 35 | 36 | m2Create = new Material (s); 37 | createdMaterials.Add (m2Create); 38 | m2Create.hideFlags = HideFlags.DontSave; 39 | 40 | return m2Create; 41 | } 42 | 43 | 44 | protected Material CreateMaterial (Shader s, Material m2Create) 45 | { 46 | if (!s) 47 | { 48 | Debug.Log ("Missing shader in " + ToString ()); 49 | return null; 50 | } 51 | 52 | if (m2Create && (m2Create.shader == s) && (s.isSupported)) 53 | return m2Create; 54 | 55 | if (!s.isSupported) 56 | { 57 | return null; 58 | } 59 | 60 | m2Create = new Material (s); 61 | createdMaterials.Add (m2Create); 62 | m2Create.hideFlags = HideFlags.DontSave; 63 | 64 | return m2Create; 65 | } 66 | 67 | void OnEnable () 68 | { 69 | isSupported = true; 70 | } 71 | 72 | void OnDestroy () 73 | { 74 | RemoveCreatedMaterials (); 75 | } 76 | 77 | private void RemoveCreatedMaterials () 78 | { 79 | while (createdMaterials.Count > 0) 80 | { 81 | Material mat = createdMaterials[0]; 82 | createdMaterials.RemoveAt (0); 83 | #if UNITY_EDITOR 84 | DestroyImmediate (mat); 85 | #else 86 | Destroy(mat); 87 | #endif 88 | } 89 | } 90 | 91 | protected bool CheckSupport () 92 | { 93 | return CheckSupport (false); 94 | } 95 | 96 | 97 | public virtual bool CheckResources () 98 | { 99 | Debug.LogWarning ("CheckResources () for " + ToString() + " should be overwritten."); 100 | return isSupported; 101 | } 102 | 103 | 104 | protected void Start () 105 | { 106 | CheckResources (); 107 | } 108 | 109 | protected bool CheckSupport (bool needDepth) 110 | { 111 | isSupported = true; 112 | supportHDRTextures = SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf); 113 | supportDX11 = SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders; 114 | 115 | if (!SystemInfo.supportsImageEffects) 116 | { 117 | NotSupported (); 118 | return false; 119 | } 120 | 121 | if (needDepth && !SystemInfo.SupportsRenderTextureFormat (RenderTextureFormat.Depth)) 122 | { 123 | NotSupported (); 124 | return false; 125 | } 126 | 127 | if (needDepth) 128 | GetComponent().depthTextureMode |= DepthTextureMode.Depth; 129 | 130 | return true; 131 | } 132 | 133 | protected bool CheckSupport (bool needDepth, bool needHdr) 134 | { 135 | if (!CheckSupport(needDepth)) 136 | return false; 137 | 138 | if (needHdr && !supportHDRTextures) 139 | { 140 | NotSupported (); 141 | return false; 142 | } 143 | 144 | return true; 145 | } 146 | 147 | 148 | public bool Dx11Support () 149 | { 150 | return supportDX11; 151 | } 152 | 153 | 154 | protected void ReportAutoDisable () 155 | { 156 | Debug.LogWarning ("The image effect " + ToString() + " has been disabled as it's not supported on the current platform."); 157 | } 158 | 159 | // deprecated but needed for old effects to survive upgrading 160 | bool CheckShader (Shader s) 161 | { 162 | Debug.Log("The shader " + s.ToString () + " on effect "+ ToString () + " is not part of the Unity 3.2+ effects suite anymore. For best performance and quality, please ensure you are using the latest Standard Assets Image Effects (Pro only) package."); 163 | if (!s.isSupported) 164 | { 165 | NotSupported (); 166 | return false; 167 | } 168 | else 169 | { 170 | return false; 171 | } 172 | } 173 | 174 | 175 | protected void NotSupported () 176 | { 177 | enabled = false; 178 | isSupported = false; 179 | return; 180 | } 181 | 182 | 183 | protected void DrawBorder (RenderTexture dest, Material material) 184 | { 185 | float x1; 186 | float x2; 187 | float y1; 188 | float y2; 189 | 190 | RenderTexture.active = dest; 191 | bool invertY = true; // source.texelSize.y < 0.0ff; 192 | // Set up the simple Matrix 193 | GL.PushMatrix(); 194 | GL.LoadOrtho(); 195 | 196 | for (int i = 0; i < material.passCount; i++) 197 | { 198 | material.SetPass(i); 199 | 200 | float y1_; float y2_; 201 | if (invertY) 202 | { 203 | y1_ = 1.0f; y2_ = 0.0f; 204 | } 205 | else 206 | { 207 | y1_ = 0.0f; y2_ = 1.0f; 208 | } 209 | 210 | // left 211 | x1 = 0.0f; 212 | x2 = 0.0f + 1.0f/(dest.width*1.0f); 213 | y1 = 0.0f; 214 | y2 = 1.0f; 215 | GL.Begin(GL.QUADS); 216 | 217 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 218 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 219 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 220 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 221 | 222 | // right 223 | x1 = 1.0f - 1.0f/(dest.width*1.0f); 224 | x2 = 1.0f; 225 | y1 = 0.0f; 226 | y2 = 1.0f; 227 | 228 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 229 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 230 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 231 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 232 | 233 | // top 234 | x1 = 0.0f; 235 | x2 = 1.0f; 236 | y1 = 0.0f; 237 | y2 = 0.0f + 1.0f/(dest.height*1.0f); 238 | 239 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 240 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 241 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 242 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 243 | 244 | // bottom 245 | x1 = 0.0f; 246 | x2 = 1.0f; 247 | y1 = 1.0f - 1.0f/(dest.height*1.0f); 248 | y2 = 1.0f; 249 | 250 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 251 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 252 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 253 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 254 | 255 | GL.End(); 256 | } 257 | 258 | GL.PopMatrix(); 259 | } 260 | } 261 | } 262 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6f4318ec6c2bf643a0f9edfeeaba0ec 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.ImageEffects 5 | { 6 | [ExecuteInEditMode] 7 | [RequireComponent (typeof(Camera))] 8 | class PostEffectsHelper : MonoBehaviour 9 | { 10 | void OnRenderImage (RenderTexture source, RenderTexture destination) 11 | { 12 | Debug.Log("OnRenderImage in Helper called ..."); 13 | } 14 | 15 | static void DrawLowLevelPlaneAlignedWithCamera ( 16 | float dist , 17 | RenderTexture source, RenderTexture dest , 18 | Material material , 19 | Camera cameraForProjectionMatrix ) 20 | { 21 | // Make the destination texture the target for all rendering 22 | RenderTexture.active = dest; 23 | // Assign the source texture to a property from a shader 24 | material.SetTexture("_MainTex", source); 25 | bool invertY = true; // source.texelSize.y < 0.0f; 26 | // Set up the simple Matrix 27 | GL.PushMatrix(); 28 | GL.LoadIdentity(); 29 | GL.LoadProjectionMatrix(cameraForProjectionMatrix.projectionMatrix); 30 | 31 | float fovYHalfRad = cameraForProjectionMatrix.fieldOfView * 0.5f * Mathf.Deg2Rad; 32 | float cotangent = Mathf.Cos(fovYHalfRad) / Mathf.Sin(fovYHalfRad); 33 | float asp = cameraForProjectionMatrix.aspect; 34 | 35 | float x1 = asp/-cotangent; 36 | float x2 = asp/cotangent; 37 | float y1 = 1.0f/-cotangent; 38 | float y2 = 1.0f/cotangent; 39 | 40 | float sc = 1.0f; // magic constant (for now) 41 | 42 | x1 *= dist * sc; 43 | x2 *= dist * sc; 44 | y1 *= dist * sc; 45 | y2 *= dist * sc; 46 | 47 | float z1 = -dist; 48 | 49 | for (int i = 0; i < material.passCount; i++) 50 | { 51 | material.SetPass(i); 52 | 53 | GL.Begin(GL.QUADS); 54 | float y1_; float y2_; 55 | if (invertY) 56 | { 57 | y1_ = 1.0f; y2_ = 0.0f; 58 | } 59 | else 60 | { 61 | y1_ = 0.0f; y2_ = 1.0f; 62 | } 63 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, z1); 64 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, z1); 65 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, z1); 66 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, z1); 67 | GL.End(); 68 | } 69 | 70 | GL.PopMatrix(); 71 | } 72 | 73 | static void DrawBorder ( 74 | RenderTexture dest , 75 | Material material ) 76 | { 77 | float x1; 78 | float x2; 79 | float y1; 80 | float y2; 81 | 82 | RenderTexture.active = dest; 83 | bool invertY = true; // source.texelSize.y < 0.0ff; 84 | // Set up the simple Matrix 85 | GL.PushMatrix(); 86 | GL.LoadOrtho(); 87 | 88 | for (int i = 0; i < material.passCount; i++) 89 | { 90 | material.SetPass(i); 91 | 92 | float y1_; float y2_; 93 | if (invertY) 94 | { 95 | y1_ = 1.0f; y2_ = 0.0f; 96 | } 97 | else 98 | { 99 | y1_ = 0.0f; y2_ = 1.0f; 100 | } 101 | 102 | // left 103 | x1 = 0.0f; 104 | x2 = 0.0f + 1.0f/(dest.width*1.0f); 105 | y1 = 0.0f; 106 | y2 = 1.0f; 107 | GL.Begin(GL.QUADS); 108 | 109 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 110 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 111 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 112 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 113 | 114 | // right 115 | x1 = 1.0f - 1.0f/(dest.width*1.0f); 116 | x2 = 1.0f; 117 | y1 = 0.0f; 118 | y2 = 1.0f; 119 | 120 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 121 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 122 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 123 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 124 | 125 | // top 126 | x1 = 0.0f; 127 | x2 = 1.0f; 128 | y1 = 0.0f; 129 | y2 = 0.0f + 1.0f/(dest.height*1.0f); 130 | 131 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 132 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 133 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 134 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 135 | 136 | // bottom 137 | x1 = 0.0f; 138 | x2 = 1.0f; 139 | y1 = 1.0f - 1.0f/(dest.height*1.0f); 140 | y2 = 1.0f; 141 | 142 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 143 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 144 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 145 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 146 | 147 | GL.End(); 148 | } 149 | 150 | GL.PopMatrix(); 151 | } 152 | 153 | static void DrawLowLevelQuad ( float x1, float x2, float y1, float y2, RenderTexture source, RenderTexture dest, Material material ) 154 | { 155 | // Make the destination texture the target for all rendering 156 | RenderTexture.active = dest; 157 | // Assign the source texture to a property from a shader 158 | material.SetTexture("_MainTex", source); 159 | bool invertY = true; // source.texelSize.y < 0.0f; 160 | // Set up the simple Matrix 161 | GL.PushMatrix(); 162 | GL.LoadOrtho(); 163 | 164 | for (int i = 0; i < material.passCount; i++) 165 | { 166 | material.SetPass(i); 167 | 168 | GL.Begin(GL.QUADS); 169 | float y1_; float y2_; 170 | if (invertY) 171 | { 172 | y1_ = 1.0f; y2_ = 0.0f; 173 | } 174 | else 175 | { 176 | y1_ = 0.0f; y2_ = 1.0f; 177 | } 178 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 179 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 180 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 181 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 182 | GL.End(); 183 | } 184 | 185 | GL.PopMatrix(); 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50b03df8f04b5c441aaac5b7fccb4734 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2145489f7c704db8acb14a52bddeee9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6ef58fc6f637406bbe6814a19c377f8 3 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Blend" { 2 | Properties { 3 | _MainTex ("Screen Blended", 2D) = "" {} 4 | _ColorBuffer ("Color", 2D) = "" {} 5 | } 6 | 7 | CGINCLUDE 8 | 9 | #include "UnityCG.cginc" 10 | 11 | struct v2f { 12 | float4 pos : SV_POSITION; 13 | float2 uv[2] : TEXCOORD0; 14 | }; 15 | struct v2f_mt { 16 | float4 pos : SV_POSITION; 17 | float2 uv[4] : TEXCOORD0; 18 | }; 19 | 20 | sampler2D _ColorBuffer; 21 | sampler2D _MainTex; 22 | 23 | half _Intensity; 24 | half4 _ColorBuffer_TexelSize; 25 | half4 _ColorBuffer_ST; 26 | half4 _MainTex_TexelSize; 27 | half4 _MainTex_ST; 28 | 29 | v2f vert( appdata_img v ) { 30 | v2f o; 31 | o.pos = UnityObjectToClipPos(v.vertex); 32 | o.uv[0] = v.texcoord.xy; 33 | o.uv[1] = v.texcoord.xy; 34 | 35 | #if UNITY_UV_STARTS_AT_TOP 36 | if (_ColorBuffer_TexelSize.y < 0) 37 | o.uv[1].y = 1-o.uv[1].y; 38 | #endif 39 | 40 | return o; 41 | } 42 | 43 | v2f_mt vertMultiTap( appdata_img v ) { 44 | v2f_mt o; 45 | o.pos = UnityObjectToClipPos(v.vertex); 46 | o.uv[0] = v.texcoord.xy + _MainTex_TexelSize.xy * 0.5; 47 | o.uv[1] = v.texcoord.xy - _MainTex_TexelSize.xy * 0.5; 48 | o.uv[2] = v.texcoord.xy - _MainTex_TexelSize.xy * half2(1,-1) * 0.5; 49 | o.uv[3] = v.texcoord.xy + _MainTex_TexelSize.xy * half2(1,-1) * 0.5; 50 | return o; 51 | } 52 | 53 | half4 fragScreen (v2f i) : SV_Target { 54 | half4 toBlend = saturate (tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0], _MainTex_ST)) * _Intensity); 55 | return 1-(1-toBlend)*(1-tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[1], _ColorBuffer_ST))); 56 | } 57 | 58 | half4 fragAdd (v2f i) : SV_Target { 59 | return tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)) * _Intensity + tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[1], _ColorBuffer_ST)); 60 | } 61 | 62 | half4 fragVignetteBlend (v2f i) : SV_Target { 63 | return tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)) * tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[0], _ColorBuffer_ST)); 64 | } 65 | 66 | half4 fragMultiTap (v2f_mt i) : SV_Target { 67 | half4 outColor = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)); 68 | outColor += tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[1].xy, _MainTex_ST)); 69 | outColor += tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[2].xy, _MainTex_ST)); 70 | outColor += tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[3].xy, _MainTex_ST)); 71 | return outColor * 0.25; 72 | } 73 | 74 | ENDCG 75 | 76 | Subshader { 77 | ZTest Always Cull Off ZWrite Off 78 | 79 | // 0: nicer & softer "screen" blend mode 80 | Pass { 81 | 82 | CGPROGRAM 83 | #pragma vertex vert 84 | #pragma fragment fragScreen 85 | ENDCG 86 | } 87 | 88 | // 1: simple "add" blend mode 89 | Pass { 90 | 91 | CGPROGRAM 92 | #pragma vertex vert 93 | #pragma fragment fragAdd 94 | ENDCG 95 | } 96 | // 2: used for "stable" downsampling 97 | Pass { 98 | 99 | CGPROGRAM 100 | #pragma vertex vertMultiTap 101 | #pragma fragment fragMultiTap 102 | ENDCG 103 | } 104 | // 3: vignette blending 105 | Pass { 106 | 107 | CGPROGRAM 108 | #pragma vertex vert 109 | #pragma fragment fragVignetteBlend 110 | ENDCG 111 | } 112 | } 113 | 114 | Fallback off 115 | 116 | } // shader 117 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/Blend.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53b3960ee3d3d4a5caa8d5473d120187 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/BlendForBloom" { 2 | Properties { 3 | _MainTex ("Screen Blended", 2D) = "" {} 4 | _ColorBuffer ("Color", 2D) = "" {} 5 | } 6 | 7 | CGINCLUDE 8 | 9 | #include "UnityCG.cginc" 10 | 11 | struct v2f { 12 | float4 pos : SV_POSITION; 13 | float2 uv[2] : TEXCOORD0; 14 | }; 15 | struct v2f_mt { 16 | float4 pos : SV_POSITION; 17 | float2 uv[5] : TEXCOORD0; 18 | }; 19 | 20 | sampler2D _ColorBuffer; 21 | sampler2D _MainTex; 22 | 23 | half _Intensity; 24 | half4 _ColorBuffer_TexelSize; 25 | half4 _ColorBuffer_ST; 26 | half4 _MainTex_TexelSize; 27 | half4 _MainTex_ST; 28 | 29 | v2f vert( appdata_img v ) { 30 | v2f o; 31 | o.pos = UnityObjectToClipPos(v.vertex); 32 | o.uv[0] = v.texcoord.xy; 33 | o.uv[1] = v.texcoord.xy; 34 | 35 | #if UNITY_UV_STARTS_AT_TOP 36 | if (_ColorBuffer_TexelSize.y < 0) 37 | o.uv[1].y = 1-o.uv[1].y; 38 | #endif 39 | 40 | return o; 41 | } 42 | 43 | v2f_mt vertMultiTap( appdata_img v ) { 44 | v2f_mt o; 45 | o.pos = UnityObjectToClipPos(v.vertex); 46 | o.uv[4] = v.texcoord.xy; 47 | o.uv[0] = v.texcoord.xy + _MainTex_TexelSize.xy * 0.5; 48 | o.uv[1] = v.texcoord.xy - _MainTex_TexelSize.xy * 0.5; 49 | o.uv[2] = v.texcoord.xy - _MainTex_TexelSize.xy * half2(1,-1) * 0.5; 50 | o.uv[3] = v.texcoord.xy + _MainTex_TexelSize.xy * half2(1,-1) * 0.5; 51 | return o; 52 | } 53 | 54 | half4 fragScreen (v2f i) : SV_Target { 55 | half4 addedbloom = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)) * _Intensity; 56 | half4 screencolor = tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[1], _ColorBuffer_ST)); 57 | return 1-(1-addedbloom)*(1-screencolor); 58 | } 59 | 60 | half4 fragScreenCheap(v2f i) : SV_Target { 61 | half4 addedbloom = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)) * _Intensity; 62 | half4 screencolor = tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[1], _ColorBuffer_ST)); 63 | return 1-(1-addedbloom)*(1-screencolor); 64 | } 65 | 66 | half4 fragAdd (v2f i) : SV_Target { 67 | half4 addedbloom = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)); 68 | half4 screencolor = tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[1], _ColorBuffer_ST)); 69 | return _Intensity * addedbloom + screencolor; 70 | } 71 | 72 | half4 fragAddCheap (v2f i) : SV_Target { 73 | half4 addedbloom = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)); 74 | half4 screencolor = tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[1], _ColorBuffer_ST)); 75 | return _Intensity * addedbloom + screencolor; 76 | } 77 | 78 | half4 fragVignetteMul (v2f i) : SV_Target { 79 | return tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)) * tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[0], _ColorBuffer_ST)); 80 | } 81 | 82 | half4 fragVignetteBlend (v2f i) : SV_Target { 83 | return half4(1,1,1, tex2D(_ColorBuffer, UnityStereoScreenSpaceUVAdjust(i.uv[0], _ColorBuffer_ST)).r); 84 | } 85 | 86 | half4 fragClear (v2f i) : SV_Target { 87 | return 0; 88 | } 89 | 90 | half4 fragAddOneOne (v2f i) : SV_Target { 91 | half4 addedColors = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)); 92 | return addedColors * _Intensity; 93 | } 94 | 95 | half4 frag1Tap (v2f i) : SV_Target { 96 | return tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)); 97 | } 98 | 99 | half4 fragMultiTapMax (v2f_mt i) : SV_Target { 100 | half4 outColor = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[4].xy, _MainTex_ST)); 101 | outColor = max(outColor, tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST))); 102 | outColor = max(outColor, tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[1].xy, _MainTex_ST))); 103 | outColor = max(outColor, tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[2].xy, _MainTex_ST))); 104 | outColor = max(outColor, tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[3].xy, _MainTex_ST))); 105 | return outColor; 106 | } 107 | 108 | half4 fragMultiTapBlur (v2f_mt i) : SV_Target { 109 | half4 outColor = 0; 110 | outColor += tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[0].xy, _MainTex_ST)); 111 | outColor += tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[1].xy, _MainTex_ST)); 112 | outColor += tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[2].xy, _MainTex_ST)); 113 | outColor += tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv[3].xy, _MainTex_ST)); 114 | return outColor/4; 115 | } 116 | 117 | ENDCG 118 | 119 | Subshader { 120 | ZTest Always Cull Off ZWrite Off 121 | 122 | // 0: nicer & softer "screen" blend mode 123 | Pass { 124 | 125 | CGPROGRAM 126 | #pragma vertex vert 127 | #pragma fragment fragScreen 128 | ENDCG 129 | } 130 | 131 | // 1: "add" blend mode 132 | Pass { 133 | 134 | CGPROGRAM 135 | #pragma vertex vert 136 | #pragma fragment fragAdd 137 | ENDCG 138 | } 139 | // 2: several taps, maxxed 140 | Pass { 141 | 142 | CGPROGRAM 143 | #pragma vertex vertMultiTap 144 | #pragma fragment fragMultiTapMax 145 | ENDCG 146 | } 147 | // 3: vignette blending 148 | Pass { 149 | 150 | CGPROGRAM 151 | #pragma vertex vert 152 | #pragma fragment fragVignetteMul 153 | ENDCG 154 | } 155 | // 4: nicer & softer "screen" blend mode(cheapest) 156 | Pass { 157 | 158 | CGPROGRAM 159 | #pragma vertex vert 160 | #pragma fragment fragScreenCheap 161 | ENDCG 162 | } 163 | // 5: "add" blend mode (cheapest) 164 | Pass { 165 | 166 | CGPROGRAM 167 | #pragma vertex vert 168 | #pragma fragment fragAddCheap 169 | ENDCG 170 | } 171 | // 6: used for "stable" downsampling (blur) 172 | Pass { 173 | 174 | CGPROGRAM 175 | #pragma vertex vertMultiTap 176 | #pragma fragment fragMultiTapBlur 177 | ENDCG 178 | } 179 | // 7: vignette blending (blend to dest) 180 | Pass { 181 | 182 | Blend Zero SrcAlpha 183 | 184 | CGPROGRAM 185 | #pragma vertex vert 186 | #pragma fragment fragVignetteBlend 187 | ENDCG 188 | } 189 | // 8: clear 190 | Pass { 191 | 192 | CGPROGRAM 193 | #pragma vertex vert 194 | #pragma fragment fragClear 195 | ENDCG 196 | } 197 | // 9: fragAddOneOne 198 | Pass { 199 | 200 | Blend One One 201 | 202 | CGPROGRAM 203 | #pragma vertex vert 204 | #pragma fragment fragAddOneOne 205 | ENDCG 206 | } 207 | // 10: max blend 208 | Pass { 209 | 210 | BlendOp Max 211 | Blend One One 212 | 213 | CGPROGRAM 214 | #pragma vertex vert 215 | #pragma fragment frag1Tap 216 | ENDCG 217 | } 218 | } 219 | 220 | Fallback off 221 | 222 | } // shader 223 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendForBloom.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7856cbff0a0ca45c787d5431eb805bb0 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/BlendOneOne" { 2 | Properties { 3 | _MainTex ("-", 2D) = "" {} 4 | } 5 | 6 | CGINCLUDE 7 | 8 | #include "UnityCG.cginc" 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 uv : TEXCOORD0; 13 | }; 14 | 15 | sampler2D _MainTex; 16 | half4 _MainTex_ST; 17 | half _Intensity; 18 | 19 | v2f vert( appdata_img v ) { 20 | v2f o; 21 | o.pos = UnityObjectToClipPos(v.vertex); 22 | o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 23 | return o; 24 | } 25 | 26 | half4 frag(v2f i) : SV_Target { 27 | return tex2D(_MainTex, i.uv) * _Intensity; 28 | } 29 | 30 | ENDCG 31 | 32 | Subshader { 33 | 34 | Pass { 35 | BlendOp Add 36 | Blend One One 37 | 38 | ZTest Always Cull Off ZWrite Off 39 | 40 | CGPROGRAM 41 | #pragma vertex vert 42 | #pragma fragment frag 43 | ENDCG 44 | } 45 | } 46 | 47 | Fallback off 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlendOneOne.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7898d203e9b94c0dbe2bf9dd5cb32c0 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/BlurAndFlares" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "" {} 4 | _NonBlurredTex ("Base (RGB)", 2D) = "" {} 5 | } 6 | 7 | CGINCLUDE 8 | 9 | #include "UnityCG.cginc" 10 | 11 | struct v2f { 12 | half4 pos : SV_POSITION; 13 | half2 uv : TEXCOORD0; 14 | }; 15 | 16 | struct v2f_opts { 17 | half4 pos : SV_POSITION; 18 | half2 uv[7] : TEXCOORD0; 19 | }; 20 | 21 | struct v2f_blur { 22 | half4 pos : SV_POSITION; 23 | half2 uv : TEXCOORD0; 24 | half4 uv01 : TEXCOORD1; 25 | half4 uv23 : TEXCOORD2; 26 | half4 uv45 : TEXCOORD3; 27 | half4 uv67 : TEXCOORD4; 28 | }; 29 | 30 | half4 _Offsets; 31 | half4 _TintColor; 32 | 33 | half _StretchWidth; 34 | half2 _Threshhold; 35 | half _Saturation; 36 | 37 | half4 _MainTex_TexelSize; 38 | half4 _MainTex_ST; 39 | 40 | sampler2D _MainTex; 41 | sampler2D _NonBlurredTex; 42 | 43 | v2f vert (appdata_img v) { 44 | v2f o; 45 | o.pos = UnityObjectToClipPos(v.vertex); 46 | o.uv = v.texcoord.xy; 47 | return o; 48 | } 49 | 50 | v2f_blur vertWithMultiCoords2 (appdata_img v) { 51 | v2f_blur o; 52 | o.pos = UnityObjectToClipPos(v.vertex); 53 | o.uv.xy = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 54 | o.uv01 = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + _Offsets.xyxy * half4(1,1, -1,-1), _MainTex_ST); 55 | o.uv23 = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + _Offsets.xyxy * half4(1,1, -1,-1) * 2.0, _MainTex_ST); 56 | o.uv45 = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + _Offsets.xyxy * half4(1,1, -1,-1) * 3.0, _MainTex_ST); 57 | o.uv67 = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + _Offsets.xyxy * half4(1,1, -1,-1) * 4.0, _MainTex_ST); 58 | o.uv67 = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + _Offsets.xyxy * half4(1,1, -1,-1) * 5.0, _MainTex_ST); 59 | return o; 60 | } 61 | 62 | v2f_opts vertStretch (appdata_img v) { 63 | v2f_opts o; 64 | o.pos = UnityObjectToClipPos(v.vertex); 65 | half b = _StretchWidth; 66 | o.uv[0] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 67 | o.uv[1] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + b * 2.0 * _Offsets.xy, _MainTex_ST); 68 | o.uv[2] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - b * 2.0 * _Offsets.xy, _MainTex_ST); 69 | o.uv[3] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + b * 4.0 * _Offsets.xy, _MainTex_ST); 70 | o.uv[4] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - b * 4.0 * _Offsets.xy, _MainTex_ST); 71 | o.uv[5] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + b * 6.0 * _Offsets.xy, _MainTex_ST); 72 | o.uv[6] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - b * 6.0 * _Offsets.xy, _MainTex_ST); 73 | return o; 74 | } 75 | 76 | v2f_opts vertWithMultiCoords (appdata_img v) { 77 | v2f_opts o; 78 | o.pos = UnityObjectToClipPos(v.vertex); 79 | o.uv[0] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 80 | o.uv[1] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + 0.5 * _MainTex_TexelSize.xy * _Offsets.xy, _MainTex_ST); 81 | o.uv[2] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - 0.5 * _MainTex_TexelSize.xy * _Offsets.xy, _MainTex_ST); 82 | o.uv[3] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + 1.5 * _MainTex_TexelSize.xy * _Offsets.xy, _MainTex_ST); 83 | o.uv[4] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - 1.5 * _MainTex_TexelSize.xy * _Offsets.xy, _MainTex_ST); 84 | o.uv[5] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + 2.5 * _MainTex_TexelSize.xy * _Offsets.xy, _MainTex_ST); 85 | o.uv[6] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - 2.5 * _MainTex_TexelSize.xy * _Offsets.xy, _MainTex_ST); 86 | return o; 87 | } 88 | 89 | half4 fragPostNoBlur (v2f i) : SV_Target { 90 | half4 color = tex2D (_MainTex, i.uv); 91 | return color * 1.0/(1.0 + Luminance(color.rgb) + 0.5); // this also makes it a little noisy 92 | } 93 | 94 | half4 fragGaussBlur (v2f_blur i) : SV_Target { 95 | half4 color = half4 (0,0,0,0); 96 | color += 0.225 * tex2D (_MainTex, i.uv); 97 | color += 0.150 * tex2D (_MainTex, i.uv01.xy); 98 | color += 0.150 * tex2D (_MainTex, i.uv01.zw); 99 | color += 0.110 * tex2D (_MainTex, i.uv23.xy); 100 | color += 0.110 * tex2D (_MainTex, i.uv23.zw); 101 | color += 0.075 * tex2D (_MainTex, i.uv45.xy); 102 | color += 0.075 * tex2D (_MainTex, i.uv45.zw); 103 | color += 0.0525 * tex2D (_MainTex, i.uv67.xy); 104 | color += 0.0525 * tex2D (_MainTex, i.uv67.zw); 105 | return color; 106 | } 107 | 108 | half4 fragPreAndCut (v2f_opts i) : SV_Target { 109 | half4 color = tex2D (_MainTex, i.uv[0]); 110 | color += tex2D (_MainTex, i.uv[1]); 111 | color += tex2D (_MainTex, i.uv[2]); 112 | color += tex2D (_MainTex, i.uv[3]); 113 | color += tex2D (_MainTex, i.uv[4]); 114 | color += tex2D (_MainTex, i.uv[5]); 115 | color += tex2D (_MainTex, i.uv[6]); 116 | color = max(color / 7.0 - _Threshhold.xxxx, float4(0,0,0,0)); 117 | half lum = Luminance(color.rgb); 118 | color.rgb = lerp(half3(lum,lum,lum), color.rgb, _Saturation) * _TintColor.rgb; 119 | return color; 120 | } 121 | 122 | half4 fragStretch (v2f_opts i) : SV_Target { 123 | half4 color = tex2D (_MainTex, i.uv[0]); 124 | color = max (color, tex2D (_MainTex, i.uv[1])); 125 | color = max (color, tex2D (_MainTex, i.uv[2])); 126 | color = max (color, tex2D (_MainTex, i.uv[3])); 127 | color = max (color, tex2D (_MainTex, i.uv[4])); 128 | color = max (color, tex2D (_MainTex, i.uv[5])); 129 | color = max (color, tex2D (_MainTex, i.uv[6])); 130 | return color; 131 | } 132 | 133 | half4 fragPost (v2f_opts i) : SV_Target { 134 | half4 color = tex2D (_MainTex, i.uv[0]); 135 | color += tex2D (_MainTex, i.uv[1]); 136 | color += tex2D (_MainTex, i.uv[2]); 137 | color += tex2D (_MainTex, i.uv[3]); 138 | color += tex2D (_MainTex, i.uv[4]); 139 | color += tex2D (_MainTex, i.uv[5]); 140 | color += tex2D (_MainTex, i.uv[6]); 141 | return color * 1.0/(7.0 + Luminance(color.rgb) + 0.5); // this also makes it a little noisy 142 | } 143 | 144 | ENDCG 145 | 146 | Subshader { 147 | ZTest Always Cull Off ZWrite Off 148 | Pass { 149 | 150 | CGPROGRAM 151 | 152 | #pragma vertex vert 153 | #pragma fragment fragPostNoBlur 154 | 155 | ENDCG 156 | } 157 | 158 | Pass { 159 | 160 | CGPROGRAM 161 | 162 | #pragma vertex vertStretch 163 | #pragma fragment fragStretch 164 | 165 | ENDCG 166 | } 167 | 168 | // 2 169 | Pass { 170 | 171 | CGPROGRAM 172 | 173 | #pragma vertex vertWithMultiCoords 174 | #pragma fragment fragPreAndCut 175 | 176 | ENDCG 177 | } 178 | 179 | // 3 180 | Pass { 181 | 182 | CGPROGRAM 183 | 184 | #pragma vertex vertWithMultiCoords 185 | #pragma fragment fragPost 186 | 187 | ENDCG 188 | } 189 | // 4 190 | Pass { 191 | 192 | CGPROGRAM 193 | 194 | #pragma vertex vertWithMultiCoords2 195 | #pragma fragment fragGaussBlur 196 | 197 | ENDCG 198 | } 199 | } 200 | 201 | Fallback off 202 | 203 | } 204 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BlurAndFlares.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be6e39cf196f146d5be72fbefb18ed75 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/BrightPassFilterForBloom" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Base (RGB)", 2D) = "" {} 6 | } 7 | 8 | CGINCLUDE 9 | 10 | #include "UnityCG.cginc" 11 | 12 | struct v2f 13 | { 14 | float4 pos : SV_POSITION; 15 | float2 uv : TEXCOORD0; 16 | }; 17 | 18 | sampler2D _MainTex; 19 | half4 _MainTex_ST; 20 | 21 | half4 threshold; 22 | half useSrcAlphaAsMask; 23 | 24 | v2f vert( appdata_img v ) 25 | { 26 | v2f o; 27 | o.pos = UnityObjectToClipPos(v.vertex); 28 | o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 29 | return o; 30 | } 31 | 32 | half4 frag(v2f i) : SV_Target 33 | { 34 | half4 color = tex2D(_MainTex, i.uv); 35 | //color = color * saturate((color-threshhold.x) * 75.0); // didn't go well with HDR and din't make sense 36 | color = color * lerp(1.0, color.a, useSrcAlphaAsMask); 37 | color = max(half4(0,0,0,0), color-threshold.x); 38 | return color; 39 | } 40 | 41 | ENDCG 42 | 43 | Subshader 44 | { 45 | Pass 46 | { 47 | ZTest Always Cull Off ZWrite Off 48 | 49 | CGPROGRAM 50 | 51 | #pragma vertex vert 52 | #pragma fragment frag 53 | 54 | ENDCG 55 | } 56 | } 57 | Fallback off 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 186c4c0d31e314f049595dcbaf4ca129 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/BrightPassFilter2" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Base (RGB)", 2D) = "" {} 6 | } 7 | 8 | CGINCLUDE 9 | 10 | #include "UnityCG.cginc" 11 | 12 | struct v2f 13 | { 14 | float4 pos : SV_POSITION; 15 | float2 uv : TEXCOORD0; 16 | }; 17 | 18 | sampler2D _MainTex; 19 | half4 _MainTex_ST; 20 | 21 | half4 _Threshhold; 22 | 23 | v2f vert( appdata_img v ) 24 | { 25 | v2f o; 26 | o.pos = UnityObjectToClipPos(v.vertex); 27 | o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 28 | return o; 29 | } 30 | 31 | half4 fragScalarThresh(v2f i) : SV_Target 32 | { 33 | half4 color = tex2D(_MainTex, i.uv); 34 | color.rgb = color.rgb; 35 | color.rgb = max(half3(0,0,0), color.rgb-_Threshhold.xxx); 36 | return color; 37 | } 38 | 39 | half4 fragColorThresh(v2f i) : SV_Target 40 | { 41 | half4 color = tex2D(_MainTex, i.uv); 42 | color.rgb = max(half3(0,0,0), color.rgb-_Threshhold.rgb); 43 | return color; 44 | } 45 | 46 | ENDCG 47 | 48 | Subshader 49 | { 50 | Pass 51 | { 52 | ZTest Always Cull Off ZWrite Off 53 | 54 | CGPROGRAM 55 | 56 | #pragma vertex vert 57 | #pragma fragment fragScalarThresh 58 | 59 | ENDCG 60 | } 61 | 62 | Pass 63 | { 64 | ZTest Always Cull Off ZWrite Off 65 | 66 | CGPROGRAM 67 | 68 | #pragma vertex vert 69 | #pragma fragment fragColorThresh 70 | 71 | ENDCG 72 | } 73 | } 74 | Fallback off 75 | } 76 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/BrightPassFilter2.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0aeaa4cb29f5d4e9c8455f04c8575c8c 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/LensFlareCreate" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "" {} 4 | } 5 | 6 | CGINCLUDE 7 | 8 | #include "UnityCG.cginc" 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 uv[4] : TEXCOORD0; 13 | }; 14 | 15 | fixed4 colorA; 16 | fixed4 colorB; 17 | fixed4 colorC; 18 | fixed4 colorD; 19 | 20 | sampler2D _MainTex; 21 | half4 _MainTex_ST; 22 | 23 | v2f vert( appdata_img v ) { 24 | v2f o; 25 | o.pos = UnityObjectToClipPos(v.vertex); 26 | 27 | o.uv[0] = UnityStereoScreenSpaceUVAdjust(( ( v.texcoord.xy - 0.5 ) * -0.85 ) + 0.5, _MainTex_ST); 28 | o.uv[1] = UnityStereoScreenSpaceUVAdjust(( ( v.texcoord.xy - 0.5 ) * -1.45 ) + 0.5, _MainTex_ST); 29 | o.uv[2] = UnityStereoScreenSpaceUVAdjust(( ( v.texcoord.xy - 0.5 ) * -2.55 ) + 0.5, _MainTex_ST); 30 | o.uv[3] = UnityStereoScreenSpaceUVAdjust(( ( v.texcoord.xy - 0.5 ) * -4.15 ) + 0.5, _MainTex_ST); 31 | return o; 32 | } 33 | 34 | fixed4 frag(v2f i) : SV_Target { 35 | fixed4 color = float4 (0,0,0,0); 36 | color += tex2D(_MainTex, i.uv[0] ) * colorA; 37 | color += tex2D(_MainTex, i.uv[1] ) * colorB; 38 | color += tex2D(_MainTex, i.uv[2] ) * colorC; 39 | color += tex2D(_MainTex, i.uv[3] ) * colorD; 40 | return color; 41 | } 42 | 43 | ENDCG 44 | 45 | Subshader { 46 | Blend One One 47 | Pass { 48 | ZTest Always Cull Off ZWrite Off 49 | 50 | CGPROGRAM 51 | 52 | #pragma vertex vert 53 | #pragma fragment frag 54 | 55 | ENDCG 56 | } 57 | } 58 | 59 | Fallback off 60 | 61 | } // shader 62 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/LensFlareCreate.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 459fe69d2f6d74ddb92f04dbf45a866b 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Hidden/FastBloom" { 3 | Properties { 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _Bloom ("Bloom (RGB)", 2D) = "black" {} 6 | } 7 | 8 | CGINCLUDE 9 | 10 | #include "UnityCG.cginc" 11 | 12 | sampler2D _MainTex; 13 | sampler2D _Bloom; 14 | 15 | uniform half4 _MainTex_TexelSize; 16 | half4 _MainTex_ST; 17 | 18 | uniform half4 _Parameter; 19 | uniform half4 _OffsetsA; 20 | uniform half4 _OffsetsB; 21 | 22 | #define ONE_MINUS_THRESHHOLD_TIMES_INTENSITY _Parameter.w 23 | #define THRESHHOLD _Parameter.z 24 | 25 | struct v2f_simple 26 | { 27 | float4 pos : SV_POSITION; 28 | half2 uv : TEXCOORD0; 29 | 30 | #if UNITY_UV_STARTS_AT_TOP 31 | half2 uv2 : TEXCOORD1; 32 | #endif 33 | }; 34 | 35 | v2f_simple vertBloom ( appdata_img v ) 36 | { 37 | v2f_simple o; 38 | 39 | o.pos = UnityObjectToClipPos(v.vertex); 40 | o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST); 41 | 42 | #if UNITY_UV_STARTS_AT_TOP 43 | o.uv2 = o.uv; 44 | if (_MainTex_TexelSize.y < 0.0) 45 | o.uv.y = 1.0 - o.uv.y; 46 | #endif 47 | 48 | return o; 49 | } 50 | 51 | struct v2f_tap 52 | { 53 | float4 pos : SV_POSITION; 54 | half2 uv20 : TEXCOORD0; 55 | half2 uv21 : TEXCOORD1; 56 | half2 uv22 : TEXCOORD2; 57 | half2 uv23 : TEXCOORD3; 58 | }; 59 | 60 | v2f_tap vert4Tap ( appdata_img v ) 61 | { 62 | v2f_tap o; 63 | 64 | o.pos = UnityObjectToClipPos(v.vertex); 65 | o.uv20 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy, _MainTex_ST); 66 | o.uv21 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy * half2(-0.5h,-0.5h), _MainTex_ST); 67 | o.uv22 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy * half2(0.5h,-0.5h), _MainTex_ST); 68 | o.uv23 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy * half2(-0.5h,0.5h), _MainTex_ST); 69 | 70 | return o; 71 | } 72 | 73 | fixed4 fragBloom ( v2f_simple i ) : SV_Target 74 | { 75 | #if UNITY_UV_STARTS_AT_TOP 76 | 77 | fixed4 color = tex2D(_MainTex, i.uv2); 78 | return color + tex2D(_Bloom, i.uv); 79 | 80 | #else 81 | 82 | fixed4 color = tex2D(_MainTex, i.uv); 83 | return color + tex2D(_Bloom, i.uv); 84 | 85 | #endif 86 | } 87 | 88 | fixed4 fragDownsample ( v2f_tap i ) : SV_Target 89 | { 90 | fixed4 color = tex2D (_MainTex, i.uv20); 91 | color += tex2D (_MainTex, i.uv21); 92 | color += tex2D (_MainTex, i.uv22); 93 | color += tex2D (_MainTex, i.uv23); 94 | return max(color/4 - THRESHHOLD, 0) * ONE_MINUS_THRESHHOLD_TIMES_INTENSITY; 95 | } 96 | 97 | // weight curves 98 | 99 | static const half curve[7] = { 0.0205, 0.0855, 0.232, 0.324, 0.232, 0.0855, 0.0205 }; // gauss'ish blur weights 100 | 101 | static const half4 curve4[7] = { half4(0.0205,0.0205,0.0205,0), half4(0.0855,0.0855,0.0855,0), half4(0.232,0.232,0.232,0), 102 | half4(0.324,0.324,0.324,1), half4(0.232,0.232,0.232,0), half4(0.0855,0.0855,0.0855,0), half4(0.0205,0.0205,0.0205,0) }; 103 | 104 | struct v2f_withBlurCoords8 105 | { 106 | float4 pos : SV_POSITION; 107 | half4 uv : TEXCOORD0; 108 | half2 offs : TEXCOORD1; 109 | }; 110 | 111 | struct v2f_withBlurCoordsSGX 112 | { 113 | float4 pos : SV_POSITION; 114 | half2 uv : TEXCOORD0; 115 | half4 offs[3] : TEXCOORD1; 116 | }; 117 | 118 | v2f_withBlurCoords8 vertBlurHorizontal (appdata_img v) 119 | { 120 | v2f_withBlurCoords8 o; 121 | o.pos = UnityObjectToClipPos(v.vertex); 122 | 123 | o.uv = half4(v.texcoord.xy,1,1); 124 | o.offs = _MainTex_TexelSize.xy * half2(1.0, 0.0) * _Parameter.x; 125 | 126 | return o; 127 | } 128 | 129 | v2f_withBlurCoords8 vertBlurVertical (appdata_img v) 130 | { 131 | v2f_withBlurCoords8 o; 132 | o.pos = UnityObjectToClipPos(v.vertex); 133 | 134 | o.uv = half4(v.texcoord.xy,1,1); 135 | o.offs = _MainTex_TexelSize.xy * half2(0.0, 1.0) * _Parameter.x; 136 | 137 | return o; 138 | } 139 | 140 | half4 fragBlur8 ( v2f_withBlurCoords8 i ) : SV_Target 141 | { 142 | half2 uv = i.uv.xy; 143 | half2 netFilterWidth = i.offs; 144 | half2 coords = uv - netFilterWidth * 3.0; 145 | 146 | half4 color = 0; 147 | for( int l = 0; l < 7; l++ ) 148 | { 149 | half4 tap = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(coords, _MainTex_ST)); 150 | color += tap * curve4[l]; 151 | coords += netFilterWidth; 152 | } 153 | return color; 154 | } 155 | 156 | 157 | v2f_withBlurCoordsSGX vertBlurHorizontalSGX (appdata_img v) 158 | { 159 | v2f_withBlurCoordsSGX o; 160 | o.pos = UnityObjectToClipPos(v.vertex); 161 | 162 | o.uv = v.texcoord.xy; 163 | 164 | half offsetMagnitude = _MainTex_TexelSize.x * _Parameter.x; 165 | o.offs[0] = v.texcoord.xyxy + offsetMagnitude * half4(-3.0h, 0.0h, 3.0h, 0.0h); 166 | o.offs[1] = v.texcoord.xyxy + offsetMagnitude * half4(-2.0h, 0.0h, 2.0h, 0.0h); 167 | o.offs[2] = v.texcoord.xyxy + offsetMagnitude * half4(-1.0h, 0.0h, 1.0h, 0.0h); 168 | 169 | return o; 170 | } 171 | 172 | v2f_withBlurCoordsSGX vertBlurVerticalSGX (appdata_img v) 173 | { 174 | v2f_withBlurCoordsSGX o; 175 | o.pos = UnityObjectToClipPos(v.vertex); 176 | 177 | o.uv = half4(v.texcoord.xy,1,1); 178 | 179 | half offsetMagnitude = _MainTex_TexelSize.y * _Parameter.x; 180 | o.offs[0] = v.texcoord.xyxy + offsetMagnitude * half4(0.0h, -3.0h, 0.0h, 3.0h); 181 | o.offs[1] = v.texcoord.xyxy + offsetMagnitude * half4(0.0h, -2.0h, 0.0h, 2.0h); 182 | o.offs[2] = v.texcoord.xyxy + offsetMagnitude * half4(0.0h, -1.0h, 0.0h, 1.0h); 183 | 184 | return o; 185 | } 186 | 187 | half4 fragBlurSGX ( v2f_withBlurCoordsSGX i ) : SV_Target 188 | { 189 | half2 uv = i.uv.xy; 190 | 191 | half4 color = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv, _MainTex_ST)) * curve4[3]; 192 | 193 | for( int l = 0; l < 3; l++ ) 194 | { 195 | half4 tapA = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.offs[l].xy, _MainTex_ST)); 196 | half4 tapB = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.offs[l].zw, _MainTex_ST)); 197 | color += (tapA + tapB) * curve4[l]; 198 | } 199 | 200 | return color; 201 | 202 | } 203 | 204 | ENDCG 205 | 206 | SubShader { 207 | ZTest Off Cull Off ZWrite Off Blend Off 208 | 209 | // 0 210 | Pass { 211 | 212 | CGPROGRAM 213 | #pragma vertex vertBloom 214 | #pragma fragment fragBloom 215 | 216 | ENDCG 217 | 218 | } 219 | 220 | // 1 221 | Pass { 222 | 223 | CGPROGRAM 224 | 225 | #pragma vertex vert4Tap 226 | #pragma fragment fragDownsample 227 | 228 | ENDCG 229 | 230 | } 231 | 232 | // 2 233 | Pass { 234 | ZTest Always 235 | Cull Off 236 | 237 | CGPROGRAM 238 | 239 | #pragma vertex vertBlurVertical 240 | #pragma fragment fragBlur8 241 | 242 | ENDCG 243 | } 244 | 245 | // 3 246 | Pass { 247 | ZTest Always 248 | Cull Off 249 | 250 | CGPROGRAM 251 | 252 | #pragma vertex vertBlurHorizontal 253 | #pragma fragment fragBlur8 254 | 255 | ENDCG 256 | } 257 | 258 | // alternate blur 259 | // 4 260 | Pass { 261 | ZTest Always 262 | Cull Off 263 | 264 | CGPROGRAM 265 | 266 | #pragma vertex vertBlurVerticalSGX 267 | #pragma fragment fragBlurSGX 268 | 269 | ENDCG 270 | } 271 | 272 | // 5 273 | Pass { 274 | ZTest Always 275 | Cull Off 276 | 277 | CGPROGRAM 278 | 279 | #pragma vertex vertBlurHorizontalSGX 280 | #pragma fragment fragBlurSGX 281 | 282 | ENDCG 283 | } 284 | } 285 | 286 | FallBack Off 287 | } 288 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBloom.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68a00c837b82e4c6d92e7da765dc5f1d 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Hidden/FastBlur" { 3 | Properties { 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _Bloom ("Bloom (RGB)", 2D) = "black" {} 6 | } 7 | 8 | CGINCLUDE 9 | 10 | #include "UnityCG.cginc" 11 | 12 | sampler2D _MainTex; 13 | sampler2D _Bloom; 14 | 15 | uniform half4 _MainTex_TexelSize; 16 | half4 _MainTex_ST; 17 | 18 | half4 _Bloom_ST; 19 | 20 | uniform half4 _Parameter; 21 | 22 | 23 | 24 | struct v2f_tap 25 | { 26 | float4 pos : SV_POSITION; 27 | half2 uv20 : TEXCOORD0; 28 | half2 uv21 : TEXCOORD1; 29 | half2 uv22 : TEXCOORD2; 30 | half2 uv23 : TEXCOORD3; 31 | }; 32 | 33 | v2f_tap vert4Tap ( appdata_img v ) 34 | { 35 | v2f_tap o; 36 | 37 | o.pos = UnityObjectToClipPos(v.vertex); 38 | o.uv20 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy, _MainTex_ST); 39 | o.uv21 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy * half2(-0.5h,-0.5h), _MainTex_ST); 40 | o.uv22 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy * half2(0.5h,-0.5h), _MainTex_ST); 41 | o.uv23 = UnityStereoScreenSpaceUVAdjust(v.texcoord + _MainTex_TexelSize.xy * half2(-0.5h,0.5h), _MainTex_ST); 42 | 43 | return o; 44 | } 45 | 46 | fixed4 fragDownsample ( v2f_tap i ) : SV_Target 47 | { 48 | fixed4 color = tex2D (_MainTex, i.uv20); 49 | color += tex2D (_MainTex, i.uv21); 50 | color += tex2D (_MainTex, i.uv22); 51 | color += tex2D (_MainTex, i.uv23); 52 | return color / 4; 53 | } 54 | 55 | // weight curves 56 | 57 | static const half curve[7] = { 0.0205, 0.0855, 0.232, 0.324, 0.232, 0.0855, 0.0205 }; // gauss'ish blur weights 58 | 59 | static const half4 curve4[7] = { half4(0.0205,0.0205,0.0205,0), half4(0.0855,0.0855,0.0855,0), half4(0.232,0.232,0.232,0), 60 | half4(0.324,0.324,0.324,1), half4(0.232,0.232,0.232,0), half4(0.0855,0.0855,0.0855,0), half4(0.0205,0.0205,0.0205,0) }; 61 | 62 | struct v2f_withBlurCoords8 63 | { 64 | float4 pos : SV_POSITION; 65 | half4 uv : TEXCOORD0; 66 | half2 offs : TEXCOORD1; 67 | }; 68 | 69 | struct v2f_withBlurCoordsSGX 70 | { 71 | float4 pos : SV_POSITION; 72 | half2 uv : TEXCOORD0; 73 | half4 offs[3] : TEXCOORD1; 74 | }; 75 | 76 | v2f_withBlurCoords8 vertBlurHorizontal (appdata_img v) 77 | { 78 | v2f_withBlurCoords8 o; 79 | o.pos = UnityObjectToClipPos(v.vertex); 80 | 81 | o.uv = half4(v.texcoord.xy,1,1); 82 | o.offs = _MainTex_TexelSize.xy * half2(1.0, 0.0) * _Parameter.x; 83 | 84 | return o; 85 | } 86 | 87 | v2f_withBlurCoords8 vertBlurVertical (appdata_img v) 88 | { 89 | v2f_withBlurCoords8 o; 90 | o.pos = UnityObjectToClipPos(v.vertex); 91 | 92 | o.uv = half4(v.texcoord.xy,1,1); 93 | o.offs = _MainTex_TexelSize.xy * half2(0.0, 1.0) * _Parameter.x; 94 | 95 | return o; 96 | } 97 | 98 | half4 fragBlur8 ( v2f_withBlurCoords8 i ) : SV_Target 99 | { 100 | half2 uv = i.uv.xy; 101 | half2 netFilterWidth = i.offs; 102 | half2 coords = uv - netFilterWidth * 3.0; 103 | 104 | half4 color = 0; 105 | for( int l = 0; l < 7; l++ ) 106 | { 107 | half4 tap = tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(coords, _MainTex_ST)); 108 | color += tap * curve4[l]; 109 | coords += netFilterWidth; 110 | } 111 | return color; 112 | } 113 | 114 | 115 | v2f_withBlurCoordsSGX vertBlurHorizontalSGX (appdata_img v) 116 | { 117 | v2f_withBlurCoordsSGX o; 118 | o.pos = UnityObjectToClipPos(v.vertex); 119 | 120 | o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 121 | 122 | half offsetMagnitude = _MainTex_TexelSize.x * _Parameter.x; 123 | o.offs[0] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + offsetMagnitude * half4(-3.0h, 0.0h, 3.0h, 0.0h), _MainTex_ST); 124 | o.offs[1] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + offsetMagnitude * half4(-2.0h, 0.0h, 2.0h, 0.0h), _MainTex_ST); 125 | o.offs[2] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + offsetMagnitude * half4(-1.0h, 0.0h, 1.0h, 0.0h), _MainTex_ST); 126 | 127 | return o; 128 | } 129 | 130 | v2f_withBlurCoordsSGX vertBlurVerticalSGX (appdata_img v) 131 | { 132 | v2f_withBlurCoordsSGX o; 133 | o.pos = UnityObjectToClipPos(v.vertex); 134 | 135 | o.uv = half4(UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST),1,1); 136 | 137 | half offsetMagnitude = _MainTex_TexelSize.y * _Parameter.x; 138 | o.offs[0] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + offsetMagnitude * half4(0.0h, -3.0h, 0.0h, 3.0h), _MainTex_ST); 139 | o.offs[1] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + offsetMagnitude * half4(0.0h, -2.0h, 0.0h, 2.0h), _MainTex_ST); 140 | o.offs[2] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xyxy + offsetMagnitude * half4(0.0h, -1.0h, 0.0h, 1.0h), _MainTex_ST); 141 | 142 | return o; 143 | } 144 | 145 | half4 fragBlurSGX ( v2f_withBlurCoordsSGX i ) : SV_Target 146 | { 147 | half2 uv = i.uv.xy; 148 | 149 | half4 color = tex2D(_MainTex, i.uv) * curve4[3]; 150 | 151 | for( int l = 0; l < 3; l++ ) 152 | { 153 | half4 tapA = tex2D(_MainTex, i.offs[l].xy); 154 | half4 tapB = tex2D(_MainTex, i.offs[l].zw); 155 | color += (tapA + tapB) * curve4[l]; 156 | } 157 | 158 | return color; 159 | 160 | } 161 | 162 | ENDCG 163 | 164 | SubShader { 165 | ZTest Off Cull Off ZWrite Off Blend Off 166 | 167 | // 0 168 | Pass { 169 | 170 | CGPROGRAM 171 | 172 | #pragma vertex vert4Tap 173 | #pragma fragment fragDownsample 174 | 175 | ENDCG 176 | 177 | } 178 | 179 | // 1 180 | Pass { 181 | ZTest Always 182 | Cull Off 183 | 184 | CGPROGRAM 185 | 186 | #pragma vertex vertBlurVertical 187 | #pragma fragment fragBlur8 188 | 189 | ENDCG 190 | } 191 | 192 | // 2 193 | Pass { 194 | ZTest Always 195 | Cull Off 196 | 197 | CGPROGRAM 198 | 199 | #pragma vertex vertBlurHorizontal 200 | #pragma fragment fragBlur8 201 | 202 | ENDCG 203 | } 204 | 205 | // alternate blur 206 | // 3 207 | Pass { 208 | ZTest Always 209 | Cull Off 210 | 211 | CGPROGRAM 212 | 213 | #pragma vertex vertBlurVerticalSGX 214 | #pragma fragment fragBlurSGX 215 | 216 | ENDCG 217 | } 218 | 219 | // 4 220 | Pass { 221 | ZTest Always 222 | Cull Off 223 | 224 | CGPROGRAM 225 | 226 | #pragma vertex vertBlurHorizontalSGX 227 | #pragma fragment fragBlurSGX 228 | 229 | ENDCG 230 | } 231 | } 232 | 233 | FallBack Off 234 | } 235 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MobileBlur.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9d5fa183cd6b45eeb1491f74863cd91 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/MultipassHollywoodFlares" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "" {} 4 | _NonBlurredTex ("Base (RGB)", 2D) = "" {} 5 | } 6 | 7 | CGINCLUDE 8 | 9 | #include "UnityCG.cginc" 10 | 11 | struct v2f { 12 | half4 pos : SV_POSITION; 13 | half2 uv : TEXCOORD0; 14 | }; 15 | 16 | struct v2f_opts { 17 | half4 pos : SV_POSITION; 18 | half2 uv[7] : TEXCOORD0; 19 | }; 20 | 21 | half4 offsets; 22 | half4 tintColor; 23 | 24 | half stretchWidth; 25 | half2 _Threshhold; 26 | 27 | half4 _MainTex_TexelSize; 28 | half4 _MainTex_ST; 29 | 30 | sampler2D _MainTex; 31 | sampler2D _NonBlurredTex; 32 | 33 | v2f vert (appdata_img v) { 34 | v2f o; 35 | o.pos = UnityObjectToClipPos(v.vertex); 36 | o.uv = v.texcoord.xy; 37 | return o; 38 | } 39 | 40 | v2f_opts vertStretch (appdata_img v) { 41 | v2f_opts o; 42 | o.pos = UnityObjectToClipPos(v.vertex); 43 | half b = stretchWidth; 44 | o.uv[0] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 45 | o.uv[1] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + b * 2.0 * offsets.xy, _MainTex_ST); 46 | o.uv[2] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - b * 2.0 * offsets.xy, _MainTex_ST); 47 | o.uv[3] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + b * 4.0 * offsets.xy, _MainTex_ST); 48 | o.uv[4] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - b * 4.0 * offsets.xy, _MainTex_ST); 49 | o.uv[5] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + b * 6.0 * offsets.xy, _MainTex_ST); 50 | o.uv[6] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - b * 6.0 * offsets.xy, _MainTex_ST); 51 | return o; 52 | } 53 | 54 | v2f_opts vertVerticalCoords (appdata_img v) { 55 | v2f_opts o; 56 | o.pos = UnityObjectToClipPos(v.vertex); 57 | o.uv[0] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST); 58 | o.uv[1] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + 0.5 * _MainTex_TexelSize.xy * half2(0,1), _MainTex_ST); 59 | o.uv[2] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - 0.5 * _MainTex_TexelSize.xy * half2(0,1), _MainTex_ST); 60 | o.uv[3] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + 1.5 * _MainTex_TexelSize.xy * half2(0,1), _MainTex_ST); 61 | o.uv[4] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - 1.5 * _MainTex_TexelSize.xy * half2(0,1), _MainTex_ST); 62 | o.uv[5] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy + 2.5 * _MainTex_TexelSize.xy * half2(0,1), _MainTex_ST); 63 | o.uv[6] = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy - 2.5 * _MainTex_TexelSize.xy * half2(0,1), _MainTex_ST); 64 | return o; 65 | } 66 | 67 | // deprecated 68 | half4 fragPrepare (v2f i) : SV_Target { 69 | half4 color = tex2D (_MainTex, i.uv); 70 | half4 colorNb = tex2D (_NonBlurredTex, i.uv); 71 | return color * tintColor * 0.5 + colorNb * normalize (tintColor) * 0.5; 72 | } 73 | 74 | 75 | half4 fragPreAndCut (v2f_opts i) : SV_Target { 76 | half4 color = tex2D (_MainTex, i.uv[0]); 77 | color += tex2D (_MainTex, i.uv[1]); 78 | color += tex2D (_MainTex, i.uv[2]); 79 | color += tex2D (_MainTex, i.uv[3]); 80 | color += tex2D (_MainTex, i.uv[4]); 81 | color += tex2D (_MainTex, i.uv[5]); 82 | color += tex2D (_MainTex, i.uv[6]); 83 | return max(color / 7.0 - _Threshhold.x, 0.0) * _Threshhold.y * tintColor; 84 | } 85 | 86 | half4 fragStretch (v2f_opts i) : SV_Target { 87 | half4 color = tex2D (_MainTex, i.uv[0]); 88 | color = max (color, tex2D (_MainTex, i.uv[1])); 89 | color = max (color, tex2D (_MainTex, i.uv[2])); 90 | color = max (color, tex2D (_MainTex, i.uv[3])); 91 | color = max (color, tex2D (_MainTex, i.uv[4])); 92 | color = max (color, tex2D (_MainTex, i.uv[5])); 93 | color = max (color, tex2D (_MainTex, i.uv[6])); 94 | return color; 95 | } 96 | 97 | half4 fragPost (v2f_opts i) : SV_Target { 98 | half4 color = tex2D (_MainTex, i.uv[0]); 99 | color += tex2D (_MainTex, i.uv[1]); 100 | color += tex2D (_MainTex, i.uv[2]); 101 | color += tex2D (_MainTex, i.uv[3]); 102 | color += tex2D (_MainTex, i.uv[4]); 103 | color += tex2D (_MainTex, i.uv[5]); 104 | color += tex2D (_MainTex, i.uv[6]); 105 | return color * 1.0/(7.0 + Luminance(color.rgb) + 0.5); // this also makes it a little noisy 106 | } 107 | 108 | ENDCG 109 | 110 | Subshader { 111 | ZTest Always Cull Off ZWrite Off 112 | Pass { 113 | 114 | CGPROGRAM 115 | 116 | #pragma vertex vert 117 | #pragma fragment fragPrepare 118 | 119 | ENDCG 120 | } 121 | 122 | Pass { 123 | 124 | CGPROGRAM 125 | 126 | #pragma vertex vertStretch 127 | #pragma fragment fragStretch 128 | 129 | ENDCG 130 | } 131 | 132 | Pass { 133 | 134 | CGPROGRAM 135 | 136 | #pragma vertex vertVerticalCoords 137 | #pragma fragment fragPreAndCut 138 | 139 | ENDCG 140 | } 141 | 142 | Pass { 143 | 144 | CGPROGRAM 145 | 146 | #pragma vertex vertVerticalCoords 147 | #pragma fragment fragPost 148 | 149 | ENDCG 150 | } 151 | } 152 | 153 | Fallback off 154 | 155 | } 156 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/MultiPassHollywoodFlares.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2baf3cae8edc4daf94c9adc2154be00 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/SeparableBlurPlus" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "" {} 4 | } 5 | 6 | CGINCLUDE 7 | 8 | #include "UnityCG.cginc" 9 | 10 | struct v2f { 11 | half4 pos : SV_POSITION; 12 | half2 uv : TEXCOORD0; 13 | half4 uv01 : TEXCOORD1; 14 | half4 uv23 : TEXCOORD2; 15 | half4 uv45 : TEXCOORD3; 16 | half4 uv67 : TEXCOORD4; 17 | }; 18 | 19 | half4 offsets; 20 | 21 | sampler2D _MainTex; 22 | half4 _MainTex_ST; 23 | 24 | v2f vert (appdata_img v) { 25 | v2f o; 26 | o.pos = UnityObjectToClipPos(v.vertex); 27 | 28 | o.uv.xy = v.texcoord.xy; 29 | 30 | o.uv01 = v.texcoord.xyxy + offsets.xyxy * half4(1,1, -1,-1); 31 | o.uv23 = v.texcoord.xyxy + offsets.xyxy * half4(1,1, -1,-1) * 2.0; 32 | o.uv45 = v.texcoord.xyxy + offsets.xyxy * half4(1,1, -1,-1) * 3.0; 33 | o.uv67 = v.texcoord.xyxy + offsets.xyxy * half4(1,1, -1,-1) * 4.5; 34 | o.uv67 = v.texcoord.xyxy + offsets.xyxy * half4(1,1, -1,-1) * 6.5; 35 | 36 | return o; 37 | } 38 | 39 | half4 frag (v2f i) : SV_Target { 40 | half4 color = half4 (0,0,0,0); 41 | 42 | color += 0.225 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv, _MainTex_ST)); 43 | color += 0.150 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv01.xy, _MainTex_ST)); 44 | color += 0.150 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv01.zw, _MainTex_ST)); 45 | color += 0.110 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv23.xy, _MainTex_ST)); 46 | color += 0.110 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv23.zw, _MainTex_ST)); 47 | color += 0.075 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv45.xy, _MainTex_ST)); 48 | color += 0.075 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv45.zw, _MainTex_ST)); 49 | color += 0.0525 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv67.xy, _MainTex_ST)); 50 | color += 0.0525 * tex2D(_MainTex, UnityStereoScreenSpaceUVAdjust(i.uv67.zw, _MainTex_ST)); 51 | 52 | return color; 53 | } 54 | 55 | ENDCG 56 | 57 | Subshader { 58 | Pass { 59 | ZTest Always Cull Off ZWrite Off 60 | 61 | CGPROGRAM 62 | #pragma vertex vert 63 | #pragma fragment frag 64 | ENDCG 65 | } 66 | } 67 | 68 | Fallback off 69 | 70 | } // shader 71 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/SeparableBlurPlus.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9df009a214e24a5ebbf271595f8d5b6 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/VignetteShader" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "" {} 4 | } 5 | 6 | CGINCLUDE 7 | 8 | #include "UnityCG.cginc" 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 uv : TEXCOORD0; 13 | }; 14 | 15 | sampler2D _MainTex; 16 | 17 | float4 _MainTex_TexelSize; 18 | float vignetteIntensity; 19 | 20 | v2f vert( appdata_img v ) { 21 | v2f o; 22 | o.pos = UnityObjectToClipPos(v.vertex); 23 | 24 | o.uv = v.texcoord.xy; 25 | return o; 26 | } 27 | 28 | half4 frag(v2f i) : SV_Target { 29 | half2 coords = i.uv; 30 | half2 uv = i.uv; 31 | 32 | coords = (coords - 0.5) * 2.0; 33 | half coordDot = dot (coords,coords); 34 | half4 color = tex2D (_MainTex, uv); 35 | 36 | float mask = 1.0 - coordDot * vignetteIntensity; 37 | return color * mask; 38 | } 39 | 40 | ENDCG 41 | 42 | Subshader { 43 | Pass { 44 | ZTest Always Cull Off ZWrite Off 45 | 46 | CGPROGRAM 47 | 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | 51 | ENDCG 52 | } 53 | } 54 | 55 | Fallback off 56 | 57 | } // shader 58 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Effects/ImageEffects/Shaders/_BloomAndFlares/VignetteShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 562f620336e024ac99992ff05725a89a 3 | ShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - PostProcessing 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.0167 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 1 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SimpleRayTracing 2 | ![preview](SimpleRayTracing.gif) 3 | 4 | ## This is an example of real-time ray tracing. 5 | * Use Unity post-processing to achieve ray tracing. 6 | * Use custom data structures to store models and materials. 7 | 8 | [知乎链接](https://zhuanlan.zhihu.com/p/45335463) 9 | -------------------------------------------------------------------------------- /SimpleRayTracing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDustEl/SimpleRayTracing/36aceda56250af57016b36dfde21e87e647708e2/SimpleRayTracing.gif --------------------------------------------------------------------------------