├── .gitignore ├── .vscode └── settings.json ├── README.md ├── Shaders ├── CGIncludes │ ├── AutoLight.cginc │ ├── GLSLSupport.glslinc │ ├── GraniteShaderLib3.cginc │ ├── HLSLSupport.cginc │ ├── Lighting.cginc │ ├── SpeedTree8Common.cginc │ ├── SpeedTreeBillboardCommon.cginc │ ├── SpeedTreeCommon.cginc │ ├── SpeedTreeShaderLibrary.cginc │ ├── SpeedTreeVertex.cginc │ ├── SpeedTreeWind.cginc │ ├── TerrainEngine.cginc │ ├── TerrainPreview.cginc │ ├── TerrainSplatmapCommon.cginc │ ├── TerrainTool.cginc │ ├── Tessellation.cginc │ ├── TextCoreProperties.cginc │ ├── TextCore_Properties.cginc │ ├── TextCore_SDF_SSD.cginc │ ├── UnityBuiltin2xTreeLibrary.cginc │ ├── UnityBuiltin3xTreeLibrary.cginc │ ├── UnityCG.cginc │ ├── UnityCG.glslinc │ ├── UnityColorGamut.cginc │ ├── UnityCustomRenderTexture.cginc │ ├── UnityDeferredLibrary.cginc │ ├── UnityDeprecated.cginc │ ├── UnityGBuffer.cginc │ ├── UnityGlobalIllumination.cginc │ ├── UnityImageBasedLighting.cginc │ ├── UnityIndirect.cginc │ ├── UnityInstancing.cginc │ ├── UnityLegacyTextureStack.cginc │ ├── UnityLightingCommon.cginc │ ├── UnityMetaPass.cginc │ ├── UnityPBSLighting.cginc │ ├── UnityRayQuery.cginc │ ├── UnityRayTracingMeshUtils.cginc │ ├── UnityShaderUtilities.cginc │ ├── UnityShaderVariables.cginc │ ├── UnityShadowLibrary.cginc │ ├── UnitySprites.cginc │ ├── UnityStandardBRDF.cginc │ ├── UnityStandardConfig.cginc │ ├── UnityStandardCore.cginc │ ├── UnityStandardCoreForward.cginc │ ├── UnityStandardCoreForwardSimple.cginc │ ├── UnityStandardInput.cginc │ ├── UnityStandardMeta.cginc │ ├── UnityStandardParticleEditor.cginc │ ├── UnityStandardParticleInstancing.cginc │ ├── UnityStandardParticleShadow.cginc │ ├── UnityStandardParticles.cginc │ ├── UnityStandardShadow.cginc │ ├── UnityStandardUtils.cginc │ ├── UnityStereoExtensions.glslinc │ ├── UnityStereoSupport.glslinc │ └── UnityUI.cginc ├── DefaultResources │ ├── Font.shader │ ├── Internal-BlendShape.compute │ ├── Internal-Clear.shader │ ├── Internal-Colored.shader │ ├── Internal-CreateFoveatedShadingRateTexture.cginc │ ├── Internal-CreateFoveatedShadingRateTextureArray.compute │ ├── Internal-CreateFoveatedShadingRateTextureNoArray.compute │ ├── Internal-ErrorShader.shader │ ├── Internal-Loading.shader │ ├── Internal-RayTracing-AddInstancesIndirect.compute │ ├── Internal-Skinning-Util.cginc │ ├── Internal-Skinning.compute │ ├── Internal-VT-TranslationTableReplace.compute │ ├── Internal-VT-TranslationTableUpsample.compute │ ├── Internal-YFlipFoveatedShadingTexture.compute │ └── PerformanceTools │ │ └── FrameDebuggerRenderTargetDisplay.shader ├── DefaultResourcesExtra │ ├── Alpha-BumpSpec.shader │ ├── Alpha-Bumped.shader │ ├── Alpha-Diffuse.shader │ ├── Alpha-Glossy.shader │ ├── Alpha-Parallax.shader │ ├── Alpha-ParallaxSpec.shader │ ├── Alpha-VertexLit.shader │ ├── AlphaTest-BumpSpec.shader │ ├── AlphaTest-Bumped.shader │ ├── AlphaTest-Diffuse.shader │ ├── AlphaTest-Glossy.shader │ ├── AlphaTest-SoftEdgeUnlit.shader │ ├── AlphaTest-VertexLit.shader │ ├── AutodeskInteractive.shader │ ├── Compositing.shader │ ├── Cubemaps │ │ ├── CubeBlend.shader │ │ ├── CubeBlur.shader │ │ ├── CubeBlurOdd.shader │ │ └── CubeCopy.shader │ ├── Decal.shader │ ├── Flare.shader │ ├── GIDebug │ │ ├── ShowLightMask.shader │ │ ├── TextureUV.shader │ │ ├── UV1sAsPositions.shader │ │ └── VertexColors.shader │ ├── Illumin-BumpSpec.shader │ ├── Illumin-Bumped.shader │ ├── Illumin-Diffuse.shader │ ├── Illumin-Glossy.shader │ ├── Illumin-Parallax.shader │ ├── Illumin-ParallaxSpec.shader │ ├── Illumin-VertexLit.shader │ ├── Internal-BlitCopy.shader │ ├── Internal-BlitCopyDepth.shader │ ├── Internal-BlitCopyHDRTonemap.shader │ ├── Internal-BlitCopyHDRTonemappedToHDRTonemap.shader │ ├── Internal-BlitCopyHDRTonemappedToSDR.shader │ ├── Internal-BlitCopyWithDepth.shader │ ├── Internal-BlitToDepth.shader │ ├── Internal-BlitToDepth_MSAA.shader │ ├── Internal-CombineDepthNormals.shader │ ├── Internal-ConvertTexture.shader │ ├── Internal-CubemapToEquirect.shader │ ├── Internal-DebugPattern.shader │ ├── Internal-DeferredReflections.shader │ ├── Internal-DeferredShading.shader │ ├── Internal-DepthNormalsTexture.shader │ ├── Internal-Flare.shader │ ├── Internal-GUIRoundedRect.shader │ ├── Internal-GUIRoundedRectWithColorPerBorder.shader │ ├── Internal-GUITexture.shader │ ├── Internal-GUITextureBlit.shader │ ├── Internal-GUITextureClip.shader │ ├── Internal-GUITextureClipText.shader │ ├── Internal-Halo.shader │ ├── Internal-MotionVectors.shader │ ├── Internal-ODSWorldTexture.shader │ ├── Internal-ScreenSpaceShadows.shader │ ├── Internal-StencilWrite.shader │ ├── Lightmap-BumpSpec.shader │ ├── Lightmap-Bumped.shader │ ├── Lightmap-Diffuse.shader │ ├── Lightmap-Glossy.shader │ ├── Lightmap-VertexLit.shader │ ├── Mobile │ │ ├── Mobile-BumpSpec-1DirectionalLight.shader │ │ ├── Mobile-BumpSpec.shader │ │ ├── Mobile-Bumped.shader │ │ ├── Mobile-Diffuse.shader │ │ ├── Mobile-Lightmap-Unlit.shader │ │ ├── Mobile-Particle-Add.shader │ │ ├── Mobile-Particle-Alpha-VertexLit.shader │ │ ├── Mobile-Particle-Alpha.shader │ │ ├── Mobile-Particle-Multiply.shader │ │ ├── Mobile-Skybox.shader │ │ ├── Mobile-VertexLit-OnlyDirectionalLights.shader │ │ └── Mobile-VertexLit.shader │ ├── Nature │ │ ├── SoftOcclusion │ │ │ ├── TreeSoftOcclusionBark.shader │ │ │ ├── TreeSoftOcclusionBarkRendertex.shader │ │ │ ├── TreeSoftOcclusionLeaves.shader │ │ │ └── TreeSoftOcclusionLeavesRendertex.shader │ │ ├── SpeedTree.shader │ │ ├── SpeedTree8.shader │ │ ├── SpeedTree9.shader │ │ ├── SpeedTreeBillboard.shader │ │ └── TreeCreator │ │ │ ├── TreeCreatorAlbedoRenderTex.shader │ │ │ ├── TreeCreatorBark.shader │ │ │ ├── TreeCreatorBarkOptimized.shader │ │ │ ├── TreeCreatorBarkRendertex.shader │ │ │ ├── TreeCreatorLeaves.shader │ │ │ ├── TreeCreatorLeavesFast.shader │ │ │ ├── TreeCreatorLeavesFastOptimized.shader │ │ │ ├── TreeCreatorLeavesOptimized.shader │ │ │ ├── TreeCreatorLeavesRendertex.shader │ │ │ └── TreeCreatorNormalRendertex.shader │ ├── Normal-BumpSpec.shader │ ├── Normal-Bumped.shader │ ├── Normal-Diffuse.shader │ ├── Normal-DiffuseDetail.shader │ ├── Normal-DiffuseFast.shader │ ├── Normal-Glossy.shader │ ├── Normal-Parallax.shader │ ├── Normal-ParallaxSpec.shader │ ├── Normal-VertexLit.shader │ ├── Particle Add.shader │ ├── Particle AddMultiply.shader │ ├── Particle AddSmooth.shader │ ├── Particle Alpha Blend.shader │ ├── Particle Anim Alpha Blend.shader │ ├── Particle Blend.shader │ ├── Particle Multiply.shader │ ├── Particle MultiplyDouble.shader │ ├── Particle Premultiply Blend.shader │ ├── Particle Standard Surface.shader │ ├── Particle Standard Unlit.shader │ ├── Particle VertexLit Blended.shader │ ├── Reflect-BumpNolight.shader │ ├── Reflect-BumpSpec.shader │ ├── Reflect-BumpVertexLit.shader │ ├── Reflect-Bumped.shader │ ├── Reflect-Diffuse.shader │ ├── Reflect-Glossy.shader │ ├── Reflect-Parallax.shader │ ├── Reflect-ParallaxSpec.shader │ ├── Reflect-VertexLit.shader │ ├── Skybox-Cubed.shader │ ├── Skybox-Panoramic.shader │ ├── Skybox-Procedural.shader │ ├── Skybox.shader │ ├── Sprites-Default.shader │ ├── Sprites-Diffuse.shader │ ├── Sprites-Mask.shader │ ├── Standard.shader │ ├── StandardSpecular.shader │ ├── TerrainShaders │ │ ├── Details │ │ │ ├── VertexLit.shader │ │ │ ├── WavingGrass.shader │ │ │ └── WavingGrassBillboard.shader │ │ ├── Splats │ │ │ ├── AddPass.shader │ │ │ ├── DiffuseBase.shader │ │ │ ├── DiffuseBaseGen.shader │ │ │ ├── FirstPass.shader │ │ │ ├── Specular-AddPass.shader │ │ │ ├── Specular-Base.shader │ │ │ ├── Specular-FirstPass.shader │ │ │ ├── Standard-AddPass.shader │ │ │ ├── Standard-Base.shader │ │ │ ├── Standard-BaseGen.shader │ │ │ ├── Standard-FirstPass.shader │ │ │ └── Terrain-Utilities.shader │ │ ├── Trees │ │ │ ├── BillboardTree.shader │ │ │ └── CameraFacingBillboardTree.shader │ │ └── Utils │ │ │ ├── BrushPreview.shader │ │ │ ├── CrossBlendNeighbors.shader │ │ │ ├── GenNormalmap.shader │ │ │ ├── PaintHeight.shader │ │ │ ├── TerrainBlitCopyZWrite.shader │ │ │ ├── TerrainHeightBlitCopy.shader │ │ │ └── TerrainLayerUtils.shader │ ├── TextCore │ │ ├── Sprite.shader │ │ ├── TextCore-SDF-SSD.shader │ │ └── TextCore-SDF.shader │ ├── UI │ │ ├── UI-CompositeOverdraw.shader │ │ ├── UI-Default.shader │ │ ├── UI-DefaultETC1.shader │ │ ├── UI-DefaultFont.shader │ │ ├── UI-Lit-Bumped.shader │ │ ├── UI-Lit-Detail.shader │ │ ├── UI-Lit-Refraction.shader │ │ ├── UI-Lit-RefractionDetail.shader │ │ ├── UI-Lit-Transparent.shader │ │ ├── UI-Overdraw.shader │ │ ├── UI-Unlit-Detail.shader │ │ ├── UI-Unlit-Text.shader │ │ ├── UI-Unlit-TextDetail.shader │ │ └── UI-Unlit-Transparent.shader │ ├── Unlit │ │ ├── Unlit-Alpha.shader │ │ ├── Unlit-AlphaTest.shader │ │ ├── Unlit-Color.shader │ │ └── Unlit-Normal.shader │ ├── VR │ │ └── Shaders │ │ │ ├── BlitCopyHDRTonemapTexArraySlice.shader │ │ │ ├── BlitCopyHDRTonemappedToHDRTonemapTexArraySlice.shader │ │ │ ├── BlitCopyHDRTonemappedToSDRTexArraySlice.shader │ │ │ ├── BlitFromTex2DToTexArraySlice.shader │ │ │ ├── BlitTexArraySlice.shader │ │ │ ├── BlitTexArraySliceToDepth.shader │ │ │ ├── BlitTexArraySliceToDepth_MSAA.shader │ │ │ ├── Internal-VRDistortion.shader │ │ │ ├── SpatialMappingOcclusion.shader │ │ │ └── SpatialMappingWireframe.shader │ ├── VideoComposite.shader │ ├── VideoDecode.shader │ ├── VideoDecodeAndroid.shader │ └── VideoDecodeOSX.shader ├── Editor │ ├── StandardParticlesShaderGUI.cs │ └── StandardShaderGUI.cs ├── EditorDefaultResources │ ├── Avatar │ │ ├── Materials │ │ │ ├── Avatar.shader │ │ │ └── Avatar_Transparent.shader │ │ └── Shaders │ │ │ ├── Editor-AlphaDiffuse.shader │ │ │ ├── Editor-AlphaTestDiffuse.shader │ │ │ ├── Editor-BumpSpec.shader │ │ │ └── Editor-Diffuse.shader │ ├── Editors │ │ └── AnimationWindow │ │ │ ├── ControlPoint.shader │ │ │ └── Curve.shader │ ├── GI │ │ └── Internal-Histogram.compute │ ├── GraphView │ │ └── AAEdge.shader │ ├── Inspectors │ │ ├── InactiveGUI.shader │ │ ├── Internal-GUITextureClipVertically.shader │ │ └── TreeCreator │ │ │ └── TreeTextureCombiner.shader │ ├── Previews │ │ ├── MeshPreviewShader.shader │ │ ├── Preview.cginc │ │ ├── Preview2DTextureArray.shader │ │ ├── Preview3DBase.cginc │ │ ├── Preview3DSDF.shader │ │ ├── Preview3DSliced.shader │ │ ├── Preview3DVolume.shader │ │ ├── PreviewAlpha.shader │ │ ├── PreviewAlphaVT.shader │ │ ├── PreviewAudioClipWaveform.shader │ │ ├── PreviewColor2D.shader │ │ ├── PreviewColor2DVT.shader │ │ ├── PreviewCubemap.shader │ │ ├── PreviewCubemapArray.shader │ │ ├── PreviewEncodedLightmapDoubleLDR.shader │ │ ├── PreviewEncodedLightmapFullHDR.shader │ │ ├── PreviewEncodedLightmapRGBM.shader │ │ ├── PreviewEncodedNormals.shader │ │ ├── PreviewEncodedNormalsVT.shader │ │ ├── PreviewPlaneWithShadow.shader │ │ ├── PreviewShadowMask.shader │ │ ├── PreviewShadowPlaneClip.shader │ │ ├── PreviewTransparent.shader │ │ └── PreviewTransparentVT.shader │ ├── SceneView │ │ ├── 2DHandleDottedLinesShader.shader │ │ ├── 2DHandleLinesShader.shader │ │ ├── AlphaBasedSelection.shader │ │ ├── AlphaBasedSelectionNoZWrite.shader │ │ ├── BlitSceneViewCapture.shader │ │ ├── BoneHandles.shader │ │ ├── CircularArc.shader │ │ ├── ColoredTexture.shader │ │ ├── GUITextureBlit2Linear.shader │ │ ├── GUITextureBlit2SRGB.shader │ │ ├── GUITextureBlitSceneGUI.shader │ │ ├── GizmoColorOcclusion.shader │ │ ├── GizmoIconPicking.shader │ │ ├── GizmoLit.shader │ │ ├── GizmoText.shader │ │ ├── GizmoTexture.shader │ │ ├── GizmoWire.shader │ │ ├── GizmoWireNoDepthTest.shader │ │ ├── GridGap.shader │ │ ├── GridOrthoShader.shader │ │ ├── GridShader.shader │ │ ├── HandleDottedLinesShader.shader │ │ ├── HandleIconShader.shader │ │ ├── HandleLinesShader.shader │ │ ├── HandlesLit.shader │ │ ├── HandlesRenderShader.cginc │ │ ├── HighlightBackfaces.shader │ │ ├── LightProbeGroupTetrahedra.shader │ │ ├── LightProbeHandles.shader │ │ ├── LightProbeLines.shader │ │ ├── OpaqueSelection.shader │ │ ├── ParticleShapeGizmo.shader │ │ ├── ParticleShapeGizmoSphere.shader │ │ ├── SH.shader │ │ ├── SceneViewAlphaShader.shader │ │ ├── SceneViewApplyFilter.shader │ │ ├── SceneViewAura.shader │ │ ├── SceneViewBuildFilter.shader │ │ ├── SceneViewDeferredShader.shader │ │ ├── SceneViewGrayscaleEffectFade.shader │ │ ├── SceneViewSelected.cginc │ │ ├── SceneViewSelected.shader │ │ ├── SceneViewShowLightmap.shader │ │ ├── SceneViewShowMips.shader │ │ ├── SceneViewShowOverdraw.shader │ │ ├── SceneViewShowTextureStreaming.shader │ │ ├── ShowOverlap.shader │ │ ├── ShowShadowCascadeSplits.shader │ │ ├── VertexSelectedShader.shader │ │ ├── VertexSelectionBackfacesShader.shader │ │ ├── VertexSelectionShader.shader │ │ └── Wireframe.shader │ ├── Shaders │ │ └── UIElements │ │ │ └── AACurveField.shader │ ├── SplashScreen │ │ └── SeparableBlur.shader │ └── TextCore │ │ └── Shaders │ │ ├── Sprite.shader │ │ └── TextCore-SDF-SSD.shader └── license.txt ├── VERSIONS.md ├── add-version.sh ├── check-unity-versions.js └── license.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Unity Built-in Shaders 3 | 4 | This repository contains built-in shader code for all release of Unity back to Unity 3. 5 | It is useful to compare changes between versions and keep up to date versions of Unity's own shaders (you do not need to download the code from Unity's website anymore!) 6 | 7 | ## Exceptions 8 | 9 | Only fully released versions of Unity are taken into account. Releases from the Alpha, Beta or Patch channels are not considered. 10 | 11 | # Repository Navigation 12 | 13 | You can access shader code through: 14 | 15 | * Branches to access all minor releases inside a major version and stay up-to-date (2017.2, 2018.3, ...) 16 | * Tags to access a specific version (v2017.4.1f1, v2019.1.5f1, ...) 17 | 18 | ## Master branch 19 | 20 | Master will always be synced with the latest main stream release. 21 | 22 | Please note that LTS releases are never merged with master. 23 | 24 | # Automatic Updater 25 | 26 | Run `node check-unity-version.js` to update the repository automatically with the new versions. 27 | 28 | ## Exception 29 | 30 | * `master` must be merged manually with the main-stream branch 31 | 32 | ## Requirements 33 | 34 | * **Node.js version v10.x or later** (should probably work with earlier versions, but has not been tested) 35 | * **bash** in order to execute `add-version.sh` script 36 | 37 | # License 38 | 39 | See [license.txt](license.txt) 40 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/GLSLSupport.glslinc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef GLSL_SUPPORT_INCLUDED 4 | #define GLSL_SUPPORT_INCLUDED 5 | 6 | // Automatically included in raw GLSL (GLSLPROGRAM) shader snippets, to map from some of the legacy OpenGL 7 | // variable names to uniform names used by Unity. 8 | 9 | #ifdef GL_FRAGMENT_PRECISION_HIGH 10 | precision highp float; 11 | #else 12 | precision mediump float; 13 | #endif 14 | 15 | uniform mat4 unity_ObjectToWorld; 16 | uniform mat4 unity_WorldToObject; 17 | uniform mat4 unity_MatrixVP; 18 | uniform mat4 unity_MatrixV; 19 | uniform mat4 unity_MatrixInvV; 20 | uniform mat4 glstate_matrix_projection; 21 | 22 | #define gl_ModelViewProjectionMatrix (unity_MatrixVP * unity_ObjectToWorld) 23 | #define gl_ModelViewMatrix (unity_MatrixV * unity_ObjectToWorld) 24 | #define gl_ModelViewMatrixTranspose (transpose(unity_MatrixV * unity_ObjectToWorld)) 25 | #define gl_ModelViewMatrixInverseTranspose (transpose(unity_WorldToObject * unity_MatrixInvV)) 26 | #define gl_NormalMatrix (transpose(mat3(unity_WorldToObject * unity_MatrixInvV))) 27 | #define gl_ProjectionMatrix glstate_matrix_projection 28 | 29 | #if __VERSION__ < 120 30 | #ifndef UNITY_GLSL_STRIP_TRANSPOSE 31 | mat3 transpose(mat3 mtx) 32 | { 33 | vec3 c0 = mtx[0]; 34 | vec3 c1 = mtx[1]; 35 | vec3 c2 = mtx[2]; 36 | 37 | return mat3( 38 | vec3(c0.x, c1.x, c2.x), 39 | vec3(c0.y, c1.y, c2.y), 40 | vec3(c0.z, c1.z, c2.z) 41 | ); 42 | } 43 | mat4 transpose(mat4 mtx) 44 | { 45 | vec4 c0 = mtx[0]; 46 | vec4 c1 = mtx[1]; 47 | vec4 c2 = mtx[2]; 48 | vec4 c3 = mtx[3]; 49 | 50 | return mat4( 51 | vec4(c0.x, c1.x, c2.x, c3.x), 52 | vec4(c0.y, c1.y, c2.y, c3.y), 53 | vec4(c0.z, c1.z, c2.z, c3.z), 54 | vec4(c0.w, c1.w, c2.w, c3.w) 55 | ); 56 | } 57 | #endif 58 | #endif // __VERSION__ < 120 59 | 60 | #endif // GLSL_SUPPORT_INCLUDED 61 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/TerrainTool.cginc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef TERRAIN_TOOL_INCLUDED 4 | #define TERRAIN_TOOL_INCLUDED 5 | 6 | 7 | // function to convert paint context UV to brush uv 8 | float4 _PCUVToBrushUVScales; 9 | float2 _PCUVToBrushUVOffset; 10 | float2 PaintContextUVToBrushUV(float2 pcUV) 11 | { 12 | return _PCUVToBrushUVScales.xy * pcUV.x + 13 | _PCUVToBrushUVScales.zw * pcUV.y + 14 | _PCUVToBrushUVOffset; 15 | } 16 | 17 | 18 | float2 PaintContextUVToHeightmapUV(float2 pcUV) 19 | { 20 | return pcUV; 21 | } 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/UnityLightingCommon.cginc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef UNITY_LIGHTING_COMMON_INCLUDED 4 | #define UNITY_LIGHTING_COMMON_INCLUDED 5 | 6 | fixed4 _LightColor0; 7 | fixed4 _SpecColor; 8 | 9 | struct UnityLight 10 | { 11 | half3 color; 12 | half3 dir; 13 | half ndotl; // Deprecated: Ndotl is now calculated on the fly and is no longer stored. Do not used it. 14 | }; 15 | 16 | struct UnityIndirect 17 | { 18 | half3 diffuse; 19 | half3 specular; 20 | }; 21 | 22 | struct UnityGI 23 | { 24 | UnityLight light; 25 | UnityIndirect indirect; 26 | }; 27 | 28 | struct UnityGIInput 29 | { 30 | UnityLight light; // pixel light, sent from the engine 31 | 32 | float3 worldPos; 33 | half3 worldViewDir; 34 | half atten; 35 | half3 ambient; 36 | 37 | // interpolated lightmap UVs are passed as full float precision data to fragment shaders 38 | // so lightmapUV (which is used as a tmp inside of lightmap fragment shaders) should 39 | // also be full float precision to avoid data loss before sampling a texture. 40 | float4 lightmapUV; // .xy = static lightmap UV, .zw = dynamic lightmap UV 41 | 42 | #if defined(UNITY_SPECCUBE_BLENDING) || defined(UNITY_SPECCUBE_BOX_PROJECTION) || defined(UNITY_ENABLE_REFLECTION_BUFFERS) 43 | float4 boxMin[2]; 44 | #endif 45 | #ifdef UNITY_SPECCUBE_BOX_PROJECTION 46 | float4 boxMax[2]; 47 | float4 probePosition[2]; 48 | #endif 49 | // HDR cubemap properties, use to decompress HDR texture 50 | float4 probeHDR[2]; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/UnityRayQuery.cginc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef UNITY_RAY_QUERY_INCLUDED 4 | #define UNITY_RAY_QUERY_INCLUDED 5 | 6 | // Does the platform provide its own definition of UnityRayQuery 7 | #ifndef PLATFORM_RAYQUERY 8 | #define PLATFORM_RAYQUERY 9 | 10 | #define UnityRayQuery RayQuery 11 | 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/UnityStandardCoreForward.cginc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef UNITY_STANDARD_CORE_FORWARD_INCLUDED 4 | #define UNITY_STANDARD_CORE_FORWARD_INCLUDED 5 | 6 | #if defined(UNITY_NO_FULL_STANDARD_SHADER) 7 | # define UNITY_STANDARD_SIMPLE 1 8 | #endif 9 | 10 | #include "UnityStandardConfig.cginc" 11 | 12 | #if UNITY_STANDARD_SIMPLE 13 | #include "UnityStandardCoreForwardSimple.cginc" 14 | VertexOutputBaseSimple vertBase (VertexInput v) { return vertForwardBaseSimple(v); } 15 | VertexOutputForwardAddSimple vertAdd (VertexInput v) { return vertForwardAddSimple(v); } 16 | half4 fragBase (VertexOutputBaseSimple i) : SV_Target { return fragForwardBaseSimpleInternal(i); } 17 | half4 fragAdd (VertexOutputForwardAddSimple i) : SV_Target { return fragForwardAddSimpleInternal(i); } 18 | #else 19 | #include "UnityStandardCore.cginc" 20 | VertexOutputForwardBase vertBase (VertexInput v) { return vertForwardBase(v); } 21 | VertexOutputForwardAdd vertAdd (VertexInput v) { return vertForwardAdd(v); } 22 | half4 fragBase (VertexOutputForwardBase i) : SV_Target { return fragForwardBaseInternal(i); } 23 | half4 fragAdd (VertexOutputForwardAdd i) : SV_Target { return fragForwardAddInternal(i); } 24 | #endif 25 | 26 | #endif // UNITY_STANDARD_CORE_FORWARD_INCLUDED 27 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/UnityStereoExtensions.glslinc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef GLSL_STEREO_EXTENSIONS_INCLUDED 4 | #define GLSL_STEREO_EXTENSIONS_INCLUDED 5 | 6 | #ifdef STEREO_MULTIVIEW_ON 7 | #extension GL_OVR_multiview2 : require 8 | #endif 9 | 10 | #ifdef STEREO_INSTANCING_ON 11 | #extension GL_NV_viewport_array2 : enable 12 | #extension GL_AMD_vertex_shader_layer : enable 13 | #extension GL_ARB_fragment_layer_viewport : enable 14 | #endif 15 | 16 | #endif // GLSL_STEREO_EXTENSIONS_INCLUDED 17 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/UnityStereoSupport.glslinc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef GLSL_STEREO_SETUP_INCLUDED 4 | #define GLSL_STEREO_SETUP_INCLUDED 5 | 6 | #if defined(STEREO_MULTIVIEW_ON) || defined(STEREO_INSTANCING_ON) 7 | layout(std140) uniform UnityStereoGlobals { 8 | mat4 unity_StereoMatrixP[2]; 9 | mat4 unity_StereoMatrixV[2]; 10 | mat4 unity_StereoMatrixInvV[2]; 11 | mat4 unity_StereoMatrixVP[2]; 12 | mat4 unity_StereoCameraProjection[2]; 13 | mat4 unity_StereoCameraInvProjection[2]; 14 | mat4 unity_StereoWorldToCamera[2]; 15 | mat4 unity_StereoCameraToWorld[2]; 16 | vec3 unity_StereoWorldSpaceCameraPos[2]; 17 | vec4 unity_StereoScaleOffset[2]; 18 | }; 19 | #endif 20 | 21 | #ifdef VERTEX 22 | #ifdef STEREO_MULTIVIEW_ON 23 | layout(num_views = 2) in; 24 | #endif 25 | 26 | uniform int unity_StereoEyeIndex; 27 | 28 | int SetupStereoEyeIndex() 29 | { 30 | int eyeIndex = unity_StereoEyeIndex; 31 | 32 | #if defined(STEREO_MULTIVIEW_ON) 33 | eyeIndex = int(gl_ViewID_OVR); 34 | #elif defined(STEREO_INSTANCING_ON) 35 | eyeIndex = int(gl_InstanceID & 1); 36 | gl_Layer = eyeIndex; 37 | #endif 38 | 39 | return eyeIndex; 40 | } 41 | 42 | mat4 GetStereoMatrixVP(int eyeIndex) 43 | { 44 | mat4 stereoVP = unity_MatrixVP; 45 | 46 | #if defined(STEREO_MULTIVIEW_ON) || defined(STEREO_INSTANCING_ON) 47 | stereoVP = unity_StereoMatrixVP[eyeIndex]; 48 | #endif 49 | 50 | return stereoVP; 51 | } 52 | #endif 53 | 54 | #endif // GLSL_STEREO_SETUP_INCLUDED 55 | -------------------------------------------------------------------------------- /Shaders/CGIncludes/UnityUI.cginc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef UNITY_UI_INCLUDED 4 | #define UNITY_UI_INCLUDED 5 | 6 | inline float UnityGet2DClipping (in float2 position, in float4 clipRect) 7 | { 8 | float2 inside = step(clipRect.xy, position.xy) * step(position.xy, clipRect.zw); 9 | return inside.x * inside.y; 10 | } 11 | 12 | inline fixed4 UnityGetUIDiffuseColor(in float2 position, in sampler2D mainTexture, in sampler2D alphaTexture, fixed4 textureSampleAdd) 13 | { 14 | return fixed4(tex2D(mainTexture, position).rgb + textureSampleAdd.rgb, tex2D(alphaTexture, position).r + textureSampleAdd.a); 15 | } 16 | 17 | // This piecewise approximation has a precision better than 0.5 / 255 in gamma space over the [0..255] range 18 | // i.e. abs(l2g_exact(g2l_approx(value)) - value) < 0.5 / 255 19 | // It is much more precise than GammaToLinearSpace but remains relatively cheap 20 | half3 UIGammaToLinear(half3 value) 21 | { 22 | half3 low = 0.0849710 * value - 0.000163029; 23 | half3 high = value * (value * (value * 0.265885 + 0.736584) - 0.00980184) + 0.00319697; 24 | 25 | // We should be 0.5 away from any actual gamma value stored in an 8 bit channel 26 | const half3 split = (half3)0.0725490; // Equals 18.5 / 255 27 | return (value < split) ? low : high; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /Shaders/DefaultResources/Internal-CreateFoveatedShadingRateTextureArray.compute: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #pragma kernel CreateFoveatedShadingRateTexture 4 | #pragma only_renderers vulkan 5 | 6 | #include "Internal-CreateFoveatedShadingRateTexture.cginc" 7 | 8 | RWTexture2DArray _Result; 9 | RWTexture2DArray _ResultYFlip; 10 | 11 | // 2 threads for z because we parralelize the algorithm on the z 12 | [numthreads(8,8,2)] 13 | void CreateFoveatedShadingRateTexture(uint3 id : SV_DispatchThreadID) 14 | { 15 | uint shadingRate = GetShadingRateLevel(id); 16 | _Result[id] = shadingRate; 17 | 18 | uint3 idYFlip = id; 19 | idYFlip.y = (_HalfHeight * 2) - idYFlip.y; 20 | _ResultYFlip[idYFlip] = shadingRate; 21 | } 22 | -------------------------------------------------------------------------------- /Shaders/DefaultResources/Internal-CreateFoveatedShadingRateTextureNoArray.compute: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #pragma kernel CreateFoveatedShadingRateTexture 4 | #pragma only_renderers d3d11 vulkan 5 | 6 | #include "Internal-CreateFoveatedShadingRateTexture.cginc" 7 | 8 | RWTexture2D _Result; 9 | RWTexture2D _ResultYFlip; 10 | 11 | // 1 thread for z because we run both eyes and then combine them with a min operator 12 | [numthreads(8,8,1)] 13 | void CreateFoveatedShadingRateTexture(uint3 id : SV_DispatchThreadID) 14 | { 15 | uint leftShadingRateLevel = GetShadingRateLevel(uint3(id.xy, kLeftEyeId)); 16 | uint rightShadingRateLevel = GetShadingRateLevel(uint3(id.xy, kRightEyeId)); 17 | uint shadingRate = min(rightShadingRateLevel, leftShadingRateLevel); 18 | _Result[id.xy] = shadingRate; 19 | _ResultYFlip[uint2(id.x, (_HalfHeight * 2) - id.y)] = shadingRate; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Shaders/DefaultResources/Internal-ErrorShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Upgrade NOTE: replaced 'UNITY_INSTANCE_ID' with 'UNITY_VERTEX_INPUT_INSTANCE_ID' 4 | 5 | Shader "Hidden/InternalErrorShader" 6 | { 7 | SubShader 8 | { 9 | Pass 10 | { 11 | CGPROGRAM 12 | #pragma vertex vert 13 | #pragma fragment frag 14 | #pragma target 2.0 15 | #pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON 16 | #include "UnityCG.cginc" 17 | 18 | struct appdata_t { 19 | float4 vertex : POSITION; 20 | UNITY_VERTEX_INPUT_INSTANCE_ID 21 | }; 22 | 23 | struct v2f { 24 | float4 vertex : SV_POSITION; 25 | UNITY_VERTEX_OUTPUT_STEREO 26 | }; 27 | 28 | v2f vert (appdata_t v) 29 | { 30 | v2f o; 31 | UNITY_SETUP_INSTANCE_ID(v); 32 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 33 | o.vertex = UnityObjectToClipPos(v.vertex); 34 | return o; 35 | } 36 | fixed4 frag (v2f i) : SV_Target 37 | { 38 | return fixed4(1,0,1,1); 39 | } 40 | ENDCG 41 | } 42 | 43 | // DepthNormals and DepthOnly are just here to support depth priming 44 | Pass 45 | { 46 | Name "DepthNormalsOnly" 47 | Tags { "LightMode" = "DepthNormalsOnly" } 48 | ColorMask 0 49 | } 50 | 51 | Pass 52 | { 53 | Name "DepthOnly" 54 | Tags { "LightMode" = "DepthOnly" } 55 | ColorMask 0 56 | } 57 | } 58 | Fallback Off 59 | } 60 | -------------------------------------------------------------------------------- /Shaders/DefaultResources/Internal-Loading.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Internal-Loading" 4 | { 5 | SubShader 6 | { 7 | Pass 8 | { 9 | CGPROGRAM 10 | #pragma vertex vert 11 | #pragma fragment frag 12 | #pragma target 2.0 13 | #pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON 14 | #pragma enable_cbuffer 15 | #include "UnityCG.cginc" 16 | 17 | struct appdata_t { 18 | float4 vertex : POSITION; 19 | UNITY_VERTEX_INPUT_INSTANCE_ID 20 | }; 21 | 22 | struct v2f { 23 | float4 vertex : SV_POSITION; 24 | UNITY_VERTEX_OUTPUT_STEREO 25 | }; 26 | 27 | v2f vert (appdata_t v) 28 | { 29 | v2f o; 30 | UNITY_SETUP_INSTANCE_ID(v); 31 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 32 | o.vertex = UnityObjectToClipPos(v.vertex); 33 | return o; 34 | } 35 | fixed4 frag (v2f i) : SV_Target 36 | { 37 | return fixed4(0, 1, 1, 1); 38 | } 39 | ENDCG 40 | } 41 | } 42 | Fallback Off 43 | } 44 | -------------------------------------------------------------------------------- /Shaders/DefaultResources/Internal-VT-TranslationTableReplace.compute: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #pragma kernel ReplaceTranslationTable 4 | 5 | static const uint TGSize = 256; 6 | 7 | RWByteAddressBuffer _output_buf : register(u0); 8 | ByteAddressBuffer _input_map : register(t0); 9 | 10 | cbuffer cbReplacementData 11 | { 12 | uint numReplacements; 13 | uint pad0; 14 | uint pad1; 15 | uint pad2; 16 | }; 17 | 18 | [numthreads(TGSize, 1, 1)] 19 | void ReplaceTranslationTable(in uint3 GroupID : SV_GroupID, in uint3 GroupThreadID : SV_GroupThreadID) 20 | { 21 | const uint pos = GroupID.x * TGSize + GroupThreadID.x; 22 | if (pos < numReplacements) 23 | { 24 | uint2 data = _input_map.Load2(pos * 2 * 4); //*2 ints per tuple, *4 bytes per int 25 | _output_buf.Store(data.x * 4, data.y); //*4 bytes per int 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Shaders/DefaultResources/Internal-YFlipFoveatedShadingTexture.compute: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #pragma kernel YFlipTexture 4 | #pragma kernel YFlipTextureRG USE_RG_TEXTURE 5 | #pragma kernel YFlipTextureArray USE_TEXTURE_ARRAY 6 | #pragma kernel YFlipTextureRGArray USE_TEXTURE_ARRAY USE_RG_TEXTURE 7 | #pragma only_renderers d3d11 vulkan 8 | 9 | #define FORMAT_R8_UINT uint // 1 component textures are R8_UINT maps (Vulkan Fragment Rate Shading & DX12 Pixel Shading Rate) 10 | #define FORMAT_R8G8_UNORM float2 // 2 component textures are R8G8_UNORM maps (Vulkan Fragemnt Density Map) 11 | 12 | #if defined(USE_TEXTURE_ARRAY) 13 | # define TYPE_UV uint3 14 | # if defined(USE_RG_TEXTURE) 15 | # define KERNEL_NAME YFlipTextureRGArray 16 | # define TEXTURE_TYPE Texture2DArray 17 | # define RW_TEXTURE_TYPE RWTexture2DArray 18 | # else 19 | # define KERNEL_NAME YFlipTextureArray 20 | # define TEXTURE_TYPE Texture2DArray 21 | # define RW_TEXTURE_TYPE RWTexture2DArray 22 | # endif 23 | #else 24 | # define TYPE_UV uint2 25 | # if defined(USE_RG_TEXTURE) 26 | # define KERNEL_NAME YFlipTextureRG 27 | # define TEXTURE_TYPE Texture2D 28 | # define RW_TEXTURE_TYPE RWTexture2D 29 | # else 30 | # define KERNEL_NAME YFlipTexture 31 | # define TEXTURE_TYPE Texture2D 32 | # define RW_TEXTURE_TYPE RWTexture2D 33 | # endif 34 | #endif 35 | 36 | TEXTURE_TYPE _Source; 37 | RW_TEXTURE_TYPE _Destination; 38 | int2 _ImageSize; 39 | 40 | [numthreads(8,8,1)] 41 | void KERNEL_NAME(TYPE_UV id : SV_DispatchThreadID) 42 | { 43 | TYPE_UV idYFlip = id; 44 | idYFlip.y = (_ImageSize.y - 1) - idYFlip.y; 45 | _Destination[idYFlip] = _Source[id]; 46 | } 47 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Alpha-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Bumped Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | SubShader { 13 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 14 | LOD 400 15 | 16 | CGPROGRAM 17 | #pragma surface surf BlinnPhong alpha:fade 18 | #pragma target 3.0 19 | 20 | sampler2D _MainTex; 21 | sampler2D _BumpMap; 22 | fixed4 _Color; 23 | half _Shininess; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_BumpMap; 28 | }; 29 | 30 | void surf (Input IN, inout SurfaceOutput o) { 31 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 32 | o.Albedo = tex.rgb * _Color.rgb; 33 | o.Gloss = tex.a; 34 | o.Alpha = tex.a * _Color.a; 35 | o.Specular = _Shininess; 36 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 37 | } 38 | ENDCG 39 | } 40 | 41 | FallBack "Legacy Shaders/Transparent/VertexLit" 42 | } 43 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Alpha-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Bumped Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert alpha:fade 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | fixed4 _Color; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float2 uv_BumpMap; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 28 | o.Albedo = c.rgb; 29 | o.Alpha = c.a; 30 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 31 | } 32 | ENDCG 33 | } 34 | 35 | FallBack "Legacy Shaders/Transparent/Diffuse" 36 | } 37 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Alpha-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 7 | } 8 | 9 | SubShader { 10 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 11 | LOD 200 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert alpha:fade 15 | 16 | sampler2D _MainTex; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | }; 22 | 23 | void surf (Input IN, inout SurfaceOutput o) { 24 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 25 | o.Albedo = c.rgb; 26 | o.Alpha = c.a; 27 | } 28 | ENDCG 29 | } 30 | 31 | Fallback "Legacy Shaders/Transparent/VertexLit" 32 | } 33 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Alpha-Glossy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 9 | } 10 | 11 | SubShader { 12 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 13 | LOD 300 14 | 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong alpha:fade 17 | 18 | sampler2D _MainTex; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 28 | o.Albedo = tex.rgb * _Color.rgb; 29 | o.Gloss = tex.a; 30 | o.Alpha = tex.a * _Color.a; 31 | o.Specular = _Shininess; 32 | } 33 | ENDCG 34 | } 35 | 36 | Fallback "Legacy Shaders/Transparent/VertexLit" 37 | } 38 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Alpha-Parallax.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Parallax Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | 12 | SubShader { 13 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 14 | LOD 500 15 | 16 | CGPROGRAM 17 | #pragma surface surf Lambert alpha:fade 18 | 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | sampler2D _ParallaxMap; 22 | fixed4 _Color; 23 | float _Parallax; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_BumpMap; 28 | float3 viewDir; 29 | }; 30 | 31 | void surf (Input IN, inout SurfaceOutput o) { 32 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 33 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 34 | IN.uv_MainTex += offset; 35 | IN.uv_BumpMap += offset; 36 | 37 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 38 | o.Albedo = c.rgb; 39 | o.Alpha = c.a; 40 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 41 | } 42 | ENDCG 43 | } 44 | 45 | FallBack "Legacy Shaders/Transparent/Bumped Diffuse" 46 | } 47 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Alpha-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Parallax Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 9 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 10 | _BumpMap ("Normalmap", 2D) = "bump" {} 11 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 12 | } 13 | 14 | SubShader { 15 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 16 | LOD 600 17 | 18 | CGPROGRAM 19 | #pragma surface surf BlinnPhong alpha:fade 20 | #pragma target 3.0 21 | 22 | sampler2D _MainTex; 23 | sampler2D _BumpMap; 24 | sampler2D _ParallaxMap; 25 | fixed4 _Color; 26 | half _Shininess; 27 | float _Parallax; 28 | 29 | struct Input { 30 | float2 uv_MainTex; 31 | float2 uv_BumpMap; 32 | float3 viewDir; 33 | }; 34 | 35 | void surf (Input IN, inout SurfaceOutput o) { 36 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 37 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 38 | IN.uv_MainTex += offset; 39 | IN.uv_BumpMap += offset; 40 | 41 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 42 | o.Albedo = tex.rgb * _Color.rgb; 43 | o.Gloss = tex.a; 44 | o.Alpha = tex.a * _Color.a; 45 | o.Specular = _Shininess; 46 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 47 | } 48 | ENDCG 49 | } 50 | 51 | FallBack "Legacy Shaders/Transparent/Bumped Specular" 52 | } 53 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/AlphaTest-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Cutout/Bumped Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 11 | } 12 | 13 | SubShader { 14 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 15 | LOD 400 16 | 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong alphatest:_Cutoff 19 | #pragma target 3.0 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | fixed4 _Color; 24 | half _Shininess; 25 | 26 | struct Input { 27 | float2 uv_MainTex; 28 | float2 uv_BumpMap; 29 | }; 30 | 31 | void surf (Input IN, inout SurfaceOutput o) { 32 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 33 | o.Albedo = tex.rgb * _Color.rgb; 34 | o.Gloss = tex.a; 35 | o.Alpha = tex.a * _Color.a; 36 | o.Specular = _Shininess; 37 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 38 | } 39 | ENDCG 40 | } 41 | 42 | FallBack "Legacy Shaders/Transparent/Cutout/VertexLit" 43 | } 44 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/AlphaTest-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Cutout/Bumped Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 9 | } 10 | 11 | SubShader { 12 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 13 | LOD 300 14 | 15 | CGPROGRAM 16 | #pragma surface surf Lambert alphatest:_Cutoff 17 | 18 | sampler2D _MainTex; 19 | sampler2D _BumpMap; 20 | fixed4 _Color; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_BumpMap; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 29 | o.Albedo = c.rgb; 30 | o.Alpha = c.a; 31 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 32 | } 33 | ENDCG 34 | } 35 | 36 | FallBack "Legacy Shaders/Transparent/Cutout/Diffuse" 37 | } 38 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/AlphaTest-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Cutout/Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 7 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 12 | LOD 200 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert alphatest:_Cutoff 16 | 17 | sampler2D _MainTex; 18 | fixed4 _Color; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | o.Albedo = c.rgb; 27 | o.Alpha = c.a; 28 | } 29 | ENDCG 30 | } 31 | 32 | Fallback "Legacy Shaders/Transparent/Cutout/VertexLit" 33 | } 34 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/AlphaTest-Glossy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Transparent/Cutout/Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 9 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 10 | } 11 | 12 | SubShader { 13 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 14 | LOD 300 15 | 16 | CGPROGRAM 17 | #pragma surface surf BlinnPhong alphatest:_Cutoff 18 | 19 | sampler2D _MainTex; 20 | fixed4 _Color; 21 | half _Shininess; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | o.Albedo = tex.rgb * _Color.rgb; 30 | o.Gloss = tex.a; 31 | o.Alpha = tex.a * _Color.a; 32 | o.Specular = _Shininess; 33 | } 34 | ENDCG 35 | } 36 | 37 | Fallback "Legacy Shaders/Transparent/Cutout/VertexLit" 38 | } 39 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Compositing.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Compositing" 4 | { 5 | Properties 6 | { 7 | _MainTex ("_MainTex (A)", 2D) = "black" 8 | _SecondTex ("_SecondTex (A)", 2D) = "black" 9 | } 10 | 11 | CGINCLUDE 12 | 13 | #include "UnityCG.cginc" 14 | 15 | sampler2D _MainTex; 16 | sampler2D _SecondTex; 17 | float _AlphaParam; 18 | float _SecondAlphaParam; 19 | float4 _MainTex_ST; 20 | 21 | struct appdata_t { 22 | float4 vertex : POSITION; 23 | float2 texcoord : TEXCOORD0; 24 | }; 25 | 26 | struct v2f { 27 | float4 vertex : SV_POSITION; 28 | float2 texcoord : TEXCOORD0; 29 | }; 30 | 31 | v2f vertexDirect(appdata_t v) 32 | { 33 | v2f o; 34 | o.vertex = UnityObjectToClipPos(v.vertex); 35 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 36 | return o; 37 | } 38 | 39 | fixed4 fragmentMix(v2f i) : SV_Target 40 | { 41 | fixed4 mainCol = tex2D(_MainTex, i.texcoord); 42 | fixed4 secondCol = tex2D(_SecondTex, i.texcoord); 43 | 44 | return fixed4(_AlphaParam * mainCol.a * mainCol.rgb + _SecondAlphaParam * secondCol.a * secondCol.rgb, 1.0f); 45 | } 46 | 47 | ENDCG 48 | 49 | SubShader 50 | { 51 | Pass 52 | { 53 | Name "Mix_RGBA_To_RGBA" 54 | Cull Off ZWrite On Blend Off 55 | CGPROGRAM 56 | #pragma vertex vertexDirect 57 | #pragma fragment fragmentMix 58 | ENDCG 59 | } 60 | } 61 | 62 | FallBack Off 63 | } 64 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Cubemaps/CubeBlend.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/CubeBlend" 4 | { 5 | Properties 6 | { 7 | [NoScaleOffset] _TexA ("Cubemap", Cube) = "grey" {} 8 | [NoScaleOffset] _TexB ("Cubemap", Cube) = "grey" {} 9 | _value ("Value", Range (0, 1)) = 0.5 10 | } 11 | 12 | CGINCLUDE 13 | 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | 17 | #include "UnityCG.cginc" 18 | 19 | half4 _TexA_HDR; 20 | half4 _TexB_HDR; 21 | 22 | UNITY_DECLARE_TEXCUBE(_TexA); 23 | UNITY_DECLARE_TEXCUBE(_TexB); 24 | 25 | float _Level; 26 | float _value; 27 | 28 | struct appdata_t { 29 | float4 vertex : POSITION; 30 | float3 texcoord : TEXCOORD0; 31 | }; 32 | 33 | struct v2f { 34 | float4 vertex : SV_POSITION; 35 | float3 texcoord : TEXCOORD0; 36 | }; 37 | 38 | v2f vert (appdata_t v) 39 | { 40 | v2f o; 41 | o.vertex = UnityObjectToClipPos(v.vertex); 42 | o.texcoord = v.texcoord; 43 | return o; 44 | } 45 | 46 | half4 frag (v2f i) : SV_Target 47 | { 48 | half3 texA = DecodeHDR (UNITY_SAMPLE_TEXCUBE_LOD (_TexA, i.texcoord, _Level), _TexA_HDR); 49 | half3 texB = DecodeHDR (UNITY_SAMPLE_TEXCUBE_LOD (_TexB, i.texcoord, _Level), _TexB_HDR); 50 | 51 | half3 res = lerp(texA, texB, _value); 52 | return half4(res, 1.0); 53 | } 54 | ENDCG 55 | 56 | SubShader { 57 | Tags { "Queue"="Background" "RenderType"="Background" } 58 | Cull back ZWrite Off ZTest Always Fog { Mode Off } 59 | Pass 60 | { 61 | CGPROGRAM 62 | #pragma target 3.0 63 | ENDCG 64 | } 65 | } 66 | 67 | SubShader { 68 | Tags { "Queue"="Background" "RenderType"="Background" } 69 | Cull back ZWrite Off ZTest Always Fog { Mode Off } 70 | 71 | Pass 72 | { 73 | CGPROGRAM 74 | #pragma target 2.0 75 | ENDCG 76 | } 77 | } 78 | 79 | Fallback Off 80 | 81 | } 82 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Cubemaps/CubeCopy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/CubeCopy" { 4 | Properties { 5 | _MainTex ("Main", CUBE) = "" {} 6 | _Level ("Level", Float) = 0. 7 | } 8 | CGINCLUDE 9 | #pragma vertex vert 10 | #pragma fragment frag 11 | 12 | #include "UnityCG.cginc" 13 | 14 | float _Level; 15 | 16 | struct v2f { 17 | float4 pos : SV_POSITION; 18 | float4 uvw : TEXCOORD0; 19 | }; 20 | 21 | v2f vert(appdata_base v) 22 | { 23 | v2f o; 24 | o.pos = UnityObjectToClipPos(v.vertex); 25 | o.uvw = v.texcoord; 26 | return o; 27 | } 28 | 29 | UNITY_DECLARE_TEXCUBE(_MainTex); 30 | 31 | float4 frag(v2f i) : SV_Target 32 | { 33 | return UNITY_SAMPLE_TEXCUBE_LOD(_MainTex, i.uvw.xyz, _Level); 34 | } 35 | ENDCG 36 | SubShader { 37 | Tags { "RenderType"="Opaque" } 38 | LOD 200 39 | Pass { 40 | ZTest Always 41 | Blend Off 42 | AlphaTest off 43 | Cull Off 44 | ZWrite Off 45 | Fog { Mode off } 46 | CGPROGRAM 47 | #pragma target 3.0 48 | ENDCG 49 | } 50 | } 51 | SubShader { 52 | Tags { "RenderType"="Opaque" } 53 | LOD 200 54 | Pass { 55 | ZTest Always 56 | Blend Off 57 | AlphaTest off 58 | Cull Off 59 | ZWrite Off 60 | Fog { Mode off } 61 | CGPROGRAM 62 | #pragma target 2.0 63 | ENDCG 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Decal.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Decal" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _DecalTex ("Decal (RGBA)", 2D) = "black" {} 8 | } 9 | 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 250 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | 17 | sampler2D _MainTex; 18 | sampler2D _DecalTex; 19 | fixed4 _Color; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float2 uv_DecalTex; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 28 | half4 decal = tex2D(_DecalTex, IN.uv_DecalTex); 29 | c.rgb = lerp (c.rgb, decal.rgb, decal.a); 30 | c *= _Color; 31 | o.Albedo = c.rgb; 32 | o.Alpha = c.a; 33 | } 34 | ENDCG 35 | } 36 | 37 | Fallback "Legacy Shaders/Diffuse" 38 | } 39 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Flare.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "FX/Flare" { 4 | Properties { 5 | _MainTex ("Particle Texture", 2D) = "black" {} 6 | } 7 | SubShader { 8 | Tags { 9 | "Queue"="Transparent" 10 | "IgnoreProjector"="True" 11 | "RenderType"="Transparent" 12 | "PreviewType"="Plane" 13 | } 14 | Cull Off Lighting Off ZWrite Off Ztest Always 15 | Blend One One 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #pragma target 2.0 22 | 23 | #include "UnityCG.cginc" 24 | 25 | sampler2D _MainTex; 26 | fixed4 _TintColor; 27 | 28 | struct appdata_t { 29 | float4 vertex : POSITION; 30 | fixed4 color : COLOR; 31 | float2 texcoord : TEXCOORD0; 32 | UNITY_VERTEX_INPUT_INSTANCE_ID 33 | }; 34 | 35 | struct v2f { 36 | float4 vertex : SV_POSITION; 37 | fixed4 color : COLOR; 38 | float2 texcoord : TEXCOORD0; 39 | UNITY_VERTEX_OUTPUT_STEREO 40 | }; 41 | 42 | float4 _MainTex_ST; 43 | 44 | v2f vert (appdata_t v) 45 | { 46 | v2f o; 47 | UNITY_SETUP_INSTANCE_ID(v); 48 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 49 | o.vertex = UnityObjectToClipPos(v.vertex); 50 | o.color = v.color; 51 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 52 | return o; 53 | } 54 | 55 | fixed4 frag (v2f i) : SV_Target 56 | { 57 | fixed4 col; 58 | fixed4 tex = tex2D(_MainTex, i.texcoord); 59 | col.rgb = i.color.rgb * tex.rgb; 60 | col.a = tex.a; 61 | return col; 62 | } 63 | ENDCG 64 | } 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/GIDebug/UV1sAsPositions.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/GIDebug/UV1sAsPositions" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | } 7 | 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 100 11 | 12 | Pass { 13 | ZTest Always 14 | Cull Off 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | #include "UnityCG.cginc" 19 | #include "UnityShaderVariables.cginc" 20 | 21 | struct appdata { 22 | float4 vertex : POSITION; 23 | float4 texcoord1 : TEXCOORD1; 24 | float4 texcoord2 : TEXCOORD2; 25 | }; 26 | 27 | struct v2f { 28 | float4 pos : SV_POSITION; 29 | float4 dummy : TEXCOORD0; 30 | }; 31 | 32 | fixed4 _Color; 33 | float _StaticUV1; 34 | 35 | v2f vert (appdata v) 36 | { 37 | v2f o; 38 | float2 uv; 39 | if (_StaticUV1) 40 | uv = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; 41 | else 42 | uv = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; 43 | o.pos = UnityObjectToClipPos(float3 (uv, 0)); 44 | o.dummy = v.vertex; // make OpenGL happy 45 | return o; 46 | } 47 | 48 | fixed4 frag (v2f i) : SV_Target 49 | { 50 | return _Color; 51 | } 52 | ENDCG 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/GIDebug/VertexColors.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/GIDebug/VertexColors" { 4 | Properties { 5 | _MainTex ("Base (RGB)", 2D) = "white" {} 6 | } 7 | SubShader { 8 | Pass { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 200 11 | 12 | CGPROGRAM 13 | #pragma vertex vert_surf 14 | #pragma fragment frag_surf 15 | #include "UnityCG.cginc" 16 | 17 | struct v2f_surf 18 | { 19 | float4 pos : SV_POSITION; 20 | float3 normal : NORMAL; 21 | float3 posWorld : TEXCOORD1; 22 | fixed4 color : COLOR; 23 | }; 24 | 25 | float _Lit; 26 | 27 | v2f_surf vert_surf (appdata_full v) 28 | { 29 | v2f_surf o; 30 | o.pos = UnityObjectToClipPos(v.vertex); 31 | o.normal = UnityObjectToWorldNormal(v.normal); 32 | o.posWorld = mul(unity_ObjectToWorld, v.vertex).xyz; 33 | o.color = v.color; 34 | return o; 35 | } 36 | 37 | float4 frag_surf(v2f_surf IN) : SV_Target 38 | { 39 | float4 result = IN.color; 40 | 41 | if (_Lit) 42 | { 43 | float3 viewDir = normalize(IN.posWorld - _WorldSpaceCameraPos); 44 | float rimLight = clamp(dot(IN.normal, -viewDir), 0.2, 1); 45 | result.rgb *= rimLight; 46 | } 47 | 48 | return result; 49 | } 50 | ENDCG 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Illumin-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Self-Illumin/Bumped Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | _Illum ("Illumin (A)", 2D) = "white" {} 10 | _BumpMap ("Normalmap", 2D) = "bump" {} 11 | _Emission ("Emission (Lightmapper)", Float) = 1.0 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 400 16 | CGPROGRAM 17 | #pragma surface surf BlinnPhong 18 | #pragma target 3.0 19 | 20 | sampler2D _MainTex; 21 | sampler2D _BumpMap; 22 | sampler2D _Illum; 23 | fixed4 _Color; 24 | half _Shininess; 25 | fixed _Emission; 26 | 27 | struct Input { 28 | float2 uv_MainTex; 29 | float2 uv_Illum; 30 | float2 uv_BumpMap; 31 | }; 32 | 33 | void surf (Input IN, inout SurfaceOutput o) { 34 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 35 | fixed4 c = tex * _Color; 36 | o.Albedo = c.rgb; 37 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 38 | #if defined (UNITY_PASS_META) 39 | o.Emission *= _Emission.rrr; 40 | #endif 41 | o.Gloss = tex.a; 42 | o.Alpha = c.a; 43 | o.Specular = _Shininess; 44 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 45 | } 46 | ENDCG 47 | } 48 | FallBack "Legacy Shaders/Self-Illumin/Specular" 49 | CustomEditor "LegacyIlluminShaderGUI" 50 | } 51 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Illumin-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Self-Illumin/Bumped Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _Emission ("Emission (Lightmapper)", Float) = 1.0 10 | } 11 | 12 | CGINCLUDE 13 | sampler2D _MainTex; 14 | sampler2D _BumpMap; 15 | sampler2D _Illum; 16 | fixed4 _Color; 17 | fixed _Emission; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_Illum; 22 | float2 uv_BumpMap; 23 | }; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 27 | fixed4 c = tex * _Color; 28 | o.Albedo = c.rgb; 29 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 30 | #if defined (UNITY_PASS_META) 31 | o.Emission *= _Emission.rrr; 32 | #endif 33 | o.Alpha = c.a; 34 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 35 | } 36 | ENDCG 37 | 38 | SubShader { 39 | Tags { "RenderType"="Opaque" } 40 | LOD 300 41 | 42 | CGPROGRAM 43 | #pragma surface surf Lambert 44 | #pragma target 3.0 45 | ENDCG 46 | } 47 | 48 | SubShader { 49 | Tags { "RenderType"="Opaque" } 50 | LOD 300 51 | 52 | CGPROGRAM 53 | #pragma surface surf Lambert nodynlightmap 54 | ENDCG 55 | } 56 | 57 | FallBack "Legacy Shaders/Self-Illumin/Diffuse" 58 | CustomEditor "LegacyIlluminShaderGUI" 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Illumin-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Self-Illumin/Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _Emission ("Emission (Lightmapper)", Float) = 1.0 9 | } 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 200 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | 17 | sampler2D _MainTex; 18 | sampler2D _Illum; 19 | fixed4 _Color; 20 | fixed _Emission; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_Illum; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | fixed4 c = tex * _Color; 30 | o.Albedo = c.rgb; 31 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 32 | #if defined (UNITY_PASS_META) 33 | o.Emission *= _Emission.rrr; 34 | #endif 35 | o.Alpha = c.a; 36 | } 37 | ENDCG 38 | } 39 | FallBack "Legacy Shaders/Self-Illumin/VertexLit" 40 | CustomEditor "LegacyIlluminShaderGUI" 41 | } 42 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Illumin-Glossy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Self-Illumin/Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | _Illum ("Illumin (A)", 2D) = "white" {} 10 | _Emission ("Emission (Lightmapper)", Float) = 1.0 11 | } 12 | SubShader { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 300 15 | 16 | CGPROGRAM 17 | #pragma surface surf BlinnPhong 18 | 19 | sampler2D _MainTex; 20 | sampler2D _Illum; 21 | fixed4 _Color; 22 | half _Shininess; 23 | fixed _Emission; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_Illum; 28 | }; 29 | 30 | void surf (Input IN, inout SurfaceOutput o) { 31 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 32 | fixed4 c = tex * _Color; 33 | o.Albedo = c.rgb; 34 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 35 | #if defined (UNITY_PASS_META) 36 | o.Emission *= _Emission.rrr; 37 | #endif 38 | o.Gloss = tex.a; 39 | o.Alpha = c.a; 40 | o.Specular = _Shininess; 41 | } 42 | ENDCG 43 | } 44 | FallBack "Legacy Shaders/Self-Illumin/Diffuse" 45 | CustomEditor "LegacyIlluminShaderGUI" 46 | } 47 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Illumin-Parallax.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Self-Illumin/Parallax Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB)", 2D) = "white" {} 8 | _Illum ("Illumin (A)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 11 | _Emission ("Emission (Lightmapper)", Float) = 1.0 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 500 16 | 17 | CGPROGRAM 18 | #pragma surface surf Lambert 19 | #pragma target 3.0 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | sampler2D _ParallaxMap; 24 | sampler2D _Illum; 25 | fixed4 _Color; 26 | float _Parallax; 27 | fixed _Emission; 28 | 29 | struct Input { 30 | float2 uv_MainTex; 31 | float2 uv_BumpMap; 32 | float2 uv_Illum; 33 | float3 viewDir; 34 | }; 35 | 36 | void surf (Input IN, inout SurfaceOutput o) { 37 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 38 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 39 | IN.uv_MainTex += offset; 40 | IN.uv_BumpMap += offset; 41 | IN.uv_Illum += offset; 42 | 43 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 44 | o.Albedo = c.rgb; 45 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 46 | #if defined (UNITY_PASS_META) 47 | o.Emission *= _Emission.rrr; 48 | #endif 49 | o.Alpha = c.a; 50 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 51 | } 52 | ENDCG 53 | } 54 | FallBack "Legacy Shaders/Self-Illumin/Bumped Diffuse" 55 | CustomEditor "LegacyIlluminShaderGUI" 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Illumin-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Self-Illumin/Parallax Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 9 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 10 | _Illum ("Illumin (A)", 2D) = "white" {} 11 | _BumpMap ("Normalmap", 2D) = "bump" {} 12 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 13 | _Emission ("Emission (Lightmapper)", Float) = 1.0 14 | } 15 | SubShader { 16 | Tags { "RenderType"="Opaque" } 17 | LOD 600 18 | 19 | CGPROGRAM 20 | #pragma surface surf BlinnPhong 21 | #pragma target 3.0 22 | 23 | sampler2D _MainTex; 24 | sampler2D _BumpMap; 25 | sampler2D _ParallaxMap; 26 | sampler2D _Illum; 27 | fixed4 _Color; 28 | float _Parallax; 29 | half _Shininess; 30 | fixed _Emission; 31 | 32 | struct Input { 33 | float2 uv_MainTex; 34 | float2 uv_BumpMap; 35 | float2 uv_Illum; 36 | float3 viewDir; 37 | }; 38 | 39 | void surf (Input IN, inout SurfaceOutput o) { 40 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 41 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 42 | IN.uv_MainTex += offset; 43 | IN.uv_BumpMap += offset; 44 | IN.uv_Illum += offset; 45 | 46 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 47 | fixed4 c = tex * _Color; 48 | o.Albedo = c.rgb; 49 | o.Gloss = tex.a; 50 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 51 | #if defined (UNITY_PASS_META) 52 | o.Emission *= _Emission.rrr; 53 | #endif 54 | o.Specular = _Shininess; 55 | o.Alpha = c.a; 56 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 57 | } 58 | ENDCG 59 | } 60 | FallBack "Legacy Shaders/Self-Illumin/Bumped Specular" 61 | CustomEditor "LegacyIlluminShaderGUI" 62 | } 63 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-BlitCopy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/BlitCopy" { 4 | Properties 5 | { 6 | _MainTex ("Texture", any) = "" {} 7 | _Color("Multiplicative color", Color) = (1.0, 1.0, 1.0, 1.0) 8 | } 9 | SubShader { 10 | Pass { 11 | ZTest Always Cull Off ZWrite Off 12 | 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #include "UnityCG.cginc" 17 | 18 | UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); 19 | uniform float4 _MainTex_ST; 20 | uniform float4 _Color; 21 | 22 | struct appdata_t { 23 | float4 vertex : POSITION; 24 | float2 texcoord : TEXCOORD0; 25 | UNITY_VERTEX_INPUT_INSTANCE_ID 26 | }; 27 | 28 | struct v2f { 29 | float4 vertex : SV_POSITION; 30 | float2 texcoord : TEXCOORD0; 31 | UNITY_VERTEX_OUTPUT_STEREO 32 | }; 33 | 34 | v2f vert (appdata_t v) 35 | { 36 | v2f o; 37 | UNITY_SETUP_INSTANCE_ID(v); 38 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 39 | o.vertex = UnityObjectToClipPos(v.vertex); 40 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 41 | return o; 42 | } 43 | 44 | fixed4 frag (v2f i) : SV_Target 45 | { 46 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); 47 | return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.texcoord) * _Color; 48 | } 49 | ENDCG 50 | 51 | } 52 | } 53 | Fallback Off 54 | } 55 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-BlitCopyDepth.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/BlitCopyDepth" { 4 | Properties { _MainTex ("Texture", any) = "" {} } 5 | SubShader { 6 | Pass { 7 | ZTest Always Cull Off ZWrite Off 8 | 9 | CGPROGRAM 10 | #pragma vertex vert 11 | #pragma fragment frag 12 | #pragma target 2.0 13 | 14 | #include "UnityCG.cginc" 15 | 16 | UNITY_DECLARE_DEPTH_TEXTURE(_MainTex); 17 | uniform float4 _MainTex_ST; 18 | 19 | struct appdata_t { 20 | float4 vertex : POSITION; 21 | float2 texcoord : TEXCOORD0; 22 | UNITY_VERTEX_INPUT_INSTANCE_ID 23 | }; 24 | 25 | struct v2f { 26 | float4 vertex : SV_POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | UNITY_VERTEX_OUTPUT_STEREO 29 | }; 30 | 31 | v2f vert (appdata_t v) 32 | { 33 | v2f o; 34 | UNITY_SETUP_INSTANCE_ID(v); 35 | UNITY_INITIALIZE_OUTPUT(v2f, o); 36 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 37 | o.vertex = UnityObjectToClipPos(v.vertex); 38 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 39 | return o; 40 | } 41 | 42 | float4 frag (v2f i) : SV_Target 43 | { 44 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); 45 | return SAMPLE_RAW_DEPTH_TEXTURE(_MainTex, i.texcoord); 46 | } 47 | ENDCG 48 | 49 | } 50 | } 51 | Fallback Off 52 | } 53 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-BlitCopyWithDepth.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/BlitCopyWithDepth" { 4 | Properties 5 | { 6 | _MainTex ("Texture", any) = "" {} 7 | _Color("Multiplicative color", Color) = (1.0, 1.0, 1.0, 1.0) 8 | } 9 | SubShader { 10 | Pass{ 11 | ZTest Always Cull Off ZWrite On 12 | 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #pragma target 2.0 17 | 18 | #include "UnityCG.cginc" 19 | 20 | sampler2D _MainTex; 21 | UNITY_DECLARE_DEPTH_TEXTURE(_DepthTex); 22 | 23 | uniform float4 _MainTex_ST; 24 | uniform float4 _Color; 25 | 26 | struct appdata_t { 27 | float4 vertex : POSITION; 28 | float2 texcoord : TEXCOORD0; 29 | }; 30 | 31 | struct v2f { 32 | float4 vertex : SV_POSITION; 33 | float2 texcoord : TEXCOORD0; 34 | }; 35 | 36 | v2f vert(appdata_t v) 37 | { 38 | v2f o; 39 | o.vertex = UnityObjectToClipPos(v.vertex); 40 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 41 | return o; 42 | } 43 | 44 | fixed4 frag(v2f i, out float oDepth : SV_Depth 45 | ) : SV_Target 46 | { 47 | oDepth = SAMPLE_RAW_DEPTH_TEXTURE(_DepthTex, i.texcoord); 48 | return tex2D(_MainTex, i.texcoord) * _Color; 49 | } 50 | ENDCG 51 | 52 | } 53 | 54 | } 55 | Fallback Off 56 | } 57 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-BlitToDepth.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/BlitToDepth" { 4 | Properties 5 | { 6 | _MainTex ("Texture", any) = "" {} 7 | _Color("Multiplicative color", Color) = (1.0, 1.0, 1.0, 1.0) 8 | } 9 | SubShader { 10 | Pass { 11 | ZTest Always Cull Off ZWrite On ColorMask 0 12 | 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #pragma target 5.0 17 | 18 | #include "UnityCG.cginc" 19 | 20 | UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); 21 | uniform float4 _MainTex_ST; 22 | uniform float4 _Color; 23 | 24 | struct appdata_t { 25 | float4 vertex : POSITION; 26 | float2 texcoord : TEXCOORD0; 27 | UNITY_VERTEX_INPUT_INSTANCE_ID 28 | }; 29 | 30 | struct v2f { 31 | float4 vertex : SV_POSITION; 32 | float2 texcoord : TEXCOORD0; 33 | UNITY_VERTEX_OUTPUT_STEREO 34 | }; 35 | 36 | v2f vert (appdata_t v) 37 | { 38 | v2f o; 39 | UNITY_SETUP_INSTANCE_ID(v); 40 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 41 | o.vertex = UnityObjectToClipPos(v.vertex); 42 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 43 | return o; 44 | } 45 | 46 | fixed4 frag (v2f i, out float oDepth : SV_Depth) : SV_Target 47 | { 48 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); 49 | oDepth = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.texcoord).r; 50 | return float4(oDepth, 0, 0, 1); 51 | } 52 | ENDCG 53 | 54 | } 55 | } 56 | Fallback Off 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-CombineDepthNormals.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Internal-CombineDepthNormals" { 4 | SubShader { 5 | 6 | Pass { 7 | ZWrite Off ZTest Always Cull Off 8 | CGPROGRAM 9 | #pragma vertex vert 10 | #pragma fragment frag 11 | #include "UnityCG.cginc" 12 | 13 | struct appdata { 14 | float4 vertex : POSITION; 15 | float2 texcoord : TEXCOORD0; 16 | UNITY_VERTEX_INPUT_INSTANCE_ID 17 | }; 18 | 19 | struct v2f { 20 | float4 pos : SV_POSITION; 21 | float2 uv : TEXCOORD0; 22 | UNITY_VERTEX_OUTPUT_STEREO 23 | }; 24 | float4 _CameraNormalsTexture_ST; 25 | 26 | v2f vert (appdata v) 27 | { 28 | v2f o; 29 | UNITY_SETUP_INSTANCE_ID(v); 30 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 31 | o.pos = UnityObjectToClipPos(v.vertex); 32 | o.uv = TRANSFORM_TEX(v.texcoord,_CameraNormalsTexture); 33 | return o; 34 | } 35 | UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); 36 | sampler2D _CameraNormalsTexture; 37 | 38 | fixed4 frag (v2f i) : SV_Target 39 | { 40 | float d = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv); 41 | float3 n = tex2D (_CameraNormalsTexture, i.uv) * 2.0 - 1.0; 42 | d = Linear01Depth (d); 43 | n = mul ((float3x3)unity_WorldToCamera, n); 44 | n.z = -n.z; 45 | return (d < (1.0-1.0/65025.0)) ? EncodeDepthNormal (d, n.xyz) : float4(0.5,0.5,1.0,1.0); 46 | } 47 | ENDCG 48 | } 49 | 50 | } 51 | Fallback Off 52 | } 53 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-CubemapToEquirect.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Internal-CubemapToEquirect" { 4 | Properties 5 | { 6 | _MainTex("Texture", cube) = "" {} 7 | } 8 | SubShader { 9 | Pass{ 10 | ZTest Always Cull Off ZWrite Off 11 | 12 | CGPROGRAM 13 | #pragma vertex vert 14 | #pragma fragment frag 15 | #include "UnityCG.cginc" 16 | 17 | uniform float4 _MainTex_ST; 18 | 19 | struct appdata_t { 20 | float4 vertex : POSITION; 21 | float2 texcoord : TEXCOORD0; 22 | }; 23 | 24 | struct v2f { 25 | float4 vertex : SV_POSITION; 26 | float2 uv : TEXCOORD0; 27 | }; 28 | 29 | v2f vert(appdata_t v) 30 | { 31 | v2f o; 32 | o.vertex = UnityObjectToClipPos(v.vertex); 33 | o.uv = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 34 | return o; 35 | } 36 | 37 | samplerCUBE _MainTex; 38 | 39 | float3 computeRayDir(float2 tc) 40 | { 41 | //based on google's omni-directional stereo rendering thread 42 | const float PI = 3.14159265; 43 | float4 scaleOffset = float4(2.0f * PI, PI, -PI, -PI*0.5); 44 | float2 angles = tc*scaleOffset.xy + scaleOffset.zw; 45 | float2 angleCos = cos(angles); 46 | float2 angleSin = sin(angles); 47 | return float3(angleSin.x * angleCos.y, angleSin.y, angleCos.x * angleCos.y); 48 | } 49 | 50 | fixed4 frag(v2f i) : SV_Target 51 | { 52 | float3 dir = computeRayDir(i.uv); 53 | return texCUBE(_MainTex, dir); 54 | } 55 | ENDCG 56 | 57 | } 58 | } 59 | Fallback Off 60 | } 61 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-Flare.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | 4 | Shader "Hidden/Internal-Flare" 5 | { 6 | SubShader { 7 | 8 | Tags {"RenderType"="Overlay"} 9 | ZWrite Off ZTest Always 10 | Cull Off 11 | Blend One One 12 | ColorMask RGB 13 | 14 | Pass { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | #pragma target 2.0 19 | 20 | #include "UnityCG.cginc" 21 | 22 | sampler2D _FlareTexture; 23 | 24 | struct appdata_t { 25 | float4 vertex : POSITION; 26 | fixed4 color : COLOR; 27 | float2 texcoord : TEXCOORD0; 28 | UNITY_VERTEX_INPUT_INSTANCE_ID 29 | }; 30 | 31 | struct v2f { 32 | float4 vertex : SV_POSITION; 33 | fixed4 color : COLOR; 34 | float2 texcoord : TEXCOORD0; 35 | UNITY_VERTEX_OUTPUT_STEREO 36 | }; 37 | 38 | float4 _FlareTexture_ST; 39 | 40 | v2f vert (appdata_t v) 41 | { 42 | v2f o; 43 | UNITY_SETUP_INSTANCE_ID(v); 44 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 45 | o.vertex = UnityObjectToClipPos(v.vertex); 46 | o.color = v.color; 47 | o.texcoord = TRANSFORM_TEX(v.texcoord, _FlareTexture); 48 | return o; 49 | } 50 | 51 | fixed4 frag (v2f i) : SV_Target 52 | { 53 | return tex2D(_FlareTexture, i.texcoord) * i.color; 54 | } 55 | ENDCG 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-GUITexture.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | 4 | Shader "Hidden/Internal-GUITexture" 5 | { 6 | Properties { _MainTex ("Texture", any) = "" {} } 7 | 8 | CGINCLUDE 9 | #pragma vertex vert 10 | #pragma fragment frag 11 | #pragma target 2.0 12 | 13 | #include "UnityCG.cginc" 14 | 15 | struct appdata_t { 16 | float4 vertex : POSITION; 17 | fixed4 color : COLOR; 18 | float2 texcoord : TEXCOORD0; 19 | UNITY_VERTEX_INPUT_INSTANCE_ID 20 | }; 21 | 22 | struct v2f { 23 | float4 vertex : SV_POSITION; 24 | fixed4 color : COLOR; 25 | float2 texcoord : TEXCOORD0; 26 | UNITY_VERTEX_OUTPUT_STEREO 27 | }; 28 | 29 | sampler2D _MainTex; 30 | 31 | uniform float4 _MainTex_ST; 32 | 33 | v2f vert (appdata_t v) 34 | { 35 | v2f o; 36 | UNITY_SETUP_INSTANCE_ID(v); 37 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 38 | o.vertex = UnityObjectToClipPos(v.vertex); 39 | o.color = v.color; 40 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 41 | return o; 42 | } 43 | 44 | fixed4 frag (v2f i) : SV_Target 45 | { 46 | return 2.0f * tex2D(_MainTex, i.texcoord) * i.color; 47 | } 48 | ENDCG 49 | 50 | SubShader { 51 | 52 | Tags { "RenderType"="Overlay" } 53 | 54 | Lighting Off 55 | Blend SrcAlpha OneMinusSrcAlpha, One One 56 | Cull Off 57 | ZWrite Off 58 | ZTest Always 59 | 60 | Pass { 61 | CGPROGRAM 62 | ENDCG 63 | } 64 | } 65 | 66 | SubShader { 67 | 68 | Tags { "RenderType"="Overlay" } 69 | 70 | Lighting Off 71 | Blend SrcAlpha OneMinusSrcAlpha 72 | Cull Off 73 | ZWrite Off 74 | ZTest Always 75 | 76 | Pass { 77 | CGPROGRAM 78 | ENDCG 79 | } 80 | } 81 | 82 | Fallback off 83 | } 84 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Internal-StencilWrite.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Internal-StencilWrite" 4 | { 5 | SubShader 6 | { 7 | Pass 8 | { 9 | CGPROGRAM 10 | #pragma vertex vert 11 | #pragma fragment frag 12 | #pragma target 2.0 13 | #include "UnityCG.cginc" 14 | struct a2v { 15 | float4 pos : POSITION; 16 | UNITY_VERTEX_INPUT_INSTANCE_ID 17 | }; 18 | struct v2f { 19 | float4 vertex : SV_POSITION; 20 | UNITY_VERTEX_OUTPUT_STEREO 21 | }; 22 | v2f vert (a2v v) 23 | { 24 | v2f o; 25 | UNITY_SETUP_INSTANCE_ID(v); 26 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 27 | o.vertex = UnityObjectToClipPos(v.pos); 28 | return o; 29 | } 30 | fixed4 frag () : SV_Target { return fixed4(0,0,0,0); } 31 | ENDCG 32 | } 33 | } 34 | Fallback Off 35 | } 36 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Lightmap-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Lightmapped/Bumped Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | _LightMap ("Lightmap (RGB)", 2D) = "lightmap" { LightmapMode } 11 | } 12 | FallBack "Legacy Shaders/Lightmapped/Bumped Diffuse" 13 | } 14 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Lightmap-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Lightmapped/Bumped Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | _LightMap ("Lightmap (RGB)", 2D) = "black" {} 9 | } 10 | 11 | SubShader { 12 | LOD 300 13 | Tags { "RenderType" = "Opaque" } 14 | CGPROGRAM 15 | #pragma surface surf Lambert nodynlightmap 16 | struct Input { 17 | float2 uv_MainTex; 18 | float2 uv_BumpMap; 19 | float2 uv2_LightMap; 20 | }; 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | sampler2D _LightMap; 24 | fixed4 _Color; 25 | void surf (Input IN, inout SurfaceOutput o) 26 | { 27 | o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb * _Color; 28 | half4 lm = tex2D (_LightMap, IN.uv2_LightMap); 29 | o.Emission = lm.rgb*o.Albedo.rgb; 30 | o.Alpha = lm.a * _Color.a; 31 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 32 | } 33 | ENDCG 34 | } 35 | FallBack "Legacy Shaders/Lightmapped/Diffuse" 36 | } 37 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Lightmap-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Lightmapped/Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _LightMap ("Lightmap (RGB)", 2D) = "black" {} 8 | } 9 | 10 | SubShader { 11 | LOD 200 12 | Tags { "RenderType" = "Opaque" } 13 | CGPROGRAM 14 | #pragma surface surf Lambert nodynlightmap 15 | struct Input { 16 | float2 uv_MainTex; 17 | float2 uv2_LightMap; 18 | }; 19 | sampler2D _MainTex; 20 | sampler2D _LightMap; 21 | fixed4 _Color; 22 | void surf (Input IN, inout SurfaceOutput o) 23 | { 24 | o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb * _Color; 25 | half4 lm = tex2D (_LightMap, IN.uv2_LightMap); 26 | o.Emission = lm.rgb*o.Albedo.rgb; 27 | o.Alpha = lm.a * _Color.a; 28 | } 29 | ENDCG 30 | } 31 | FallBack "Legacy Shaders/Lightmapped/VertexLit" 32 | } 33 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Lightmap-Glossy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Lightmapped/Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | _LightMap ("Lightmap (RGB)", 2D) = "lightmap" { LightmapMode } 10 | } 11 | FallBack "Legacy Shaders/Lightmapped/Diffuse" 12 | } 13 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Lightmap-VertexLit.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Lightmapped/VertexLit" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Spec Color", Color) = (1,1,1,1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.7 8 | _MainTex ("Base (RGB)", 2D) = "white" {} 9 | _LightMap ("Lightmap (RGB)", 2D) = "lightmap" { LightmapMode } 10 | } 11 | 12 | SubShader { 13 | LOD 100 14 | Tags { "RenderType"="Opaque" } 15 | 16 | Pass { 17 | Name "BASE" 18 | Tags {"LightMode" = "Vertex"} 19 | Material { 20 | Diffuse [_Color] 21 | Shininess [_Shininess] 22 | Specular [_SpecColor] 23 | } 24 | 25 | Lighting On 26 | SeparateSpecular On 27 | 28 | BindChannels { 29 | Bind "Vertex", vertex 30 | Bind "normal", normal 31 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 32 | Bind "texcoord1", texcoord1 // lightmap uses 2nd uv 33 | Bind "texcoord", texcoord2 // main uses 1st uv 34 | } 35 | 36 | SetTexture [_LightMap] { 37 | constantColor [_Color] 38 | combine texture * constant 39 | } 40 | SetTexture [_LightMap] { 41 | constantColor (0.5,0.5,0.5,0.5) 42 | combine previous * constant + primary 43 | } 44 | SetTexture [_MainTex] { 45 | constantColor (1,1,1,1) 46 | combine texture * previous DOUBLE, constant // UNITY_OPAQUE_ALPHA_FFP 47 | } 48 | } 49 | } 50 | 51 | Fallback "VertexLit" 52 | } 53 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-BumpSpec-1DirectionalLight.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Bumped Specular shader. Differences from regular Bumped Specular one: 4 | // - no Main Color nor Specular Color 5 | // - specular lighting directions are approximated per vertex 6 | // - writes zero to alpha channel 7 | // - Normalmap uses Tiling/Offset of the Base texture 8 | // - no Lightmap support 9 | // - supports ONLY 1 directional light. Other lights are completely ignored. 10 | 11 | Shader "Mobile/Bumped Specular (1 Directional Realtime Light)" { 12 | Properties { 13 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 14 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 15 | [NoScaleOffset] _BumpMap ("Normalmap", 2D) = "bump" {} 16 | } 17 | SubShader { 18 | Tags { "RenderType"="Opaque" } 19 | LOD 250 20 | 21 | CGPROGRAM 22 | #pragma surface surf MobileBlinnPhong nolightmap noforwardadd halfasview novertexlights 23 | 24 | inline fixed4 LightingMobileBlinnPhong (SurfaceOutput s, fixed3 lightDir, fixed3 halfDir, fixed atten) 25 | { 26 | fixed diff = max (0, dot (s.Normal, lightDir)); 27 | fixed nh = max (0, dot (s.Normal, halfDir)); 28 | fixed spec = pow (nh, s.Specular*128) * s.Gloss; 29 | 30 | fixed4 c; 31 | c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * spec) * atten; 32 | UNITY_OPAQUE_ALPHA(c.a); 33 | return c; 34 | } 35 | 36 | sampler2D _MainTex; 37 | sampler2D _BumpMap; 38 | half _Shininess; 39 | 40 | struct Input { 41 | float2 uv_MainTex; 42 | }; 43 | 44 | void surf (Input IN, inout SurfaceOutput o) { 45 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 46 | o.Albedo = tex.rgb; 47 | o.Gloss = tex.a; 48 | o.Alpha = tex.a; 49 | o.Specular = _Shininess; 50 | o.Normal = UnpackNormal (tex2D(_BumpMap, IN.uv_MainTex)); 51 | } 52 | ENDCG 53 | } 54 | 55 | FallBack "Mobile/VertexLit" 56 | } 57 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Bumped Specular shader. Differences from regular Bumped Specular one: 4 | // - no Main Color nor Specular Color 5 | // - specular lighting directions are approximated per vertex 6 | // - writes zero to alpha channel 7 | // - Normalmap uses Tiling/Offset of the Base texture 8 | // - no Lightmap support 9 | // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 10 | 11 | Shader "Mobile/Bumped Specular" { 12 | Properties { 13 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 14 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 15 | [NoScaleOffset] _BumpMap ("Normalmap", 2D) = "bump" {} 16 | } 17 | SubShader { 18 | Tags { "RenderType"="Opaque" } 19 | LOD 250 20 | 21 | CGPROGRAM 22 | #pragma surface surf MobileBlinnPhong nolightmap noforwardadd halfasview interpolateview 23 | 24 | inline fixed4 LightingMobileBlinnPhong (SurfaceOutput s, fixed3 lightDir, fixed3 halfDir, fixed atten) 25 | { 26 | fixed diff = max (0, dot (s.Normal, lightDir)); 27 | fixed nh = max (0, dot (s.Normal, halfDir)); 28 | fixed spec = pow (nh, s.Specular*128) * s.Gloss; 29 | 30 | fixed4 c; 31 | c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * spec) * atten; 32 | UNITY_OPAQUE_ALPHA(c.a); 33 | return c; 34 | } 35 | 36 | sampler2D _MainTex; 37 | sampler2D _BumpMap; 38 | half _Shininess; 39 | 40 | struct Input { 41 | float2 uv_MainTex; 42 | }; 43 | 44 | void surf (Input IN, inout SurfaceOutput o) { 45 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 46 | o.Albedo = tex.rgb; 47 | o.Gloss = tex.a; 48 | o.Alpha = tex.a; 49 | o.Specular = _Shininess; 50 | o.Normal = UnpackNormal (tex2D(_BumpMap, IN.uv_MainTex)); 51 | } 52 | ENDCG 53 | } 54 | 55 | FallBack "Mobile/VertexLit" 56 | } 57 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Bumped shader. Differences from regular Bumped one: 4 | // - no Main Color 5 | // - Normalmap uses Tiling/Offset of the Base texture 6 | // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 7 | 8 | Shader "Mobile/Bumped Diffuse" { 9 | Properties { 10 | _MainTex ("Base (RGB)", 2D) = "white" {} 11 | [NoScaleOffset] _BumpMap ("Normalmap", 2D) = "bump" {} 12 | } 13 | 14 | SubShader { 15 | Tags { "RenderType"="Opaque" } 16 | LOD 250 17 | 18 | CGPROGRAM 19 | #pragma surface surf Lambert noforwardadd 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | 24 | struct Input { 25 | float2 uv_MainTex; 26 | }; 27 | 28 | void surf (Input IN, inout SurfaceOutput o) { 29 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 30 | o.Albedo = c.rgb; 31 | o.Alpha = c.a; 32 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex)); 33 | } 34 | ENDCG 35 | } 36 | 37 | FallBack "Mobile/Diffuse" 38 | } 39 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Diffuse shader. Differences from regular Diffuse one: 4 | // - no Main Color 5 | // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 6 | 7 | Shader "Mobile/Diffuse" { 8 | Properties { 9 | _MainTex ("Base (RGB)", 2D) = "white" {} 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 150 14 | 15 | CGPROGRAM 16 | #pragma surface surf Lambert noforwardadd 17 | 18 | sampler2D _MainTex; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 26 | o.Albedo = c.rgb; 27 | o.Alpha = c.a; 28 | } 29 | ENDCG 30 | } 31 | 32 | Fallback "Mobile/VertexLit" 33 | } 34 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-Particle-Add.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Additive Particle shader. Differences from regular Additive Particle one: 4 | // - no Tint color 5 | // - no Smooth particle support 6 | // - no AlphaTest 7 | // - no ColorMask 8 | 9 | Shader "Mobile/Particles/Additive" { 10 | Properties { 11 | _MainTex ("Particle Texture", 2D) = "white" {} 12 | } 13 | 14 | Category { 15 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } 16 | Blend SrcAlpha One 17 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 18 | 19 | BindChannels { 20 | Bind "Color", color 21 | Bind "Vertex", vertex 22 | Bind "TexCoord", texcoord 23 | } 24 | 25 | SubShader { 26 | Pass { 27 | SetTexture [_MainTex] { 28 | combine texture * primary 29 | } 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-Particle-Alpha-VertexLit.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified VertexLit Blended Particle shader. Differences from regular VertexLit Blended Particle one: 4 | // - no AlphaTest 5 | // - no ColorMask 6 | 7 | Shader "Mobile/Particles/VertexLit Blended" { 8 | Properties { 9 | _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0) 10 | _MainTex ("Particle Texture", 2D) = "white" {} 11 | } 12 | 13 | Category { 14 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } 15 | Blend SrcAlpha OneMinusSrcAlpha 16 | Cull Off ZWrite Off Fog { Color (0,0,0,0) } 17 | 18 | Lighting On 19 | Material { Emission [_EmisColor] } 20 | ColorMaterial AmbientAndDiffuse 21 | 22 | SubShader { 23 | Pass { 24 | SetTexture [_MainTex] { 25 | combine texture * primary 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-Particle-Alpha.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Alpha Blended Particle shader. Differences from regular Alpha Blended Particle one: 4 | // - no Tint color 5 | // - no Smooth particle support 6 | // - no AlphaTest 7 | // - no ColorMask 8 | 9 | Shader "Mobile/Particles/Alpha Blended" { 10 | Properties { 11 | _MainTex ("Particle Texture", 2D) = "white" {} 12 | } 13 | 14 | Category { 15 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 18 | 19 | BindChannels { 20 | Bind "Color", color 21 | Bind "Vertex", vertex 22 | Bind "TexCoord", texcoord 23 | } 24 | 25 | SubShader { 26 | Pass { 27 | SetTexture [_MainTex] { 28 | combine texture * primary 29 | } 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-Particle-Multiply.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Multiply Particle shader. Differences from regular Multiply Particle one: 4 | // - no Smooth particle support 5 | // - no AlphaTest 6 | // - no ColorMask 7 | 8 | Shader "Mobile/Particles/Multiply" { 9 | Properties { 10 | _MainTex ("Particle Texture", 2D) = "white" {} 11 | } 12 | 13 | Category { 14 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } 15 | Blend Zero SrcColor 16 | Cull Off Lighting Off ZWrite Off Fog { Color (1,1,1,1) } 17 | 18 | BindChannels { 19 | Bind "Color", color 20 | Bind "Vertex", vertex 21 | Bind "TexCoord", texcoord 22 | } 23 | 24 | SubShader { 25 | Pass { 26 | SetTexture [_MainTex] { 27 | combine texture * primary 28 | } 29 | SetTexture [_MainTex] { 30 | constantColor (1,1,1,1) 31 | combine previous lerp (previous) constant 32 | } 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Mobile/Mobile-Skybox.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified Skybox shader. Differences from regular Skybox one: 4 | // - no tint color 5 | 6 | Shader "Mobile/Skybox" { 7 | Properties { 8 | _FrontTex ("Front (+Z)", 2D) = "white" {} 9 | _BackTex ("Back (-Z)", 2D) = "white" {} 10 | _LeftTex ("Left (+X)", 2D) = "white" {} 11 | _RightTex ("Right (-X)", 2D) = "white" {} 12 | _UpTex ("Up (+Y)", 2D) = "white" {} 13 | _DownTex ("Down (-Y)", 2D) = "white" {} 14 | } 15 | 16 | SubShader { 17 | Tags { "Queue"="Background" "RenderType"="Background" "PreviewType"="Skybox" } 18 | Cull Off ZWrite Off Fog { Mode Off } 19 | Pass { 20 | SetTexture [_FrontTex] { combine texture } 21 | } 22 | Pass { 23 | SetTexture [_BackTex] { combine texture } 24 | } 25 | Pass { 26 | SetTexture [_LeftTex] { combine texture } 27 | } 28 | Pass { 29 | SetTexture [_RightTex] { combine texture } 30 | } 31 | Pass { 32 | SetTexture [_UpTex] { combine texture } 33 | } 34 | Pass { 35 | SetTexture [_DownTex] { combine texture } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Nature/SoftOcclusion/TreeSoftOcclusionBarkRendertex.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Nature/Tree Soft Occlusion Bark Rendertex" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,0) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | _BaseLight ("Base Light", Range(0, 1)) = 0.35 8 | _AO ("Amb. Occlusion", Range(0, 10)) = 2.4 9 | 10 | // These are here only to provide default values 11 | [HideInInspector] _TreeInstanceColor ("TreeInstanceColor", Vector) = (1,1,1,1) 12 | [HideInInspector] _TreeInstanceScale ("TreeInstanceScale", Vector) = (1,1,1,1) 13 | [HideInInspector] _SquashAmount ("Squash", Float) = 1 14 | } 15 | 16 | SubShader { 17 | Pass { 18 | Lighting On 19 | 20 | CGPROGRAM 21 | #pragma vertex bark 22 | #pragma fragment frag 23 | #define WRITE_ALPHA_1 1 24 | #define USE_CUSTOM_LIGHT_DIR 1 25 | #include "UnityBuiltin2xTreeLibrary.cginc" 26 | 27 | sampler2D _MainTex; 28 | 29 | fixed4 frag(v2f input) : SV_Target 30 | { 31 | fixed4 col = input.color; 32 | col.rgb *= tex2D( _MainTex, input.uv.xy).rgb; 33 | UNITY_OPAQUE_ALPHA(col.a); 34 | return col; 35 | } 36 | ENDCG 37 | } 38 | } 39 | 40 | Fallback Off 41 | } 42 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Nature/SoftOcclusion/TreeSoftOcclusionLeavesRendertex.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Nature/Tree Soft Occlusion Leaves Rendertex" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,0) 6 | _MainTex ("Main Texture", 2D) = "white" {} 7 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 8 | _HalfOverCutoff ("0.5 / Alpha cutoff", Range(0,1)) = 1.0 9 | _BaseLight ("Base Light", Range(0, 1)) = 0.35 10 | _AO ("Amb. Occlusion", Range(0, 10)) = 2.4 11 | _Occlusion ("Dir Occlusion", Range(0, 20)) = 7.5 12 | 13 | // These are here only to provide default values 14 | [HideInInspector] _TreeInstanceColor ("TreeInstanceColor", Vector) = (1,1,1,1) 15 | [HideInInspector] _TreeInstanceScale ("TreeInstanceScale", Vector) = (1,1,1,1) 16 | [HideInInspector] _SquashAmount ("Squash", Float) = 1 17 | } 18 | SubShader { 19 | 20 | Tags { "Queue" = "AlphaTest" } 21 | Cull Off 22 | 23 | Pass { 24 | Lighting On 25 | ZWrite On 26 | 27 | CGPROGRAM 28 | #pragma vertex leaves 29 | #pragma fragment frag 30 | #define USE_CUSTOM_LIGHT_DIR 1 31 | #include "UnityBuiltin2xTreeLibrary.cginc" 32 | 33 | sampler2D _MainTex; 34 | fixed _Cutoff; 35 | 36 | fixed4 frag(v2f input) : SV_Target 37 | { 38 | fixed4 col = tex2D( _MainTex, input.uv.xy); 39 | col.rgb *= input.color.rgb; 40 | clip(col.a - _Cutoff); 41 | col.a = 1; 42 | return col; 43 | } 44 | ENDCG 45 | } 46 | } 47 | 48 | Fallback Off 49 | } 50 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorAlbedoRenderTex.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Nature/Tree Creator Albedo Rendertex" { 4 | Properties { 5 | _TranslucencyColor("Translucency Color", Color) = (0.73,0.85,0.41,1) // (187,219,106,255) 6 | _Cutoff("Alpha cutoff", Range(0,1)) = 0.5 7 | _HalfOverCutoff("0.5 / alpha cutoff", Range(0,1)) = 1.0 8 | _TranslucencyViewDependency("View dependency", Range(0,1)) = 0.7 9 | 10 | _MainTex("Base (RGB) Alpha (A)", 2D) = "white" {} 11 | _BumpSpecMap("Normalmap (GA) Spec (R) Shadow Offset (B)", 2D) = "bump" {} 12 | _TranslucencyMap("Trans (B) Gloss(A)", 2D) = "white" {} 13 | } 14 | 15 | SubShader { 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #include "UnityCG.cginc" 22 | #include "UnityBuiltin3xTreeLibrary.cginc" 23 | 24 | struct v2f { 25 | float4 pos : SV_POSITION; 26 | float2 uv : TEXCOORD0; 27 | float3 color : TEXCOORD1; 28 | UNITY_VERTEX_OUTPUT_STEREO 29 | }; 30 | 31 | CBUFFER_START(UnityTerrainImposter) 32 | float3 _TerrainTreeLightDirections[4]; 33 | float4 _TerrainTreeLightColors[4]; 34 | CBUFFER_END 35 | 36 | v2f vert (appdata_full v) { 37 | v2f o; 38 | UNITY_SETUP_INSTANCE_ID(v); 39 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 40 | ExpandBillboard (UNITY_MATRIX_IT_MV, v.vertex, v.normal, v.tangent); 41 | o.pos = UnityObjectToClipPos(v.vertex); 42 | o.uv = v.texcoord.xy; 43 | o.color = v.color.a; 44 | return o; 45 | } 46 | 47 | sampler2D _MainTex; 48 | sampler2D _BumpSpecMap; 49 | sampler2D _TranslucencyMap; 50 | fixed _Cutoff; 51 | 52 | fixed4 frag (v2f i) : SV_Target { 53 | fixed4 col = tex2D (_MainTex, i.uv); 54 | clip (col.a - _Cutoff); 55 | fixed4 translucency = tex2D(_TranslucencyMap, i.uv); 56 | col.a = translucency.b; 57 | return col; 58 | } 59 | ENDCG 60 | } 61 | } 62 | 63 | FallBack Off 64 | } 65 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorBark.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Nature/Tree Creator Bark" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 7 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _GlossMap ("Gloss (A)", 2D) = "black" {} 10 | 11 | // These are here only to provide default values 12 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 13 | [HideInInspector] _TreeInstanceColor ("TreeInstanceColor", Vector) = (1,1,1,1) 14 | [HideInInspector] _TreeInstanceScale ("TreeInstanceScale", Vector) = (1,1,1,1) 15 | [HideInInspector] _SquashAmount ("Squash", Float) = 1 16 | } 17 | 18 | SubShader { 19 | Tags { "IgnoreProjector"="True" "RenderType"="TreeBark" } 20 | LOD 200 21 | 22 | CGPROGRAM 23 | #pragma surface surf BlinnPhong vertex:TreeVertBark addshadow nolightmap 24 | #include "UnityBuiltin3xTreeLibrary.cginc" 25 | 26 | sampler2D _MainTex; 27 | sampler2D _BumpMap; 28 | sampler2D _GlossMap; 29 | half _Shininess; 30 | 31 | struct Input { 32 | float2 uv_MainTex; 33 | fixed4 color : COLOR; 34 | }; 35 | 36 | void surf (Input IN, inout SurfaceOutput o) { 37 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 38 | o.Albedo = c.rgb * IN.color.rgb * IN.color.a; 39 | o.Gloss = tex2D(_GlossMap, IN.uv_MainTex).a; 40 | o.Alpha = c.a; 41 | o.Specular = _Shininess; 42 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex)); 43 | } 44 | ENDCG 45 | } 46 | 47 | Dependency "OptimizedShader" = "Hidden/Nature/Tree Creator Bark Optimized" 48 | FallBack "Diffuse" 49 | } 50 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorLeaves.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Nature/Tree Creator Leaves" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 7 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _GlossMap ("Gloss (A)", 2D) = "black" {} 10 | _TranslucencyMap ("Translucency (A)", 2D) = "white" {} 11 | _ShadowOffset ("Shadow Offset (A)", 2D) = "black" {} 12 | 13 | // These are here only to provide default values 14 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.3 15 | [HideInInspector] _TreeInstanceColor ("TreeInstanceColor", Vector) = (1,1,1,1) 16 | [HideInInspector] _TreeInstanceScale ("TreeInstanceScale", Vector) = (1,1,1,1) 17 | [HideInInspector] _SquashAmount ("Squash", Float) = 1 18 | } 19 | 20 | SubShader { 21 | Tags { "IgnoreProjector"="True" "RenderType"="TreeLeaf" } 22 | LOD 200 23 | 24 | CGPROGRAM 25 | #pragma surface surf TreeLeaf alphatest:_Cutoff vertex:TreeVertLeaf addshadow nolightmap noforwardadd 26 | #include "UnityBuiltin3xTreeLibrary.cginc" 27 | 28 | sampler2D _MainTex; 29 | sampler2D _BumpMap; 30 | sampler2D _GlossMap; 31 | sampler2D _TranslucencyMap; 32 | half _Shininess; 33 | 34 | struct Input { 35 | float2 uv_MainTex; 36 | fixed4 color : COLOR; // color.a = AO 37 | }; 38 | 39 | void surf (Input IN, inout LeafSurfaceOutput o) { 40 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 41 | o.Albedo = c.rgb * IN.color.rgb * IN.color.a; 42 | o.Translucency = tex2D(_TranslucencyMap, IN.uv_MainTex).rgb; 43 | o.Gloss = tex2D(_GlossMap, IN.uv_MainTex).a; 44 | o.Alpha = c.a; 45 | o.Specular = _Shininess; 46 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex)); 47 | } 48 | ENDCG 49 | } 50 | 51 | Dependency "OptimizedShader" = "Hidden/Nature/Tree Creator Leaves Optimized" 52 | FallBack "Diffuse" 53 | } 54 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorNormalRendertex.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Nature/Tree Creator Normal Rendertex" { 4 | Properties { 5 | _TranslucencyColor ("Translucency Color", Color) = (0.73,0.85,0.41,1) // (187,219,106,255) 6 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 7 | _HalfOverCutoff ("0.5 / alpha cutoff", Range(0,1)) = 1.0 8 | _TranslucencyViewDependency ("View dependency", Range(0,1)) = 0.7 9 | 10 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 11 | _BumpSpecMap ("Normalmap (GA) Spec (R) Shadow Offset (B)", 2D) = "bump" {} 12 | _TranslucencyMap ("Trans (B) Gloss(A)", 2D) = "white" {} 13 | } 14 | 15 | SubShader { 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #include "UnityCG.cginc" 22 | #include "UnityBuiltin3xTreeLibrary.cginc" 23 | 24 | struct v2f { 25 | float4 pos : SV_POSITION; 26 | float2 uv : TEXCOORD0; 27 | float3 color : TEXCOORD1; 28 | float3 n : TEXCOORD2; 29 | UNITY_VERTEX_OUTPUT_STEREO 30 | }; 31 | 32 | CBUFFER_START(UnityTerrainImposter) 33 | float3 _TerrainTreeLightDirections[4]; 34 | float4 _TerrainTreeLightColors[4]; 35 | CBUFFER_END 36 | 37 | v2f vert (appdata_full v) { 38 | v2f o; 39 | UNITY_SETUP_INSTANCE_ID(v); 40 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 41 | o.pos = UnityObjectToClipPos(v.vertex); 42 | o.uv = v.texcoord.xy; 43 | o.n = v.normal; 44 | o.color = v.color.a; 45 | return o; 46 | } 47 | 48 | sampler2D _MainTex; 49 | sampler2D _BumpSpecMap; 50 | sampler2D _TranslucencyMap; 51 | fixed _Cutoff; 52 | 53 | half4 frag (v2f i) : SV_Target { 54 | fixed4 col = tex2D (_MainTex, i.uv); 55 | clip (col.a - _Cutoff); 56 | half4 c = 0; 57 | half3 normal = normalize(i.n); 58 | c.xyz = normal.xyz; 59 | return c; 60 | } 61 | ENDCG 62 | } 63 | } 64 | 65 | FallBack Off 66 | } 67 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Bumped Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | CGINCLUDE 13 | sampler2D _MainTex; 14 | sampler2D _BumpMap; 15 | fixed4 _Color; 16 | half _Shininess; 17 | 18 | struct Input { 19 | float2 uv_MainTex; 20 | float2 uv_BumpMap; 21 | }; 22 | 23 | void surf (Input IN, inout SurfaceOutput o) { 24 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 25 | o.Albedo = tex.rgb * _Color.rgb; 26 | o.Gloss = tex.a; 27 | o.Alpha = tex.a * _Color.a; 28 | o.Specular = _Shininess; 29 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 30 | } 31 | ENDCG 32 | 33 | SubShader { 34 | Tags { "RenderType"="Opaque" } 35 | LOD 400 36 | 37 | CGPROGRAM 38 | #pragma surface surf BlinnPhong 39 | #pragma target 3.0 40 | ENDCG 41 | } 42 | 43 | SubShader { 44 | Tags { "RenderType"="Opaque" } 45 | LOD 400 46 | 47 | CGPROGRAM 48 | #pragma surface surf BlinnPhong nodynlightmap 49 | ENDCG 50 | } 51 | 52 | FallBack "Legacy Shaders/Specular" 53 | } 54 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Bumped Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | fixed4 _Color; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float2 uv_BumpMap; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 28 | o.Albedo = c.rgb; 29 | o.Alpha = c.a; 30 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 31 | } 32 | ENDCG 33 | } 34 | 35 | FallBack "Legacy Shaders/Diffuse" 36 | } 37 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | } 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 200 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | fixed4 _Color; 17 | 18 | struct Input { 19 | float2 uv_MainTex; 20 | }; 21 | 22 | void surf (Input IN, inout SurfaceOutput o) { 23 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 24 | o.Albedo = c.rgb; 25 | o.Alpha = c.a; 26 | } 27 | ENDCG 28 | } 29 | 30 | Fallback "Legacy Shaders/VertexLit" 31 | } 32 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-DiffuseDetail.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Diffuse Detail" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _Detail ("Detail (RGB)", 2D) = "gray" {} 8 | } 9 | 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 250 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | 17 | sampler2D _MainTex; 18 | sampler2D _Detail; 19 | fixed4 _Color; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float2 uv_Detail; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 28 | c.rgb *= tex2D(_Detail,IN.uv_Detail).rgb * unity_ColorSpaceDouble.r; 29 | o.Albedo = c.rgb; 30 | o.Alpha = c.a; 31 | } 32 | ENDCG 33 | } 34 | 35 | Fallback "Legacy Shaders/Diffuse" 36 | } 37 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-DiffuseFast.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Does not do anything in 3.x 4 | Shader "Legacy Shaders/Diffuse Fast" { 5 | Properties { 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | _MainTex ("Base (RGB)", 2D) = "white" {} 8 | } 9 | Fallback "Legacy Shaders/VertexLit" 10 | } 11 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-Glossy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | } 10 | 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 300 14 | 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong 17 | 18 | sampler2D _MainTex; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 28 | o.Albedo = tex.rgb * _Color.rgb; 29 | o.Gloss = tex.a; 30 | o.Alpha = tex.a * _Color.a; 31 | o.Specular = _Shininess; 32 | } 33 | ENDCG 34 | } 35 | 36 | Fallback "Legacy Shaders/VertexLit" 37 | } 38 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-Parallax.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Parallax Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | 12 | CGINCLUDE 13 | sampler2D _MainTex; 14 | sampler2D _BumpMap; 15 | sampler2D _ParallaxMap; 16 | fixed4 _Color; 17 | float _Parallax; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_BumpMap; 22 | float3 viewDir; 23 | }; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 27 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 28 | IN.uv_MainTex += offset; 29 | IN.uv_BumpMap += offset; 30 | 31 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 32 | o.Albedo = c.rgb; 33 | o.Alpha = c.a; 34 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 35 | } 36 | ENDCG 37 | 38 | SubShader { 39 | Tags { "RenderType"="Opaque" } 40 | LOD 500 41 | 42 | CGPROGRAM 43 | #pragma surface surf Lambert 44 | #pragma target 3.0 45 | ENDCG 46 | } 47 | 48 | SubShader { 49 | Tags { "RenderType"="Opaque" } 50 | LOD 500 51 | 52 | CGPROGRAM 53 | #pragma surface surf Lambert nodynlightmap 54 | ENDCG 55 | } 56 | 57 | FallBack "Legacy Shaders/Bumped Diffuse" 58 | } 59 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Normal-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Parallax Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 9 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 10 | _BumpMap ("Normalmap", 2D) = "bump" {} 11 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 600 16 | 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong 19 | #pragma target 3.0 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | sampler2D _ParallaxMap; 24 | fixed4 _Color; 25 | half _Shininess; 26 | float _Parallax; 27 | 28 | struct Input { 29 | float2 uv_MainTex; 30 | float2 uv_BumpMap; 31 | float3 viewDir; 32 | }; 33 | 34 | void surf (Input IN, inout SurfaceOutput o) { 35 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 36 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 37 | IN.uv_MainTex += offset; 38 | IN.uv_BumpMap += offset; 39 | 40 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 41 | o.Albedo = tex.rgb * _Color.rgb; 42 | o.Gloss = tex.a; 43 | o.Alpha = tex.a * _Color.a; 44 | o.Specular = _Shininess; 45 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 46 | } 47 | ENDCG 48 | } 49 | 50 | FallBack "Legacy Shaders/Bumped Specular" 51 | } 52 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Particle VertexLit Blended.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Particles/VertexLit Blended" { 4 | Properties { 5 | _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0) 6 | _MainTex ("Particle Texture", 2D) = "white" {} 7 | } 8 | 9 | SubShader { 10 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } 11 | Tags { "LightMode" = "Vertex" } 12 | Cull Off 13 | Lighting On 14 | Material { Emission [_EmisColor] } 15 | ColorMaterial AmbientAndDiffuse 16 | ZWrite Off 17 | ColorMask RGB 18 | Blend SrcAlpha OneMinusSrcAlpha 19 | Pass { 20 | SetTexture [_MainTex] { combine primary * texture } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Reflect-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Reflective/Bumped Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 9 | _MainTex ("Base (RGB) RefStrGloss (A)", 2D) = "white" {} 10 | _Cube ("Reflection Cubemap", Cube) = "" {} 11 | _BumpMap ("Normalmap", 2D) = "bump" {} 12 | } 13 | 14 | SubShader { 15 | Tags { "RenderType"="Opaque" } 16 | LOD 400 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong 19 | #pragma target 3.0 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | samplerCUBE _Cube; 24 | 25 | fixed4 _Color; 26 | fixed4 _ReflectColor; 27 | half _Shininess; 28 | 29 | struct Input { 30 | float2 uv_MainTex; 31 | float2 uv_BumpMap; 32 | float3 worldRefl; 33 | INTERNAL_DATA 34 | }; 35 | 36 | void surf (Input IN, inout SurfaceOutput o) { 37 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 38 | fixed4 c = tex * _Color; 39 | o.Albedo = c.rgb; 40 | 41 | o.Gloss = tex.a; 42 | o.Specular = _Shininess; 43 | 44 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 45 | 46 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 47 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 48 | reflcol *= tex.a; 49 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 50 | o.Alpha = reflcol.a * _ReflectColor.a; 51 | } 52 | ENDCG 53 | } 54 | 55 | FallBack "Legacy Shaders/Reflective/Bumped Diffuse" 56 | } 57 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Reflect-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Reflective/Bumped Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { } 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | SubShader { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 300 15 | 16 | CGPROGRAM 17 | #pragma surface surf Lambert 18 | 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | samplerCUBE _Cube; 22 | 23 | fixed4 _Color; 24 | fixed4 _ReflectColor; 25 | 26 | struct Input { 27 | float2 uv_MainTex; 28 | float2 uv_BumpMap; 29 | float3 worldRefl; 30 | INTERNAL_DATA 31 | }; 32 | 33 | void surf (Input IN, inout SurfaceOutput o) { 34 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 35 | fixed4 c = tex * _Color; 36 | o.Albedo = c.rgb; 37 | 38 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 39 | 40 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 41 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 42 | reflcol *= tex.a; 43 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 44 | o.Alpha = reflcol.a * _ReflectColor.a; 45 | } 46 | ENDCG 47 | } 48 | 49 | FallBack "Legacy Shaders/Reflective/VertexLit" 50 | } 51 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Reflect-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Reflective/Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" {} 9 | } 10 | SubShader { 11 | LOD 200 12 | Tags { "RenderType"="Opaque" } 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | 17 | sampler2D _MainTex; 18 | samplerCUBE _Cube; 19 | 20 | fixed4 _Color; 21 | fixed4 _ReflectColor; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | float3 worldRefl; 26 | }; 27 | 28 | void surf (Input IN, inout SurfaceOutput o) { 29 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 30 | fixed4 c = tex * _Color; 31 | o.Albedo = c.rgb; 32 | 33 | fixed4 reflcol = texCUBE (_Cube, IN.worldRefl); 34 | reflcol *= tex.a; 35 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 36 | o.Alpha = reflcol.a * _ReflectColor.a; 37 | } 38 | ENDCG 39 | } 40 | 41 | FallBack "Legacy Shaders/Reflective/VertexLit" 42 | } 43 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Reflect-Glossy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Reflective/Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 9 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 10 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" {} 11 | } 12 | SubShader { 13 | LOD 300 14 | Tags { "RenderType"="Opaque" } 15 | 16 | CGPROGRAM 17 | #pragma surface surf BlinnPhong 18 | 19 | sampler2D _MainTex; 20 | samplerCUBE _Cube; 21 | 22 | fixed4 _Color; 23 | fixed4 _ReflectColor; 24 | half _Shininess; 25 | 26 | struct Input { 27 | float2 uv_MainTex; 28 | float3 worldRefl; 29 | }; 30 | 31 | void surf (Input IN, inout SurfaceOutput o) { 32 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 33 | fixed4 c = tex * _Color; 34 | o.Albedo = c.rgb; 35 | o.Gloss = tex.a; 36 | o.Specular = _Shininess; 37 | 38 | fixed4 reflcol = texCUBE (_Cube, IN.worldRefl); 39 | reflcol *= tex.a; 40 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 41 | o.Alpha = reflcol.a * _ReflectColor.a; 42 | } 43 | ENDCG 44 | } 45 | 46 | FallBack "Legacy Shaders/Reflective/VertexLit" 47 | } 48 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Reflect-Parallax.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Reflective/Parallax Diffuse" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 8 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 9 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" {} 10 | _BumpMap ("Normalmap", 2D) = "bump" {} 11 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 500 16 | 17 | CGPROGRAM 18 | #pragma surface surf Lambert 19 | #pragma target 3.0 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | samplerCUBE _Cube; 24 | sampler2D _ParallaxMap; 25 | 26 | fixed4 _Color; 27 | fixed4 _ReflectColor; 28 | float _Parallax; 29 | 30 | struct Input { 31 | float2 uv_MainTex; 32 | float2 uv_BumpMap; 33 | float3 worldRefl; 34 | float3 viewDir; 35 | INTERNAL_DATA 36 | }; 37 | 38 | void surf (Input IN, inout SurfaceOutput o) { 39 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 40 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 41 | IN.uv_MainTex += offset; 42 | IN.uv_BumpMap += offset; 43 | 44 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 45 | fixed4 c = tex * _Color; 46 | o.Albedo = c.rgb; 47 | 48 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 49 | 50 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 51 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 52 | reflcol *= tex.a; 53 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 54 | o.Alpha = reflcol.a * _ReflectColor.a; 55 | } 56 | ENDCG 57 | } 58 | 59 | FallBack "Legacy Shaders/Reflective/Bumped Diffuse" 60 | } 61 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Reflect-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Legacy Shaders/Reflective/Parallax Specular" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1) 7 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 8 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 9 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 10 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" { } 11 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" {} 12 | _BumpMap ("Normalmap", 2D) = "bump" { } 13 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 14 | } 15 | SubShader { 16 | Tags { "RenderType"="Opaque" } 17 | LOD 600 18 | 19 | CGPROGRAM 20 | #pragma surface surf BlinnPhong 21 | #pragma target 3.0 22 | 23 | sampler2D _MainTex; 24 | sampler2D _BumpMap; 25 | samplerCUBE _Cube; 26 | sampler2D _ParallaxMap; 27 | 28 | fixed4 _Color; 29 | fixed4 _ReflectColor; 30 | half _Shininess; 31 | float _Parallax; 32 | 33 | struct Input { 34 | float2 uv_MainTex; 35 | float2 uv_BumpMap; 36 | float3 worldRefl; 37 | float3 viewDir; 38 | INTERNAL_DATA 39 | }; 40 | 41 | void surf (Input IN, inout SurfaceOutput o) { 42 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 43 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 44 | IN.uv_MainTex += offset; 45 | IN.uv_BumpMap += offset; 46 | 47 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 48 | o.Albedo = tex.rgb * _Color.rgb; 49 | o.Gloss = tex.a; 50 | o.Specular = _Shininess; 51 | 52 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 53 | 54 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 55 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 56 | reflcol *= tex.a; 57 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 58 | o.Alpha = reflcol.a * _ReflectColor.a; 59 | } 60 | ENDCG 61 | } 62 | 63 | FallBack "Legacy Shaders/Reflective/Bumped Specular" 64 | } 65 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Sprites-Default.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Sprites/Default" 4 | { 5 | Properties 6 | { 7 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 8 | _Color ("Tint", Color) = (1,1,1,1) 9 | [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 10 | [HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1) 11 | [HideInInspector] _Flip ("Flip", Vector) = (1,1,1,1) 12 | [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {} 13 | [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0 14 | } 15 | 16 | SubShader 17 | { 18 | Tags 19 | { 20 | "Queue"="Transparent" 21 | "IgnoreProjector"="True" 22 | "RenderType"="Transparent" 23 | "PreviewType"="Plane" 24 | "CanUseSpriteAtlas"="True" 25 | } 26 | 27 | Cull Off 28 | Lighting Off 29 | ZWrite Off 30 | Blend One OneMinusSrcAlpha 31 | 32 | Pass 33 | { 34 | CGPROGRAM 35 | #pragma vertex SpriteVert 36 | #pragma fragment SpriteFrag 37 | #pragma target 2.0 38 | #pragma multi_compile_instancing 39 | #pragma multi_compile_local _ PIXELSNAP_ON 40 | #pragma multi_compile _ ETC1_EXTERNAL_ALPHA 41 | #include "UnitySprites.cginc" 42 | ENDCG 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Details/WavingGrassBillboard.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/TerrainEngine/Details/BillboardWavingDoublePass" { 4 | Properties { 5 | _WavingTint ("Fade Color", Color) = (.7,.6,.5, 0) 6 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 7 | _WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1) 8 | _Cutoff ("Cutoff", float) = 0.5 9 | } 10 | 11 | CGINCLUDE 12 | #include "UnityCG.cginc" 13 | #include "TerrainEngine.cginc" 14 | 15 | struct v2f { 16 | float4 pos : SV_POSITION; 17 | fixed4 color : COLOR; 18 | float4 uv : TEXCOORD0; 19 | UNITY_VERTEX_OUTPUT_STEREO 20 | }; 21 | v2f BillboardVert (appdata_full v) { 22 | v2f o; 23 | UNITY_SETUP_INSTANCE_ID(v); 24 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 25 | WavingGrassBillboardVert (v); 26 | o.color = v.color; 27 | 28 | o.color.rgb *= ShadeVertexLights (v.vertex, v.normal); 29 | 30 | o.pos = UnityObjectToClipPos(v.vertex); 31 | o.uv = v.texcoord; 32 | return o; 33 | } 34 | ENDCG 35 | 36 | SubShader { 37 | Tags { 38 | "Queue" = "Geometry+200" 39 | "IgnoreProjector"="True" 40 | "RenderType"="GrassBillboard" 41 | "DisableBatching"="True" 42 | } 43 | Cull Off 44 | LOD 200 45 | ColorMask RGB 46 | 47 | CGPROGRAM 48 | #pragma surface surf Lambert vertex:WavingGrassBillboardVert addshadow fullforwardshadows exclude_path:deferred 49 | 50 | sampler2D _MainTex; 51 | fixed _Cutoff; 52 | 53 | struct Input { 54 | float2 uv_MainTex; 55 | fixed4 color : COLOR; 56 | }; 57 | 58 | void surf (Input IN, inout SurfaceOutput o) { 59 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 60 | o.Albedo = c.rgb; 61 | o.Alpha = c.a; 62 | clip (o.Alpha - _Cutoff); 63 | o.Alpha *= IN.color.a; 64 | } 65 | 66 | ENDCG 67 | } 68 | 69 | Fallback Off 70 | } 71 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Splats/AddPass.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/TerrainEngine/Splatmap/Diffuse-AddPass" { 4 | Properties{ 5 | [HideInInspector] _TerrainHolesTexture("Holes Map (RGB)", 2D) = "white" {} 6 | } 7 | CGINCLUDE 8 | #pragma surface surf Lambert decal:add vertex:SplatmapVert finalcolor:SplatmapFinalColor finalgbuffer:SplatmapFinalGBuffer fullforwardshadows nometa 9 | #pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap forwardadd 10 | #pragma multi_compile_fog 11 | 12 | #define TERRAIN_SPLAT_ADDPASS 13 | #include "TerrainSplatmapCommon.cginc" 14 | 15 | void surf(Input IN, inout SurfaceOutput o) 16 | { 17 | half4 splat_control; 18 | half weight; 19 | fixed4 mixedDiffuse; 20 | SplatmapMix(IN, splat_control, weight, mixedDiffuse, o.Normal); 21 | o.Albedo = mixedDiffuse.rgb; 22 | o.Alpha = weight; 23 | } 24 | ENDCG 25 | 26 | Category { 27 | Tags { 28 | "Queue" = "Geometry-99" 29 | "IgnoreProjector"="True" 30 | "RenderType" = "Opaque" 31 | } 32 | // TODO: Seems like "#pragma target 3.0 _NORMALMAP" can't fallback correctly on less capable devices? 33 | // Use two sub-shaders to simulate different features for different targets and still fallback correctly. 34 | SubShader { // for sm3.0+ targets 35 | CGPROGRAM 36 | #pragma target 3.0 37 | #pragma multi_compile_local_fragment __ _ALPHATEST_ON 38 | #pragma multi_compile_local __ _NORMALMAP 39 | ENDCG 40 | } 41 | SubShader { // for sm2.0 targets 42 | CGPROGRAM 43 | ENDCG 44 | } 45 | } 46 | 47 | Fallback off 48 | } 49 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Splats/DiffuseBase.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/TerrainEngine/Splatmap/Diffuse-Base" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | [HideInInspector] _TerrainHolesTexture("Holes Map (RGB)", 2D) = "white" {} 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 200 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert vertex:SplatmapVert addshadow fullforwardshadows 15 | #pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap forwardadd 16 | 17 | #pragma multi_compile_local_fragment __ _ALPHATEST_ON 18 | 19 | #define TERRAIN_BASE_PASS 20 | #include "TerrainSplatmapCommon.cginc" 21 | 22 | sampler2D _MainTex; 23 | fixed4 _Color; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | #ifdef _ALPHATEST_ON 27 | ClipHoles(IN.tc.xy); 28 | #endif 29 | fixed4 c = tex2D(_MainTex, IN.tc.xy) * _Color; 30 | o.Albedo = c.rgb; 31 | o.Alpha = c.a; 32 | } 33 | ENDCG 34 | 35 | UsePass "Hidden/Nature/Terrain/Utilities/PICKING" 36 | UsePass "Hidden/Nature/Terrain/Utilities/SELECTION" 37 | } 38 | 39 | Fallback "Legacy Shaders/VertexLit" 40 | } 41 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Splats/Specular-AddPass.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/TerrainEngine/Splatmap/Specular-AddPass" { 4 | Properties { 5 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 6 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 7 | [HideInInspector] _TerrainHolesTexture("Holes Map (RGB)", 2D) = "white" {} 8 | } 9 | 10 | SubShader { 11 | Tags { 12 | "Queue" = "Geometry-99" 13 | "IgnoreProjector"="True" 14 | "RenderType" = "Opaque" 15 | } 16 | 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong decal:add vertex:SplatmapVert finalcolor:SplatmapFinalColor finalgbuffer:SplatmapFinalGBuffer fullforwardshadows nometa 19 | #pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap forwardadd 20 | #pragma multi_compile_fog 21 | #pragma multi_compile_local_fragment __ _ALPHATEST_ON 22 | #pragma multi_compile_local __ _NORMALMAP 23 | #pragma target 3.0 24 | 25 | #define TERRAIN_SPLAT_ADDPASS 26 | #include "TerrainSplatmapCommon.cginc" 27 | 28 | half _Shininess; 29 | 30 | void surf(Input IN, inout SurfaceOutput o) 31 | { 32 | half4 splat_control; 33 | half weight; 34 | fixed4 mixedDiffuse; 35 | SplatmapMix(IN, splat_control, weight, mixedDiffuse, o.Normal); 36 | o.Albedo = mixedDiffuse.rgb; 37 | o.Alpha = weight; 38 | o.Gloss = mixedDiffuse.a; 39 | o.Specular = _Shininess; 40 | } 41 | ENDCG 42 | } 43 | 44 | Fallback "Hidden/TerrainEngine/Splatmap/Diffuse-AddPass" 45 | } 46 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Splats/Specular-Base.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/TerrainEngine/Splatmap/Specular-Base" { 4 | Properties { 5 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 6 | [PowerSlider(5.0)] _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 7 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 8 | 9 | // used in fallback on old cards 10 | _Color ("Main Color", Color) = (1,1,1,1) 11 | 12 | [HideInInspector] _TerrainHolesTexture("Holes Map (RGB)", 2D) = "white" {} 13 | } 14 | 15 | SubShader { 16 | Tags { 17 | "RenderType" = "Opaque" 18 | "Queue" = "Geometry-100" 19 | } 20 | LOD 200 21 | 22 | CGPROGRAM 23 | #pragma surface surf BlinnPhong vertex:SplatmapVert addshadow fullforwardshadows 24 | #pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap forwardadd 25 | 26 | #pragma multi_compile_local_fragment __ _ALPHATEST_ON 27 | 28 | #define TERRAIN_BASE_PASS 29 | #define TERRAIN_SURFACE_OUTPUT SurfaceOutput 30 | #include "TerrainSplatmapCommon.cginc" 31 | 32 | sampler2D _MainTex; 33 | half _Shininess; 34 | 35 | void surf (Input IN, inout SurfaceOutput o) { 36 | #ifdef _ALPHATEST_ON 37 | ClipHoles(IN.tc.xy); 38 | #endif 39 | fixed4 tex = tex2D(_MainTex, IN.tc.xy); 40 | o.Albedo = tex.rgb; 41 | o.Gloss = tex.a; 42 | o.Alpha = 1.0f; 43 | o.Specular = _Shininess; 44 | } 45 | ENDCG 46 | 47 | UsePass "Hidden/Nature/Terrain/Utilities/PICKING" 48 | UsePass "Hidden/Nature/Terrain/Utilities/SELECTION" 49 | } 50 | 51 | FallBack "Legacy Shaders/Specular" 52 | } 53 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Trees/BillboardTree.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/TerrainEngine/BillboardTree" { 4 | Properties { 5 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 6 | } 7 | 8 | SubShader { 9 | Tags { "Queue" = "Transparent-100" "IgnoreProjector"="True" "RenderType"="TreeBillboard" } 10 | 11 | Pass { 12 | ColorMask rgb 13 | Blend SrcAlpha OneMinusSrcAlpha 14 | ZWrite Off Cull Off 15 | 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #pragma multi_compile_fog 20 | #include "UnityCG.cginc" 21 | #include "TerrainEngine.cginc" 22 | 23 | struct v2f { 24 | float4 pos : SV_POSITION; 25 | fixed4 color : COLOR0; 26 | float2 uv : TEXCOORD0; 27 | UNITY_FOG_COORDS(1) 28 | UNITY_VERTEX_OUTPUT_STEREO 29 | }; 30 | 31 | v2f vert (appdata_tree_billboard v) { 32 | v2f o; 33 | UNITY_SETUP_INSTANCE_ID(v); 34 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 35 | TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y); 36 | o.pos = UnityObjectToClipPos(v.vertex); 37 | o.uv.x = v.texcoord.x; 38 | o.uv.y = v.texcoord.y > 0; 39 | o.color = v.color; 40 | UNITY_TRANSFER_FOG(o,o.pos); 41 | return o; 42 | } 43 | 44 | sampler2D _MainTex; 45 | fixed4 frag(v2f input) : SV_Target 46 | { 47 | fixed4 col = tex2D( _MainTex, input.uv); 48 | col.rgb *= input.color.rgb; 49 | clip(col.a); 50 | UNITY_APPLY_FOG(input.fogCoord, col); 51 | return col; 52 | } 53 | ENDCG 54 | } 55 | } 56 | 57 | Fallback Off 58 | } 59 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Utils/TerrainBlitCopyZWrite.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Duplicate of Internal-BlitCopy, with ZTest and ZWrite On to support extended edge sampling in PaintContext 4 | Shader "Hidden/TerrainEngine/TerrainBlitCopyZWrite" { 5 | Properties 6 | { 7 | _MainTex ("Texture", any) = "" {} 8 | _Color("Multiplicative color", Color) = (1.0, 1.0, 1.0, 1.0) 9 | } 10 | SubShader { 11 | Pass { 12 | ZTest LEqual Cull Off ZWrite On 13 | 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #include "UnityCG.cginc" 18 | 19 | UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); 20 | uniform float4 _MainTex_ST; 21 | uniform float4 _Color; 22 | 23 | struct appdata_t { 24 | float4 vertex : POSITION; 25 | float2 texcoord : TEXCOORD0; 26 | UNITY_VERTEX_INPUT_INSTANCE_ID 27 | }; 28 | 29 | struct v2f { 30 | float4 vertex : SV_POSITION; 31 | float2 texcoord : TEXCOORD0; 32 | UNITY_VERTEX_OUTPUT_STEREO 33 | }; 34 | 35 | v2f vert (appdata_t v) 36 | { 37 | v2f o; 38 | UNITY_SETUP_INSTANCE_ID(v); 39 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 40 | o.vertex = UnityObjectToClipPos(v.vertex); 41 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 42 | return o; 43 | } 44 | 45 | float4 frag (v2f i) : SV_Target 46 | { 47 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); 48 | return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.texcoord) * _Color; 49 | } 50 | ENDCG 51 | 52 | } 53 | } 54 | Fallback Off 55 | } 56 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/TerrainShaders/Utils/TerrainHeightBlitCopy.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/TerrainEngine/HeightBlitCopy" { 4 | Properties 5 | { 6 | _MainTex ("Texture", any) = "" {} 7 | } 8 | SubShader { 9 | Pass { 10 | // ZTest and ZWrite On to support extended edge sampling in PaintContext 11 | ZTest LEqual Cull Off ZWrite On 12 | 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #include "UnityCG.cginc" 17 | 18 | UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); 19 | uniform float4 _MainTex_ST; 20 | uniform float _Height_Offset; 21 | uniform float _Height_Scale; 22 | 23 | struct appdata_t { 24 | float4 vertex : POSITION; 25 | float2 texcoord : TEXCOORD0; 26 | UNITY_VERTEX_INPUT_INSTANCE_ID 27 | }; 28 | 29 | struct v2f { 30 | float4 vertex : SV_POSITION; 31 | float2 texcoord : TEXCOORD0; 32 | UNITY_VERTEX_OUTPUT_STEREO 33 | }; 34 | 35 | v2f vert (appdata_t v) 36 | { 37 | v2f o; 38 | UNITY_SETUP_INSTANCE_ID(v); 39 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 40 | o.vertex = UnityObjectToClipPos(v.vertex); 41 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 42 | return o; 43 | } 44 | 45 | float4 frag (v2f i) : SV_Target 46 | { 47 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); 48 | float height = UnpackHeightmap(UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.texcoord)); 49 | height = height * _Height_Scale + _Height_Offset; 50 | return PackHeightmap(height); 51 | } 52 | ENDCG 53 | 54 | } 55 | } 56 | Fallback Off 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/UI/UI-DefaultFont.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "UI/Default Font" { 4 | Properties { 5 | [PerRendererData] _MainTex ("Font Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | 16 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 17 | } 18 | 19 | FallBack "UI/Default" 20 | } 21 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/UI/UI-Unlit-Text.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "UI/Unlit/Text" 4 | { 5 | Properties { 6 | [PerRendererData] _MainTex ("Font Texture", 2D) = "white" {} 7 | _Color ("Tint", Color) = (1,1,1,1) 8 | 9 | _StencilComp ("Stencil Comparison", Float) = 8 10 | _Stencil ("Stencil ID", Float) = 0 11 | _StencilOp ("Stencil Operation", Float) = 0 12 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 13 | _StencilReadMask ("Stencil Read Mask", Float) = 255 14 | 15 | _ColorMask ("Color Mask", Float) = 15 16 | 17 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 18 | } 19 | 20 | FallBack "UI/Default Font" 21 | } 22 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/UI/UI-Unlit-TextDetail.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "UI/Unlit/Text Detail" 4 | { 5 | Properties 6 | { 7 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 8 | _Color ("Main Color", Color) = (1,1,1,1) 9 | 10 | _DetailTex ("Detail (RGB)", 2D) = "white" {} 11 | _Strength ("Detail Strength", Range(0.0, 1.0)) = 0.2 12 | 13 | _StencilComp ("Stencil Comparison", Float) = 8 14 | _Stencil ("Stencil ID", Float) = 0 15 | _StencilOp ("Stencil Operation", Float) = 0 16 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 17 | _StencilReadMask ("Stencil Read Mask", Float) = 255 18 | 19 | _ColorMask ("Color Mask", Float) = 15 20 | 21 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 22 | } 23 | 24 | FallBack "UI/Unlit/Detail" 25 | } 26 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/UI/UI-Unlit-Transparent.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "UI/Unlit/Transparent" 4 | { 5 | Properties 6 | { 7 | _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {} 8 | _Color ("Tint", Color) = (1,1,1,1) 9 | 10 | _StencilComp ("Stencil Comparison", Float) = 8 11 | _Stencil ("Stencil ID", Float) = 0 12 | _StencilOp ("Stencil Operation", Float) = 0 13 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 14 | _StencilReadMask ("Stencil Read Mask", Float) = 255 15 | 16 | _ColorMask ("Color Mask", Float) = 15 17 | 18 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 19 | } 20 | FallBack "UI/Default" 21 | } 22 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Unlit/Unlit-Alpha.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Unlit alpha-blended shader. 4 | // - no lighting 5 | // - no lightmap support 6 | // - no per-material color 7 | 8 | Shader "Unlit/Transparent" { 9 | Properties { 10 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 11 | } 12 | 13 | SubShader { 14 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 15 | LOD 100 16 | 17 | ZWrite Off 18 | Blend SrcAlpha OneMinusSrcAlpha 19 | 20 | Pass { 21 | CGPROGRAM 22 | #pragma vertex vert 23 | #pragma fragment frag 24 | #pragma target 2.0 25 | #pragma multi_compile_fog 26 | 27 | #include "UnityCG.cginc" 28 | 29 | struct appdata_t { 30 | float4 vertex : POSITION; 31 | float2 texcoord : TEXCOORD0; 32 | UNITY_VERTEX_INPUT_INSTANCE_ID 33 | }; 34 | 35 | struct v2f { 36 | float4 vertex : SV_POSITION; 37 | float2 texcoord : TEXCOORD0; 38 | UNITY_FOG_COORDS(1) 39 | UNITY_VERTEX_OUTPUT_STEREO 40 | }; 41 | 42 | sampler2D _MainTex; 43 | float4 _MainTex_ST; 44 | 45 | v2f vert (appdata_t v) 46 | { 47 | v2f o; 48 | UNITY_SETUP_INSTANCE_ID(v); 49 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 50 | o.vertex = UnityObjectToClipPos(v.vertex); 51 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 52 | UNITY_TRANSFER_FOG(o,o.vertex); 53 | return o; 54 | } 55 | 56 | fixed4 frag (v2f i) : SV_Target 57 | { 58 | fixed4 col = tex2D(_MainTex, i.texcoord); 59 | UNITY_APPLY_FOG(i.fogCoord, col); 60 | return col; 61 | } 62 | ENDCG 63 | } 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Unlit/Unlit-Color.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Unlit shader. Simplest possible colored shader. 4 | // - no lighting 5 | // - no lightmap support 6 | // - no texture 7 | 8 | Shader "Unlit/Color" { 9 | Properties { 10 | _Color ("Main Color", Color) = (1,1,1,1) 11 | } 12 | 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 100 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #pragma target 2.0 22 | #pragma multi_compile_fog 23 | 24 | #include "UnityCG.cginc" 25 | 26 | struct appdata_t { 27 | float4 vertex : POSITION; 28 | UNITY_VERTEX_INPUT_INSTANCE_ID 29 | }; 30 | 31 | struct v2f { 32 | float4 vertex : SV_POSITION; 33 | UNITY_FOG_COORDS(0) 34 | UNITY_VERTEX_OUTPUT_STEREO 35 | }; 36 | 37 | fixed4 _Color; 38 | 39 | v2f vert (appdata_t v) 40 | { 41 | v2f o; 42 | UNITY_SETUP_INSTANCE_ID(v); 43 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 44 | o.vertex = UnityObjectToClipPos(v.vertex); 45 | UNITY_TRANSFER_FOG(o,o.vertex); 46 | return o; 47 | } 48 | 49 | fixed4 frag (v2f i) : SV_Target 50 | { 51 | fixed4 col = _Color; 52 | UNITY_APPLY_FOG(i.fogCoord, col); 53 | UNITY_OPAQUE_ALPHA(col.a); 54 | return col; 55 | } 56 | ENDCG 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/Unlit/Unlit-Normal.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Unlit shader. Simplest possible textured shader. 4 | // - no lighting 5 | // - no lightmap support 6 | // - no per-material color 7 | 8 | Shader "Unlit/Texture" { 9 | Properties { 10 | _MainTex ("Base (RGB)", 2D) = "white" {} 11 | } 12 | 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 100 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #pragma target 2.0 22 | #pragma multi_compile_fog 23 | 24 | #include "UnityCG.cginc" 25 | 26 | struct appdata_t { 27 | float4 vertex : POSITION; 28 | float2 texcoord : TEXCOORD0; 29 | UNITY_VERTEX_INPUT_INSTANCE_ID 30 | }; 31 | 32 | struct v2f { 33 | float4 vertex : SV_POSITION; 34 | float2 texcoord : TEXCOORD0; 35 | UNITY_FOG_COORDS(1) 36 | UNITY_VERTEX_OUTPUT_STEREO 37 | }; 38 | 39 | sampler2D _MainTex; 40 | float4 _MainTex_ST; 41 | 42 | v2f vert (appdata_t v) 43 | { 44 | v2f o; 45 | UNITY_SETUP_INSTANCE_ID(v); 46 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 47 | o.vertex = UnityObjectToClipPos(v.vertex); 48 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 49 | UNITY_TRANSFER_FOG(o,o.vertex); 50 | return o; 51 | } 52 | 53 | fixed4 frag (v2f i) : SV_Target 54 | { 55 | fixed4 col = tex2D(_MainTex, i.texcoord); 56 | UNITY_APPLY_FOG(i.fogCoord, col); 57 | UNITY_OPAQUE_ALPHA(col.a); 58 | return col; 59 | } 60 | ENDCG 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/VR/Shaders/BlitTexArraySlice.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/VR/BlitTexArraySlice" { 4 | Properties { _MainTex ("Texture", any) = "" {} } 5 | SubShader { 6 | Pass { 7 | ZTest Always Cull Off ZWrite Off 8 | 9 | CGPROGRAM 10 | #pragma vertex vert 11 | #pragma fragment frag 12 | #pragma target 3.5 13 | 14 | #include "UnityCG.cginc" 15 | 16 | UNITY_DECLARE_TEX2DARRAY(_MainTex); 17 | uniform float4 _MainTex_ST; 18 | uniform float _ArraySliceIndex; 19 | 20 | struct appdata_t { 21 | float4 vertex : POSITION; 22 | float2 texcoord : TEXCOORD0; 23 | }; 24 | 25 | struct v2f { 26 | float4 vertex : SV_POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | v2f vert (appdata_t v) 31 | { 32 | v2f o; 33 | o.vertex = UnityObjectToClipPos(v.vertex); 34 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 35 | return o; 36 | } 37 | 38 | fixed4 frag (v2f i) : SV_Target 39 | { 40 | return UNITY_SAMPLE_TEX2DARRAY(_MainTex, float3(i.texcoord.xy, _ArraySliceIndex)); 41 | } 42 | ENDCG 43 | } 44 | } 45 | Fallback Off 46 | } 47 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/VR/Shaders/BlitTexArraySliceToDepth.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/VR/BlitTexArraySliceToDepth" { 4 | Properties { _MainTex ("Texture", any) = "" {} } 5 | SubShader { 6 | Pass { 7 | ZTest Always Cull Off ZWrite On ColorMask 0 8 | 9 | CGPROGRAM 10 | #pragma vertex vert 11 | #pragma fragment frag 12 | #pragma target 3.5 13 | 14 | #include "UnityCG.cginc" 15 | 16 | UNITY_DECLARE_TEX2DARRAY(_MainTex); 17 | uniform float4 _MainTex_ST; 18 | uniform float _ArraySliceIndex; 19 | 20 | struct appdata_t { 21 | float4 vertex : POSITION; 22 | float2 texcoord : TEXCOORD0; 23 | }; 24 | 25 | struct v2f { 26 | float4 vertex : SV_POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | v2f vert (appdata_t v) 31 | { 32 | v2f o; 33 | o.vertex = UnityObjectToClipPos(v.vertex); 34 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 35 | return o; 36 | } 37 | 38 | fixed4 frag (v2f i, out float oDepth : SV_Depth) : SV_Target 39 | { 40 | oDepth = UNITY_SAMPLE_TEX2DARRAY(_MainTex, float3(i.texcoord.xy, _ArraySliceIndex)).x; 41 | return fixed4(oDepth, 0, 0, 1); 42 | } 43 | ENDCG 44 | } 45 | } 46 | Fallback Off 47 | } 48 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/VR/Shaders/Internal-VRDistortion.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/VR/Internal-VRDistortion" { 4 | Properties { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | } 7 | SubShader { 8 | Tags { "RenderType"="Opaque" } 9 | Cull Off 10 | ZTest Always 11 | ZWrite Off 12 | 13 | Pass { 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | 18 | #include "UnityCG.cginc" 19 | 20 | struct appdata { 21 | float4 vertex : POSITION; 22 | float2 uv : TEXCOORD0; 23 | }; 24 | 25 | struct v2f { 26 | float2 uv : TEXCOORD0; 27 | float4 vertex : SV_POSITION; 28 | }; 29 | 30 | sampler2D _MainTex; 31 | float4 _MainTex_ST; 32 | 33 | v2f vert (appdata v) 34 | { 35 | v2f o; 36 | o.vertex = UnityObjectToClipPos(v.vertex); 37 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 38 | return o; 39 | } 40 | 41 | fixed4 frag (v2f i) : SV_Target 42 | { 43 | return tex2D(_MainTex, i.uv); 44 | } 45 | ENDCG 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/VR/Shaders/SpatialMappingOcclusion.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "VR/SpatialMapping/Occlusion" 4 | { 5 | // The HoloLens uses an additive display. This means 6 | // that the color black is transparent. When physical 7 | // surfaces are rendered, it will look as though nothing 8 | // is being rendered. You will still see the physical surface. 9 | // However since geometry is actually rendered, game objects 10 | // behind the physical surface will be occluded. 11 | 12 | SubShader 13 | { 14 | // Render the Occlusion shader before all 15 | // opaque geometry to prime the depth buffer. 16 | Tags { "Queue"="Geometry-1" } 17 | 18 | ZWrite On 19 | ZTest LEqual 20 | ColorMask 0 21 | 22 | Pass 23 | { 24 | CGPROGRAM 25 | #pragma vertex vert 26 | #pragma fragment frag 27 | 28 | #include "UnityCG.cginc" 29 | 30 | struct appdata 31 | { 32 | float4 vertex : POSITION; 33 | UNITY_VERTEX_INPUT_INSTANCE_ID 34 | }; 35 | 36 | struct v2f 37 | { 38 | float4 position : SV_POSITION; 39 | UNITY_VERTEX_OUTPUT_STEREO 40 | }; 41 | 42 | v2f vert (appdata input) 43 | { 44 | v2f output; 45 | UNITY_SETUP_INSTANCE_ID(input); 46 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); 47 | 48 | output.position = UnityObjectToClipPos(input.vertex); 49 | return output; 50 | } 51 | 52 | fixed4 frag (v2f input) : SV_Target 53 | { 54 | return fixed4(0.0, 0.0, 0.0, 0.0); 55 | } 56 | ENDCG 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Shaders/DefaultResourcesExtra/VideoComposite.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/VideoComposite" 4 | { 5 | Properties 6 | { 7 | _MainTex ("_MainTex (A)", 2D) = "black" 8 | } 9 | 10 | CGINCLUDE 11 | 12 | #include "UnityCG.cginc" 13 | 14 | sampler2D _MainTex; 15 | float _AlphaParam; 16 | float4 _RightEyeUVOffset; 17 | float4 _MainTex_ST; 18 | 19 | struct appdata_t { 20 | float4 vertex : POSITION; 21 | float2 texcoord : TEXCOORD0; 22 | UNITY_VERTEX_INPUT_INSTANCE_ID 23 | }; 24 | 25 | struct v2f { 26 | float4 vertex : SV_POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | UNITY_VERTEX_OUTPUT_STEREO 29 | }; 30 | 31 | v2f vertexDirect(appdata_t v) 32 | { 33 | v2f o; 34 | UNITY_SETUP_INSTANCE_ID(v); 35 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 36 | o.vertex = UnityObjectToClipPos(v.vertex); 37 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex) + unity_StereoEyeIndex * _RightEyeUVOffset.xy; 38 | return o; 39 | } 40 | 41 | fixed4 fragmentBlit(v2f i) : SV_Target 42 | { 43 | fixed4 col = tex2D(_MainTex, i.texcoord); 44 | return fixed4(col.rgb, col.a * _AlphaParam); 45 | } 46 | 47 | ENDCG 48 | 49 | SubShader 50 | { 51 | Tags{ "Queue" = "Transparent" } 52 | 53 | Pass 54 | { 55 | Name "Default" 56 | Cull Off ZWrite On Blend SrcAlpha OneMinusSrcAlpha 57 | CGPROGRAM 58 | #pragma vertex vertexDirect 59 | #pragma fragment fragmentBlit 60 | ENDCG 61 | } 62 | } 63 | 64 | FallBack Off 65 | } 66 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Avatar/Materials/Avatar.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "hidden/Unlit/Avatar" 4 | { 5 | Properties 6 | { 7 | _MainTex ("Texture", 2D) = "white" {} 8 | _Color("Main Color", Color) = (1,1,1,1) 9 | } 10 | SubShader 11 | { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 100 14 | 15 | Pass 16 | { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | 21 | #include "UnityCG.cginc" 22 | 23 | struct appdata 24 | { 25 | float4 vertex : POSITION; 26 | float3 normal : NORMAL; 27 | }; 28 | 29 | struct v2f 30 | { 31 | float3 normal : TEXCOORD0; 32 | float4 vertex : SV_POSITION; 33 | }; 34 | 35 | v2f vert (appdata v) 36 | { 37 | v2f o; 38 | o.vertex = UnityObjectToClipPos(v.vertex); 39 | o.normal = v.normal; 40 | return o; 41 | } 42 | 43 | fixed4 _Color; 44 | fixed4 frag (v2f i) : SV_Target 45 | { 46 | return _Color * dot(normalize(i.normal), normalize(float3(-1, 1, 0))); 47 | } 48 | ENDCG 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Avatar/Shaders/Editor-AlphaDiffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified copy of built-in shader, to not make editor resources depend on built-in ones 4 | Shader "Editor/Transparent/Diffuse" { 5 | Properties { 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | LOD 200 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert alpha:fade noforwardadd nolightmap novertexlights nometa noinstancing nofog exclude_path:prepass exclude_path:deferred 16 | 17 | sampler2D _MainTex; 18 | fixed4 _Color; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | o.Albedo = c.rgb; 27 | o.Alpha = c.a; 28 | } 29 | ENDCG 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Avatar/Shaders/Editor-AlphaTestDiffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified copy of built-in shader, to not make editor resources depend on built-in ones 4 | Shader "Editor/Transparent/Cutout/Diffuse" { 5 | Properties { 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 8 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 9 | } 10 | 11 | SubShader { 12 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 13 | LOD 200 14 | 15 | CGPROGRAM 16 | #pragma surface surf Lambert alphatest:_Cutoff noforwardadd nolightmap novertexlights nometa noinstancing nofog exclude_path:prepass exclude_path:deferred 17 | 18 | sampler2D _MainTex; 19 | fixed4 _Color; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | }; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 27 | o.Albedo = c.rgb; 28 | o.Alpha = c.a; 29 | } 30 | ENDCG 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Avatar/Shaders/Editor-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified copy of built-in shader, to not make editor resources depend on built-in ones 4 | Shader "Editor/Bumped Specular" { 5 | Properties { 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 8 | _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 9 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 10 | _BumpMap ("Normalmap", 2D) = "bump" {} 11 | } 12 | 13 | CGINCLUDE 14 | sampler2D _MainTex; 15 | sampler2D _BumpMap; 16 | fixed4 _Color; 17 | half _Shininess; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_BumpMap; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 26 | o.Albedo = tex.rgb * _Color.rgb; 27 | o.Gloss = tex.a; 28 | o.Alpha = tex.a * _Color.a; 29 | o.Specular = _Shininess; 30 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 31 | } 32 | ENDCG 33 | 34 | SubShader { 35 | Tags { "RenderType"="Opaque" } 36 | LOD 400 37 | 38 | CGPROGRAM 39 | #pragma surface surf BlinnPhong noforwardadd nolightmap novertexlights nometa noinstancing nofog exclude_path:prepass exclude_path:deferred 40 | #pragma target 3.0 41 | ENDCG 42 | } 43 | 44 | SubShader { 45 | Tags { "RenderType"="Opaque" } 46 | LOD 400 47 | 48 | CGPROGRAM 49 | #pragma surface surf BlinnPhong nodynlightmap noforwardadd nolightmap novertexlights nometa noinstancing nofog exclude_path:prepass exclude_path:deferred 50 | ENDCG 51 | } 52 | 53 | FallBack "Editor/Diffuse" 54 | } 55 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Avatar/Shaders/Editor-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Simplified copy of built-in shader, to not make editor resources depend on built-in ones 4 | Shader "Editor/Diffuse" { 5 | Properties { 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | _MainTex ("Base (RGB)", 2D) = "white" {} 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 200 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert noforwardadd nolightmap novertexlights nometa noinstancing nofog exclude_path:prepass exclude_path:deferred 15 | 16 | sampler2D _MainTex; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | }; 22 | 23 | void surf (Input IN, inout SurfaceOutput o) { 24 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 25 | o.Albedo = c.rgb; 26 | o.Alpha = c.a; 27 | } 28 | ENDCG 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Editors/AnimationWindow/ControlPoint.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | 4 | Shader "Hidden/AnimationWindowControlPoint" { 5 | Properties { _MainTex ("Texture", Any) = "white" {} } 6 | SubShader { 7 | Tags { "ForceSupported" = "True" } 8 | 9 | Lighting Off 10 | Blend SrcAlpha OneMinusSrcAlpha 11 | Cull Off 12 | ZWrite Off 13 | ZTest Always 14 | 15 | Pass { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | #include "UnityCG.cginc" 21 | 22 | struct v2f { 23 | float4 vertex : SV_POSITION; 24 | fixed4 color : COLOR; 25 | float2 uv : TEXCOORD0; 26 | float2 clipUV : TEXCOORD1; 27 | }; 28 | 29 | uniform float4 _MainTex_ST; 30 | uniform float4x4 unity_GUIClipTextureMatrix; 31 | 32 | v2f vert (float4 vertex : POSITION, float2 uv : TEXCOORD0, float4 color : COLOR0) 33 | { 34 | v2f o; 35 | o.vertex = UnityObjectToClipPos(vertex); 36 | float3 screenUV = UnityObjectToViewPos(vertex); 37 | o.clipUV = mul(unity_GUIClipTextureMatrix, float4(screenUV.xy, 0, 1.0)); 38 | o.color = color; 39 | o.uv = TRANSFORM_TEX(uv,_MainTex); 40 | return o; 41 | } 42 | 43 | sampler2D _MainTex; 44 | sampler2D _GUIClipTexture; 45 | 46 | fixed4 frag (v2f i) : SV_Target 47 | { 48 | fixed4 col = tex2D(_MainTex, i.uv) * i.color; 49 | col.a *= tex2D(_GUIClipTexture, i.clipUV).a; 50 | return col; 51 | } 52 | ENDCG 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Editors/AnimationWindow/Curve.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | 4 | Shader "Hidden/AnimationWindowCurve" 5 | { 6 | Properties { _Color ("Main Color", Color) = (1,1,1,1) } 7 | 8 | SubShader { 9 | Tags { "ForceSupported" = "True" } 10 | 11 | Lighting Off 12 | Blend SrcAlpha OneMinusSrcAlpha 13 | Cull Off 14 | ZWrite Off 15 | ZTest Always 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | 22 | #include "UnityCG.cginc" 23 | 24 | struct appdata_t { 25 | float4 vertex : POSITION; 26 | }; 27 | 28 | struct v2f { 29 | float4 vertex : SV_POSITION; 30 | float2 clipUV : TEXCOORD0; 31 | }; 32 | 33 | sampler2D _GUIClipTexture; 34 | 35 | uniform fixed4 _Color; 36 | uniform float4x4 unity_GUIClipTextureMatrix; 37 | 38 | v2f vert (appdata_t v) 39 | { 40 | v2f o; 41 | o.vertex = UnityObjectToClipPos(v.vertex); 42 | float3 eyePos = UnityObjectToViewPos(v.vertex); 43 | o.clipUV = mul(unity_GUIClipTextureMatrix, float4(eyePos.xy, 0, 1.0)); 44 | return o; 45 | } 46 | 47 | fixed4 frag (v2f i) : SV_Target 48 | { 49 | fixed4 col = _Color; 50 | col.a *= tex2D(_GUIClipTexture, i.clipUV).a; 51 | return col; 52 | } 53 | ENDCG 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/GI/Internal-Histogram.compute: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #pragma kernel histogram 4 | 5 | #include "HLSLSupport.cginc" 6 | 7 | // Should match constants in ProgressiveRuntimeManager::GeneratePrioritizedLightmapIndices() 8 | #define HISTOGRAM_BINS 128 9 | RWStructuredBuffer _Histogram; 10 | Texture2D _AtlasIDTexture; 11 | 12 | groupshared uint gs_LocalHistogram[HISTOGRAM_BINS]; 13 | 14 | [numthreads(32, 32, 1)] 15 | void histogram(uint groupIndex : SV_GroupIndex, uint3 dispatchThreadId : SV_DispatchThreadID) 16 | { 17 | uint width, height; 18 | _AtlasIDTexture.GetDimensions(width, height); 19 | 20 | float texSample = 0.0; 21 | bool ignore = dispatchThreadId.x >= width || dispatchThreadId.y >= height; 22 | if (!ignore) 23 | { 24 | texSample = _AtlasIDTexture[dispatchThreadId.xy].r; 25 | } 26 | ignore = ignore || texSample == 0.0; // Ignore pixels with no atlassed renderer. 27 | 28 | // Initialize local histogram. Groupshared memory is not zero-initialized by default. 29 | if (groupIndex < HISTOGRAM_BINS) 30 | { 31 | gs_LocalHistogram[groupIndex] = 0u; 32 | } 33 | 34 | GroupMemoryBarrierWithGroupSync(); 35 | 36 | // Accumulate into local histogram 37 | if (!ignore) 38 | { 39 | uint pixel = round(texSample) - 1; // Subtract 1 to account for 0 ie. black meaning no atlas. 40 | InterlockedAdd(gs_LocalHistogram[pixel], 1u); 41 | } 42 | 43 | GroupMemoryBarrierWithGroupSync(); 44 | 45 | // Accumulate local histograms into global histogram 46 | if (groupIndex < HISTOGRAM_BINS) 47 | { 48 | InterlockedAdd(_Histogram[groupIndex], gs_LocalHistogram[groupIndex]); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewAlpha.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Alpha" 4 | { 5 | Properties { 6 | _MainTex ("Texture", Any) = "white" {} 7 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 8 | } 9 | Subshader { 10 | Tags { "ForceSupported" = "True" } 11 | Lighting Off Cull Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha 12 | Pass { 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment fragAlpha 16 | #pragma require sampleLOD 17 | 18 | #include "UnityCG.cginc" 19 | 20 | #include "Preview.cginc" 21 | 22 | ENDCG 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewAlphaVT.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Alpha VT" 4 | { 5 | Properties { 6 | [TextureStack.Stack] _MainTex ("Texture", Any) = "white" {} 7 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 8 | } 9 | Subshader { 10 | Tags { "ForceSupported" = "True" } 11 | Lighting Off Cull Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha 12 | Pass { 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment fragAlpha 16 | #pragma require sampleLOD 17 | 18 | #include "UnityCG.cginc" 19 | #define VT 20 | #include "Preview.cginc" 21 | 22 | ENDCG 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewColor2D.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Color2D" { 4 | Properties { 5 | _MainTex ("Texture", Any) = "white" {} 6 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 7 | } 8 | 9 | 10 | Subshader { 11 | Tags { "ForceSupported" = "True" } 12 | Lighting Off Cull Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha 13 | Pass { 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #pragma require sampleLOD 18 | 19 | #include "UnityCG.cginc" 20 | 21 | #include "Preview.cginc" 22 | 23 | ENDCG 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewColor2DVT.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Color2D VT" { 4 | Properties { 5 | [TextureStack.Stack] _MainTex ("Texture", Any) = "white" {} 6 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 7 | } 8 | 9 | 10 | Subshader { 11 | Tags { "ForceSupported" = "True" } 12 | Lighting Off Cull Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha 13 | Pass { 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #pragma require sampleLOD 18 | 19 | #include "UnityCG.cginc" 20 | 21 | #define VT 22 | #include "Preview.cginc" 23 | 24 | ENDCG 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewEncodedNormals.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Encoded Normals" 4 | { 5 | Properties { 6 | _MainTex ("Texture", Any) = "white" { } 7 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 8 | } 9 | Subshader 10 | { 11 | Tags { "ForceSupported" = "True" "RenderType" = "Opaque" } 12 | Cull Off ZWrite Off ZTest Always 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment fragNormal 18 | #pragma require sampleLOD 19 | #include "UnityCG.cginc" 20 | 21 | #include "Preview.cginc" 22 | 23 | ENDCG 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewEncodedNormalsVT.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Encoded Normals VT" 4 | { 5 | Properties { 6 | [TextureStack.Stack] _MainTex ("Texture", Any) = "white" { } 7 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 8 | } 9 | Subshader 10 | { 11 | Tags { "ForceSupported" = "True" "RenderType" = "Opaque" } 12 | Cull Off ZWrite Off ZTest Always 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment fragNormal 18 | #pragma require sampleLOD 19 | #include "UnityCG.cginc" 20 | #define VT 21 | #include "Preview.cginc" 22 | ENDCG 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewShadowMask.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Draw a quad close to far plane, 4 | // this will produce white color everywhere where 5 | // anything was rendered. 6 | Shader "Hidden/Preview Shadow Mask" { 7 | SubShader { 8 | Tags { "ForceSupported" = "True" } 9 | Pass { 10 | ZTest GEqual 11 | ZWrite Off 12 | Cull Off 13 | SetTexture[_Dummy] { constantColor(1,1,1,1) combine constant } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewShadowPlaneClip.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Shadow Plane Clip" { 4 | SubShader { 5 | Tags { "ForceSupported" = "True" } 6 | Pass { 7 | ZWrite Off 8 | Cull Off 9 | SetTexture[_Dummy] { constantColor(0,0,0,0) combine constant } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewTransparent.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Transparent" 4 | { 5 | Properties { 6 | _MainTex ("Texture", 2D) = "white" {} 7 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 8 | } 9 | 10 | Subshader { 11 | Tags { "ForceSupported" = "True" "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 12 | Lighting Off Cull Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha 13 | Pass { 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #pragma require sampleLOD 18 | 19 | #include "UnityCG.cginc" 20 | 21 | #define PREVIEW_TRANSPARANT 22 | #include "Preview.cginc" 23 | 24 | ENDCG 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/Previews/PreviewTransparentVT.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Preview Transparent VT" 4 | { 5 | Properties { 6 | [TextureStack.Stack] _MainTex ("Texture", 2D) = "white" {} 7 | _Mip ("Mip", Float) = -1.0 // mip level to display; negative does regular sample 8 | } 9 | 10 | Subshader { 11 | Tags { "ForceSupported" = "True" "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 12 | Lighting Off Cull Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha 13 | Pass { 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #pragma require sampleLOD 18 | 19 | #include "UnityCG.cginc" 20 | 21 | #define VT 22 | #define PREVIEW_TRANSPARANT 23 | #include "Preview.cginc" 24 | 25 | ENDCG 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/BlitSceneViewCapture.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/BlitSceneViewCapture" 4 | { 5 | Properties 6 | { 7 | _MainTex ("Texture", 2D) = "" {} 8 | } 9 | SubShader 10 | { 11 | Tags { "ForceSupported" = "True" } 12 | Pass 13 | { 14 | ZTest Always Cull Off ZWrite Off 15 | 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #include "UnityCG.cginc" 20 | 21 | UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); 22 | uniform float4 _MainTex_ST; 23 | 24 | struct appdata_t 25 | { 26 | float4 vertex : POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | struct v2f 31 | { 32 | float4 vertex : SV_POSITION; 33 | float2 texcoord : TEXCOORD0; 34 | }; 35 | 36 | v2f vert (appdata_t v) 37 | { 38 | v2f o; 39 | o.vertex = UnityObjectToClipPos(v.vertex); 40 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 41 | return o; 42 | } 43 | 44 | float4 frag (v2f i) : SV_Target 45 | { 46 | #if UNITY_UV_STARTS_AT_TOP 47 | i.texcoord.y = 1.0 - i.texcoord.y; 48 | #endif 49 | return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.texcoord); 50 | } 51 | ENDCG 52 | } 53 | } 54 | Fallback Off 55 | } 56 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/ColoredTexture.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Texture tinted towards white, multiplied by _Color. 4 | // Used in scene view visualization modes. 5 | Shader "Hidden/SceneColoredTexture" 6 | { 7 | Properties 8 | { 9 | _Color ("", Color) = (1,1,1,1) 10 | _MainTex ("", 2D) = "gray" {} 11 | } 12 | SubShader 13 | { 14 | Pass 15 | { 16 | Fog { Mode Off } 17 | SetTexture [_MainTex] { constantColor (1,1,1,0.5) combine constant lerp(constant) texture } // lerp texture towards white 18 | SetTexture [_MainTex] { constantColor [_Color] combine previous * constant } // multiply by color 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GUITextureBlitSceneGUI.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/GUITextureBlitSceneGUI" { 4 | Properties 5 | { 6 | _MainTex ("Texture", any) = "" {} 7 | } 8 | SubShader { 9 | Pass { 10 | ZTest Always Cull Off ZWrite Off 11 | Blend One OneMinusSrcAlpha 12 | 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #pragma target 2.0 17 | 18 | #include "UnityCG.cginc" 19 | 20 | UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); 21 | uniform float4 _MainTex_ST; 22 | 23 | struct appdata_t { 24 | float4 vertex : POSITION; 25 | float2 texcoord : TEXCOORD0; 26 | UNITY_VERTEX_INPUT_INSTANCE_ID 27 | }; 28 | 29 | struct v2f { 30 | float4 vertex : SV_POSITION; 31 | float2 texcoord : TEXCOORD0; 32 | UNITY_VERTEX_INPUT_INSTANCE_ID 33 | UNITY_VERTEX_OUTPUT_STEREO 34 | }; 35 | 36 | v2f vert (appdata_t v) 37 | { 38 | v2f o; 39 | UNITY_SETUP_INSTANCE_ID(v); 40 | UNITY_INITIALIZE_OUTPUT(v2f, o); 41 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 42 | o.vertex = UnityObjectToClipPos(v.vertex); 43 | o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); 44 | return o; 45 | } 46 | 47 | fixed4 frag (v2f i) : SV_Target 48 | { 49 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); 50 | return saturate(UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.texcoord)); 51 | } 52 | ENDCG 53 | 54 | } 55 | } 56 | Fallback Off 57 | } 58 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GizmoColorOcclusion.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // colors from vertex data, one pass with regular depth testing 4 | Shader "Hidden/Editor Gizmo Color Occlusion" 5 | { 6 | SubShader 7 | { 8 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 9 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 10 | ZWrite Off Cull Off Fog { Mode Off } 11 | Pass // regular pass 12 | { 13 | ZTest LEqual 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #include "UnityCG.cginc" 18 | struct v2f 19 | { 20 | half4 color : COLOR0; 21 | float4 pos : SV_POSITION; 22 | }; 23 | v2f vert (float3 pos : POSITION, float4 color : COLOR) 24 | { 25 | v2f o; 26 | o.color = color; 27 | o.pos = UnityObjectToClipPos(pos); 28 | return o; 29 | } 30 | half4 frag (v2f IN) : SV_Target { return IN.color; } 31 | ENDCG 32 | } 33 | // just one pass: "occluded" pass is never used for this mode 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GizmoIconPicking.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Shader used for picking of gizmos/icons in the scene view. 4 | // Just outputs vertex color, using gizmo-like depth testing passes. 5 | Shader "Hidden/Editor Gizmo Icon Picking" 6 | { 7 | SubShader 8 | { 9 | Fog { Mode Off } 10 | 11 | Pass // regular pass 12 | { 13 | ZTest LEqual 14 | ZWrite On 15 | } 16 | Pass // occluded pass 17 | { 18 | ZTest Greater 19 | ZWrite Off 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GizmoLit.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // simple hardcoded lighting 4 | Shader "Hidden/Editor Gizmo Lit" 5 | { 6 | SubShader 7 | { 8 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 9 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 10 | ZWrite Off Fog { Mode Off } 11 | 12 | CGINCLUDE 13 | #pragma vertex vert 14 | #pragma fragment frag 15 | #include "UnityCG.cginc" 16 | 17 | struct appdata 18 | { 19 | float3 pos : POSITION; 20 | float3 normal : NORMAL; 21 | float4 color : COLOR; 22 | }; 23 | struct v2f 24 | { 25 | half4 color : COLOR0; 26 | float4 pos : SV_POSITION; 27 | }; 28 | 29 | float4 _GizmoBatchColor; 30 | 31 | v2f vert (appdata IN) 32 | { 33 | v2f o; 34 | if (_GizmoBatchColor.a >= 0) 35 | IN.color = _GizmoBatchColor; 36 | float3 eyeNormal = normalize (mul ((float3x3)UNITY_MATRIX_IT_MV, IN.normal).xyz); 37 | float nl = saturate(eyeNormal.z); 38 | float lighting = 0.333 + nl * 0.667 * 0.5; 39 | float4 color; 40 | color.rgb = lighting * IN.color.rgb; 41 | color.a = IN.color.a; 42 | o.color = saturate(color); 43 | o.pos = UnityObjectToClipPos(IN.pos); 44 | return o; 45 | } 46 | ENDCG 47 | 48 | Pass // regular pass 49 | { 50 | ZTest LEqual 51 | CGPROGRAM 52 | half4 frag (v2f IN) : SV_Target { return IN.color; } 53 | ENDCG 54 | } 55 | Pass // occluded pass 56 | { 57 | ZTest Greater 58 | CGPROGRAM 59 | half4 frag (v2f IN) : SV_Target { return IN.color * half4(1,1,1,0.1); } 60 | ENDCG 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GizmoText.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // text (used by icons) 4 | Shader "Hidden/Editor Gizmo Text" 5 | { 6 | Properties 7 | { 8 | _MainTex ("", 2D) = "white" {} 9 | } 10 | SubShader 11 | { 12 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 13 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 14 | ZWrite Off Cull Off Fog { Mode Off } 15 | Pass // regular pass 16 | { 17 | ZTest LEqual 18 | SetTexture [_MainTex] { combine primary, texture alpha * primary } 19 | } 20 | Pass // occluded pass 21 | { 22 | ZTest Greater 23 | SetTexture [_MainTex] { combine primary, texture alpha * primary } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GizmoWire.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // simple wire 4 | Shader "Hidden/Editor Gizmo" 5 | { 6 | SubShader 7 | { 8 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 9 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 10 | ZWrite Off Cull Off Fog { Mode Off } 11 | Offset -1, -1 12 | 13 | CGINCLUDE 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #include "UnityCG.cginc" 17 | float4 _GizmoBatchColor; 18 | struct v2f 19 | { 20 | half4 color : COLOR0; 21 | float4 pos : SV_POSITION; 22 | }; 23 | v2f vert (float3 pos : POSITION, float4 color : COLOR) 24 | { 25 | v2f o; 26 | if (_GizmoBatchColor.a >= 0) 27 | color = _GizmoBatchColor; 28 | o.color = saturate(color); 29 | o.pos = UnityObjectToClipPos(pos); 30 | return o; 31 | } 32 | ENDCG 33 | 34 | Pass // regular pass 35 | { 36 | ZTest LEqual 37 | CGPROGRAM 38 | half4 frag (v2f IN) : SV_Target { return IN.color; } 39 | ENDCG 40 | } 41 | Pass // occluded pass 42 | { 43 | ZTest Greater 44 | CGPROGRAM 45 | half4 frag (v2f IN) : SV_Target { return IN.color * half4(1,1,1,0.1); } 46 | ENDCG 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GizmoWireNoDepthTest.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // simple wire no depth test 4 | Shader "Hidden/Editor Gizmo" 5 | { 6 | SubShader 7 | { 8 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 9 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 10 | ZWrite Off Cull Off Fog { Mode Off } 11 | Offset -1, -1 12 | 13 | CGINCLUDE 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #include "UnityCG.cginc" 17 | float4 _GizmoBatchColor; 18 | struct v2f 19 | { 20 | half4 color : COLOR0; 21 | float4 pos : SV_POSITION; 22 | }; 23 | v2f vert (float3 pos : POSITION, float4 color : COLOR) 24 | { 25 | v2f o; 26 | if (_GizmoBatchColor.a >= 0) 27 | color = _GizmoBatchColor; 28 | o.color = saturate(color); 29 | o.pos = UnityObjectToClipPos(pos); 30 | return o; 31 | } 32 | half4 frag (v2f IN) : SV_Target { return IN.color; } 33 | ENDCG 34 | 35 | Pass // regular pass 36 | { 37 | ZTest Always 38 | CGPROGRAM 39 | ENDCG 40 | } 41 | Pass // occluded pass 42 | { 43 | ZTest Never // just don't render it 44 | CGPROGRAM 45 | ENDCG 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GridOrthoShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneView grid ortho" { 4 | SubShader { 5 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 6 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 7 | ZWrite Off Cull Off Fog { Mode Off } 8 | Pass { 9 | CGPROGRAM 10 | 11 | #pragma vertex vert 12 | #pragma fragment frag 13 | #pragma target 2.0 14 | #include "UnityCG.cginc" 15 | 16 | struct vertexInput { 17 | float4 vertex : POSITION; 18 | float4 texcoord0 : TEXCOORD0; 19 | fixed4 color : COLOR; 20 | }; 21 | 22 | struct fragmentInput { 23 | float4 position : SV_POSITION; 24 | float4 texcoord0 : TEXCOORD0; 25 | float4 color : COLOR; 26 | }; 27 | 28 | fragmentInput vert (vertexInput i) { 29 | fragmentInput o; 30 | o.position = UnityObjectToClipPos(i.vertex); 31 | o.texcoord0 = i.texcoord0; 32 | o.color = i.color; 33 | return o; 34 | } 35 | 36 | float4 frag (fragmentInput i) : SV_Target { 37 | float r = saturate (i.texcoord0.x - 0.1); 38 | return float4 (i.color.r, i.color.g, i.color.b, r * i.color.a); 39 | } 40 | 41 | ENDCG 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/GridShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneView grid" { 4 | SubShader { 5 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 6 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 7 | ZWrite Off Cull Off Fog { Mode Off } 8 | Pass { 9 | CGPROGRAM 10 | 11 | #pragma vertex vert 12 | #pragma fragment frag 13 | #pragma target 2.0 14 | #include "UnityCG.cginc" 15 | 16 | struct vertexInput { 17 | float4 vertex : POSITION; 18 | float4 texcoord0 : TEXCOORD0; 19 | fixed4 color : COLOR; 20 | }; 21 | 22 | struct fragmentInput { 23 | float4 position : SV_POSITION; 24 | float4 texcoord0 : TEXCOORD0; 25 | float3 screenPos : TEXCOORD1; 26 | float4 color : COLOR; 27 | }; 28 | 29 | fragmentInput vert (vertexInput i) { 30 | fragmentInput o; 31 | o.position = UnityObjectToClipPos(i.vertex); 32 | o.screenPos = UnityObjectToViewPos(i.vertex); 33 | o.texcoord0 = i.texcoord0; 34 | o.color = i.color; 35 | return o; 36 | } 37 | 38 | float4 frag (fragmentInput i) : SV_Target { 39 | float r = saturate (i.texcoord0.x / -i.screenPos.z - 0.1); 40 | return float4 (i.color.r, i.color.g, i.color.b, r * i.color.a); 41 | } 42 | 43 | ENDCG 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/HandleIconShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Handles Icon" { 4 | Properties { 5 | _MainTex ("Base", 2D) = "white" {} 6 | [Enum(UnityEngine.Rendering.CompareFunction)] _HandleZTest ("_HandleZTest", Int) = 8 7 | } 8 | SubShader { 9 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 10 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 11 | ZWrite Off Cull Off Fog { Mode Off } 12 | ZTest [_HandleZTest] 13 | BindChannels { 14 | Bind "vertex", vertex 15 | Bind "color", color 16 | Bind "texcoord", texcoord 17 | } 18 | Pass { 19 | SetTexture [_MainTex] { combine texture * primary } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/HandleLinesShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Handles Lines" { 4 | Properties 5 | { 6 | _MainTex ("Texture", Any) = "white" {} 7 | [Enum(UnityEngine.Rendering.CompareFunction)] _HandleZTest ("_HandleZTest", Int) = 8 8 | } 9 | SubShader { 10 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 11 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 12 | ZWrite Off Cull Off Fog { Mode Off } 13 | ZTest [_HandleZTest] 14 | BindChannels { 15 | Bind "vertex", vertex 16 | Bind "color", color 17 | Bind "TexCoord", texcoord 18 | } 19 | Pass { 20 | SetTexture [_MainTex] { combine primary * texture } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/HandlesLit.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Handles Shaded" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SkyColor ("Sky Color", Color) = (1,1,1,1) 7 | _GroundColor ("Ground Color", Color) = (1,1,1,1) 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | [Enum(UnityEngine.Rendering.BlendMode)] _BlendSrcMode ("_BlendSrcMode", Int) = 5 //SrcAlpha = 5 10 | [Enum(UnityEngine.Rendering.BlendMode)] _BlendDstMode ("_BlendDstMode", Int) = 10 //OneMinusSrcAlpha = 10 11 | [Enum(UnityEngine.Rendering.CompareFunction)] _HandleZTest ("_HandleZTest", Int) = 8 12 | } 13 | Category { 14 | Fog {Mode Off} 15 | Blend [_BlendSrcMode] [_BlendDstMode] 16 | ZWrite Off 17 | ZTest [_HandleZTest] 18 | 19 | SubShader { 20 | Tags { "Queue" = "Transparent" "ForceSupported" = "True" } 21 | Pass { 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | #pragma target 2.0 26 | #include "HandlesRenderShader.cginc" 27 | fixed4 frag (v2f i) : SV_Target { return i.color; } 28 | ENDCG 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/LightProbeGroupTetrahedra.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Light Probe Group Tetrahedra" { 4 | Properties 5 | { 6 | _Color ("Line Color", Color) = (1,0,1,1) 7 | _LineFarDistance ("Line Far Distance", Float) = 1 8 | } 9 | 10 | SubShader 11 | { 12 | CGINCLUDE 13 | 14 | #include "UnityCG.cginc" 15 | 16 | float4 _Color; 17 | float _LineFarDistance; 18 | 19 | struct appdata 20 | { 21 | float3 vertex : POSITION; 22 | }; 23 | 24 | struct v2f 25 | { 26 | float4 pos : SV_POSITION; 27 | float4 color : COLOR0; 28 | }; 29 | 30 | v2f vert (appdata v) 31 | { 32 | v2f o; 33 | 34 | half4 pos = half4(v.vertex, 1); 35 | o.pos = UnityObjectToClipPos(pos); 36 | 37 | float t = length(pos.xyz - _WorldSpaceCameraPos.xyz) / _LineFarDistance; 38 | o.color.rgb = _Color.rgb; 39 | o.color.a = clamp(lerp(1.0, 0.0, t), 0.1, 1.0); 40 | 41 | return o; 42 | } 43 | 44 | half4 frag (v2f i) : SV_Target 45 | { 46 | return half4(i.color); 47 | } 48 | 49 | ENDCG 50 | 51 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 52 | Blend SrcAlpha OneMinusSrcAlpha 53 | ZWrite Off Cull Off Fog { Mode Off } 54 | Offset -1, -1 55 | 56 | Pass { 57 | ZTest LEqual 58 | CGPROGRAM 59 | #pragma vertex vert 60 | #pragma fragment frag 61 | ENDCG 62 | } 63 | Pass { 64 | ZTest Greater 65 | CGPROGRAM 66 | #pragma vertex vert 67 | #pragma fragment frag 68 | ENDCG 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/LightProbeHandles.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Light Probe Handles Shaded" { 4 | Properties { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _SkyColor ("Sky Color", Color) = (1,1,1,1) 7 | _GroundColor ("Ground Color", Color) = (1,1,1,1) 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 9 | } 10 | SubShader { 11 | Tags { "Queue" = "Transparent" "ForceSupported" = "True" } 12 | Blend SrcAlpha OneMinusSrcAlpha 13 | ZWrite Off 14 | Pass { 15 | ZTest LEqual 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag_handles 19 | #pragma multi_compile_instancing 20 | #include "HandlesRenderShader.cginc" 21 | ENDCG 22 | } 23 | Pass { 24 | ZTest Greater 25 | CGPROGRAM 26 | #pragma vertex vert 27 | #pragma fragment frag_handles 28 | #pragma multi_compile_instancing 29 | #include "HandlesRenderShader.cginc" 30 | ENDCG 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/LightProbeLines.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Light Probe Wire" { 4 | SubShader 5 | { 6 | Tags { "ForceSupported" = "True" "Queue" = "Transparent" } 7 | Blend SrcAlpha OneMinusSrcAlpha 8 | ZWrite Off Cull Off Fog { Mode Off } 9 | Offset -1, -1 10 | BindChannels { 11 | Bind "Vertex", vertex 12 | Bind "Color", color 13 | } 14 | Color [color] 15 | Pass { 16 | ZTest LEqual 17 | } 18 | Pass { 19 | ZTest Greater 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/OpaqueSelection.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | // Shader for scene view picking. Just renders object with a _SelectionID color. 4 | Shader "Hidden/OpaqueSelection" 5 | { 6 | SubShader 7 | { 8 | Tags 9 | { 10 | "ForceSupported"="True" 11 | "Queue"="Transparent" 12 | "IgnoreProjector"="True" 13 | "RenderType"="Transparent" 14 | } 15 | 16 | Pass 17 | { 18 | CGPROGRAM 19 | #include "UnityCG.cginc" 20 | #pragma vertex vert 21 | #pragma fragment frag 22 | #pragma target 2.0 23 | 24 | uniform float4 _SelectionID; 25 | 26 | struct appdata_t 27 | { 28 | float4 vertex : POSITION; 29 | }; 30 | 31 | struct v2f 32 | { 33 | float4 vertex : SV_POSITION; 34 | }; 35 | 36 | v2f vert(appdata_t IN) 37 | { 38 | v2f OUT; 39 | OUT.vertex = UnityObjectToClipPos(IN.vertex); 40 | return OUT; 41 | } 42 | 43 | fixed4 frag(v2f IN) : SV_Target 44 | { 45 | return _SelectionID; 46 | } 47 | ENDCG 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/SceneViewAlphaShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/Sceneview Alpha Shader" { 4 | SubShader { 5 | Tags { "ForceSupported" = "True" } 6 | Pass { 7 | ZTest Always 8 | Blend DstAlpha Zero 9 | Color (1,1,1,1) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/SceneViewApplyFilter.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneViewApplyFilter" 4 | { 5 | Properties 6 | { 7 | _MainTex("Base (RGB)", 2D) = "white" {} 8 | } 9 | SubShader 10 | { 11 | Tags{ 12 | "RenderType" = "Transparent" 13 | "ForceSupported" = "True" 14 | } 15 | Pass 16 | { 17 | Cull Off 18 | ZWrite Off 19 | ZTest Always 20 | Blend SrcAlpha OneMinusSrcAlpha 21 | 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | #pragma target 2.0 26 | #include "UnityCG.cginc" 27 | 28 | struct appdata 29 | { 30 | float4 vertex : POSITION; 31 | float2 uv : TEXCOORD0; 32 | }; 33 | 34 | struct v2f 35 | { 36 | float2 uv : TEXCOORD0; 37 | float4 vertex : SV_POSITION; 38 | }; 39 | 40 | sampler2D _MainTex; 41 | sampler2D _MaskTex; 42 | float4 _MainTex_ST; 43 | 44 | v2f vert(appdata v) 45 | { 46 | v2f o; 47 | o.vertex = UnityObjectToClipPos(v.vertex); 48 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 49 | return o; 50 | } 51 | 52 | fixed4 frag(v2f i) : SV_Target 53 | { 54 | fixed4 col = saturate(tex2D(_MainTex, i.uv)); 55 | col.a *= saturate(1.0f-tex2D(_MaskTex, i.uv).a); 56 | return col; 57 | } 58 | ENDCG 59 | } 60 | } 61 | Fallback Off 62 | } 63 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/SceneViewAura.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneViewAura" { 4 | Properties { 5 | _MainTex ("Base (RGB)", 2D) = "white" {} 6 | } 7 | SubShader { 8 | Tags { 9 | "RenderType"="Transparent" 10 | "ForceSupported"="True" 11 | } 12 | Pass { 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #pragma target 2.0 17 | #include "UnityCG.cginc" 18 | 19 | struct appdata { 20 | float4 vertex : POSITION; 21 | float3 normal : NORMAL; 22 | }; 23 | 24 | struct v2f { 25 | float4 pos : POSITION; 26 | fixed4 color : COLOR; 27 | }; 28 | 29 | v2f vert(appdata v) { 30 | v2f o; 31 | o.pos = UnityObjectToClipPos(v.vertex); 32 | float3 norm = normalize(mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal)); 33 | float visibility = (1-(norm.z*norm.z)); 34 | o.color = float4 (0.5,0.5,1,0.4) * visibility * visibility; 35 | return o; 36 | } 37 | fixed4 frag (v2f i) : SV_Target { return i.color; } 38 | ENDCG 39 | Cull Back 40 | ZWrite Off 41 | ZTest Greater 42 | ColorMask RGB 43 | Blend SrcAlpha OneMinusSrcAlpha 44 | } 45 | } 46 | FallBack off 47 | } 48 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/SceneViewBuildFilter.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneViewBuildFilter" 4 | { 5 | Properties 6 | { 7 | _MainTex("Base (RGB)", 2D) = "white" {} 8 | } 9 | SubShader 10 | { 11 | Tags{ 12 | "RenderType" = "Transparent" 13 | "ForceSupported" = "True" 14 | } 15 | Pass 16 | { 17 | Cull Back 18 | ZWrite Off 19 | ZTest LEqual 20 | Offset -1, -1 21 | 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | #pragma target 2.0 26 | #include "UnityCG.cginc" 27 | 28 | struct appdata 29 | { 30 | float4 vertex : POSITION; 31 | float3 normal : NORMAL; 32 | }; 33 | 34 | struct v2f 35 | { 36 | float4 pos : POSITION; 37 | fixed4 color : COLOR; 38 | }; 39 | 40 | v2f vert(appdata v) 41 | { 42 | v2f o; 43 | o.pos = UnityObjectToClipPos(v.vertex); 44 | o.color = fixed4(1, 0, 0, 1); 45 | return o; 46 | } 47 | 48 | fixed4 frag(v2f i) : SV_Target 49 | { 50 | return i.color; 51 | } 52 | ENDCG 53 | } 54 | } 55 | FallBack off 56 | } 57 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/SceneViewDeferredShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneViewDeferredBuffers" { 4 | Properties { 5 | _MainTex ("", 2D) = "white" {} 6 | } 7 | SubShader { 8 | Tags { "ForceSupported"="True" } 9 | Cull Off ZWrite Off ZTest Always 10 | 11 | Pass { 12 | CGPROGRAM 13 | #pragma vertex vert 14 | #pragma fragment frag 15 | #pragma target 2.0 16 | #include "UnityCG.cginc" 17 | 18 | struct appdata { 19 | float4 vertex : POSITION; 20 | float2 uv : TEXCOORD0; 21 | }; 22 | 23 | struct v2f { 24 | float4 pos : SV_POSITION; 25 | float2 uv : TEXCOORD0; 26 | }; 27 | 28 | v2f vert(appdata v) { 29 | v2f o; 30 | o.pos = UnityObjectToClipPos(v.vertex); 31 | o.uv = v.uv; 32 | return o; 33 | } 34 | 35 | sampler2D _CameraGBufferTexture0; 36 | sampler2D _CameraGBufferTexture1; 37 | sampler2D _CameraGBufferTexture2; 38 | 39 | int _DisplayMode; 40 | 41 | fixed4 frag (v2f i) : SV_Target 42 | { 43 | half4 gbuf0 = tex2D (_CameraGBufferTexture0, i.uv); 44 | half4 gbuf1 = tex2D (_CameraGBufferTexture1, i.uv); 45 | half4 gbuf2 = tex2D (_CameraGBufferTexture2, i.uv); 46 | half4 col = half4(1,0,0,1); 47 | if (_DisplayMode == 0) 48 | col = gbuf0; 49 | if (_DisplayMode == 1) 50 | col = gbuf1; 51 | if (_DisplayMode == 2) 52 | col = gbuf1.a; 53 | if (_DisplayMode == 3) 54 | col = gbuf2; 55 | return col; 56 | } 57 | ENDCG 58 | } 59 | 60 | } 61 | FallBack off 62 | } 63 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/SceneViewGrayscaleEffectFade.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneViewGrayscaleEffectFade" { 4 | Properties { 5 | _MainTex ("Base (RGB)", RECT) = "white" {} 6 | } 7 | SubShader { 8 | Tags { 9 | "ForceSupported"="True" 10 | } 11 | Pass { 12 | ZTest Always Cull Off ZWrite Off 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #pragma target 2.0 17 | #include "UnityCG.cginc" 18 | uniform sampler2D _MainTex; 19 | uniform float _Fade; 20 | 21 | v2f_img vert (appdata_img v) 22 | { 23 | v2f_img o; 24 | o.pos = UnityObjectToClipPos(v.vertex); 25 | o.uv = v.texcoord; 26 | return o; 27 | } 28 | 29 | fixed4 frag (v2f_img i) : SV_Target 30 | { 31 | float4 original = tex2D(_MainTex, i.uv); 32 | float grayscale = Luminance(original.rgb) * 0.6; 33 | float addFade = (grayscale + 0.5) * _Fade; 34 | float4 output = original * (1-_Fade) + float4(addFade,addFade,addFade,addFade); 35 | output.a = 1.0; 36 | return output; 37 | } 38 | ENDCG 39 | } 40 | } 41 | Fallback off 42 | } 43 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/SceneViewSelected.cginc: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | #ifndef DRAW_COLOR 4 | #define DRAW_COLOR 1 5 | #endif 6 | 7 | #include "UnityCG.cginc" 8 | 9 | sampler2D _MainTex; 10 | float4 _MainTex_ST; 11 | float _DoClip; 12 | fixed _Cutoff; 13 | 14 | struct appdata_t 15 | { 16 | float4 vertex : POSITION; 17 | float2 texcoord : TEXCOORD0; 18 | }; 19 | 20 | struct v2f 21 | { 22 | float4 vertex : SV_POSITION; 23 | float2 texcoord : TEXCOORD0; 24 | }; 25 | 26 | v2f vert (appdata_t IN) 27 | { 28 | v2f OUT; 29 | OUT.vertex = UnityObjectToClipPos(IN.vertex); 30 | OUT.texcoord = TRANSFORM_TEX(IN.texcoord, _MainTex); 31 | return OUT; 32 | } 33 | 34 | fixed4 frag (v2f IN) : SV_Target 35 | { 36 | if (_DoClip) 37 | { 38 | fixed4 col = tex2D( _MainTex, IN.texcoord); 39 | clip(col.a - _Cutoff); 40 | } 41 | return DRAW_COLOR; 42 | } 43 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/VertexSelectedShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/VertexSelected" { 4 | Properties { 5 | _MainTex ("Texture", 2D) = "white"{} 6 | _Color ("Color", Color) = (0,1,1,1) 7 | } 8 | SubShader { 9 | Tags { "ForceSupported" = "True" } 10 | Pass { 11 | ZTest Always 12 | ZWrite Off 13 | Blend SrcAlpha OneMinusSrcAlpha 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #pragma target 2.0 18 | #pragma exclude_renderers gles 19 | #include "UnityCG.cginc" 20 | fixed4 _Color; 21 | struct appdata { 22 | float4 vertex : POSITION; 23 | float4 tangent : TANGENT; 24 | float3 normal : NORMAL; 25 | fixed4 color : COLOR0; 26 | }; 27 | struct v2f { 28 | float4 pos : SV_POSITION; 29 | fixed4 color : COLOR0; 30 | }; 31 | v2f vert (appdata v) 32 | { 33 | v2f o; 34 | float3 center = UnityObjectToViewPos(v.vertex); 35 | v.tangent *= center.z; 36 | o.pos = UnityObjectToClipPos(v.vertex + v.tangent); 37 | o.color = 0.75 * v.color * _Color + 0.25 * dot(v.normal, float3(0.7, 0.3, 0.64)); 38 | o.color.a = v.color.a * _Color.a; 39 | return o; 40 | } 41 | fixed4 frag(v2f i) : SV_Target 42 | { 43 | return half4(i.color); 44 | } 45 | ENDCG 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/VertexSelectionBackfacesShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/VertexSelectionBackfaces" { 4 | Properties { 5 | _MainTex ("Texture", 2D) = "white"{} 6 | _Color ("Color", Color) = (0,1,1,1) 7 | } 8 | SubShader { 9 | Tags { "ForceSupported" = "True" } 10 | Pass { 11 | ZTest Always 12 | CGPROGRAM 13 | #pragma vertex vert 14 | #pragma fragment frag 15 | #pragma target 2.0 16 | #pragma exclude_renderers gles 17 | #include "UnityCG.cginc" 18 | fixed4 _Color; 19 | struct appdata { 20 | float4 vertex : POSITION; 21 | float4 tangent : TANGENT; 22 | float3 normal : NORMAL; 23 | fixed4 color : COLOR0; 24 | }; 25 | struct v2f { 26 | float4 pos : SV_POSITION; 27 | fixed4 color : COLOR0; 28 | }; 29 | v2f vert (appdata v) 30 | { 31 | v2f o; 32 | float3 center = UnityObjectToViewPos(v.vertex); 33 | v.tangent *= center.z; 34 | o.pos = UnityObjectToClipPos(v.vertex + v.tangent); 35 | o.color = 0.75 * v.color * _Color + 0.25 * dot(v.normal, float3(0.7, 0.3, 0.64)); 36 | o.color.a = v.color.a * _Color.a; 37 | return o; 38 | } 39 | fixed4 frag(v2f i) : SV_Target 40 | { 41 | return half4(i.color); 42 | } 43 | ENDCG 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/VertexSelectionShader.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/VertexSelection" { 4 | Properties { 5 | _MainTex ("Texture", 2D) = "white"{} 6 | _Color ("Color", Color) = (0,1,1,1) 7 | } 8 | SubShader { 9 | Tags { "ForceSupported" = "True" } 10 | Pass { 11 | CGPROGRAM 12 | #pragma vertex vert 13 | #pragma fragment frag 14 | #pragma target 2.0 15 | #pragma exclude_renderers gles 16 | #include "UnityCG.cginc" 17 | fixed4 _Color; 18 | struct appdata { 19 | float4 vertex : POSITION; 20 | float4 tangent : TANGENT; 21 | float3 normal : NORMAL; 22 | fixed4 color : COLOR0; 23 | }; 24 | struct v2f { 25 | float4 pos : SV_POSITION; 26 | fixed4 color : COLOR0; 27 | }; 28 | v2f vert (appdata v) 29 | { 30 | v2f o; 31 | float3 center = UnityObjectToViewPos(v.vertex); 32 | v.tangent *= center.z; 33 | o.pos = UnityObjectToClipPos(v.vertex + v.tangent); 34 | o.color = 0.75 * v.color * _Color + 0.25 * dot(v.normal, float3(0.7, 0.3, 0.64)); 35 | o.color.a = v.color.a * _Color.a; 36 | return o; 37 | } 38 | fixed4 frag(v2f i) : SV_Target 39 | { 40 | return half4(i.color); 41 | } 42 | ENDCG 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Shaders/EditorDefaultResources/SceneView/Wireframe.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/SceneViewWireframe" { 4 | CGINCLUDE 5 | float4 vert (float4 pos : POSITION) : SV_POSITION 6 | { 7 | return mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, pos)); 8 | } 9 | 10 | CBUFFER_START(UnitySceneViewColor) 11 | fixed4 unity_SceneViewWireColor; 12 | CBUFFER_END 13 | 14 | fixed4 frag () : SV_Target 15 | { 16 | return unity_SceneViewWireColor; 17 | } 18 | ENDCG 19 | 20 | SubShader { 21 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 22 | ZTest LEqual ZWrite Off 23 | Offset -1, -1 24 | 25 | Pass { 26 | // SM2.0 (need different modes for SM2.0/SM3.0 due to how we hijack wireframe fragment shader; SM2 needs to come first) 27 | CGPROGRAM 28 | #pragma vertex vert 29 | #pragma fragment frag 30 | #pragma target 2.0 31 | ENDCG 32 | } 33 | 34 | Pass { 35 | // SM3.0 36 | CGPROGRAM 37 | #pragma vertex vert 38 | #pragma fragment frag 39 | #pragma target 3.0 40 | ENDCG 41 | } 42 | 43 | Pass { 44 | // SM6.0 45 | CGPROGRAM 46 | #pragma vertex vert 47 | #pragma fragment frag 48 | #pragma use_dxc d3d11 49 | ENDCG 50 | } 51 | } 52 | 53 | SubShader { 54 | Tags { "ForceSupported" = "True" } 55 | 56 | Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha 57 | ZTest LEqual ZWrite Off 58 | Offset -1, -1 59 | 60 | Pass { 61 | // default 62 | CGPROGRAM 63 | #pragma vertex vert 64 | #pragma fragment frag 65 | #pragma target 2.0 66 | ENDCG 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Shaders/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Unity Technologies 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Unity Technologies 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | --------------------------------------------------------------------------------