├── .editorconfig ├── .github └── workflows │ └── test-ci.yml ├── .gitignore ├── LICENSE ├── README.md ├── UnityShaderParser.Experiments ├── Program.cs └── UnityShaderParser.Experiments.csproj ├── UnityShaderParser.Tests ├── HLSLParserTests.cs ├── PreProcessorTests.cs ├── ShaderLabParserTests.cs ├── ShaderParserTests.cs ├── TestShaders │ ├── FxDis │ │ ├── readme.txt │ │ └── test.hlsl │ ├── HlslCrossCompiler │ │ ├── ds5 │ │ │ ├── basic.hlsl │ │ │ └── basic.knowngood │ │ ├── hs5 │ │ │ └── basic.hlsl │ │ ├── ps4 │ │ │ ├── fxaa.hlsl │ │ │ └── primID.hlsl │ │ ├── ps5 │ │ │ ├── conservative_depth.hlsl │ │ │ ├── interface_arrays.hlsl │ │ │ ├── interfaces.hlsl │ │ │ ├── sample.frag │ │ │ └── sample.hlsl │ │ ├── readme.txt │ │ ├── vs4 │ │ │ ├── mov.hlsl │ │ │ ├── mov.vert │ │ │ ├── multiple_const_buffers.hlsl │ │ │ └── switch.hlsl │ │ └── vs5 │ │ │ ├── any.hlsl │ │ │ ├── const_temp.hlsl │ │ │ ├── mad_imm.hlsl │ │ │ ├── mov.hlsl │ │ │ └── sincos.hlsl │ ├── Homemade │ │ ├── Include │ │ │ └── IncludeB.hlsl │ │ ├── IncludeA.hlsl │ │ ├── PackageRequirements.shader │ │ ├── Tricky.hlsl │ │ └── TrickyTags.shader │ ├── Nvidia │ │ ├── AnisotropicHilight.fx │ │ ├── BrdfFromTextures.fx │ │ ├── BumpReflect.fx │ │ ├── BumpyGlossy.fx │ │ ├── BumpyGlossyMetal.fx │ │ ├── DebugSpaces.fx │ │ ├── DebugTexCoords.fx │ │ ├── DepthColor.fx │ │ ├── DrawSharedShadow.fx │ │ ├── EdgeFuzz.fx │ │ ├── EnvironmentPassThru.fx │ │ ├── FlatTexture.fx │ │ ├── Graph1DTexture.fx │ │ ├── Grisaille.fx │ │ ├── MrWiggle.fx │ │ ├── NVIDIA Shader Library License.txt │ │ ├── NebulaLight.fx │ │ ├── Nightfall.fx │ │ ├── Ocean.fx │ │ ├── TexturePositioning.fx │ │ ├── ThinFilm.fx │ │ ├── Toksvig_NormalMaps.fx │ │ ├── balloon.fx │ │ ├── blinn.fx │ │ ├── blinn_bump_reflect.fx │ │ ├── brix.fx │ │ ├── cage.fx │ │ ├── carpaint_texColor.fx │ │ ├── checker3d.fx │ │ ├── checker3d_math.fx │ │ ├── clock.fx │ │ ├── ddGodRays.fx │ │ ├── durer.fx │ │ ├── glossyWetHilight.fx │ │ ├── gooch.fx │ │ ├── gooch_bump_reflect.fx │ │ ├── gooch_slicer.fx │ │ ├── goochy.fx │ │ ├── include │ │ │ ├── Quad.fxh │ │ │ ├── ThinFilmTex.fxh │ │ │ ├── blur59.fxh │ │ │ ├── color_spaces.fxh │ │ │ ├── debug_tools.fxh │ │ │ ├── noise_2D.fxh │ │ │ ├── noise_3d.fxh │ │ │ ├── nvInverse.fxh │ │ │ ├── nvMatrix.fxh │ │ │ ├── shadowMap.fxh │ │ │ ├── spot_tex.fxh │ │ │ ├── stripe_tex.fxh │ │ │ ├── vertex_noise.fxh │ │ │ └── vnoise-table.fxh │ │ ├── lambSkin.fx │ │ ├── lambert.fx │ │ ├── metal.fx │ │ ├── metalD.fx │ │ ├── metalP.fx │ │ ├── paint_brush.fx │ │ ├── phong.fx │ │ ├── phong_bump_reflect.fx │ │ ├── plastic.fx │ │ ├── plasticD.fx │ │ ├── plasticP.fx │ │ ├── post_RGB_from_CMY.fx │ │ ├── post_RGB_from_CMYK.fx │ │ ├── post_RGB_from_HSV.fx │ │ ├── post_RGB_from_YUV.fx │ │ ├── post_RGB_to_CMY.fx │ │ ├── post_RGB_to_CMYK.fx │ │ ├── post_RGB_to_HSV.fx │ │ ├── post_RGB_to_YUV.fx │ │ ├── post_badPrinting.fx │ │ ├── post_bleach_bypass.fx │ │ ├── post_blendOverlay.fx │ │ ├── post_bloom.fx │ │ ├── post_cameraShake.fx │ │ ├── post_color_clipping.fx │ │ ├── post_color_curve.fx │ │ ├── post_color_desaturate.fx │ │ ├── post_color_gradient.fx │ │ ├── post_color_keying.fx │ │ ├── post_color_matrix_effects.fx │ │ ├── post_color_mixer.fx │ │ ├── post_color_mixer_monochrome.fx │ │ ├── post_color_spin.fx │ │ ├── post_complements.fx │ │ ├── post_corona.fx │ │ ├── post_deepMask.fx │ │ ├── post_distort.fx │ │ ├── post_dropShadow.fx │ │ ├── post_edgeDetect.fx │ │ ├── post_edgeDetect_3color.fx │ │ ├── post_edgeDetect_tuned.fx │ │ ├── post_frost.fx │ │ ├── post_frost_fast.fx │ │ ├── post_glow.fx │ │ ├── post_glowBalloon.fx │ │ ├── post_glow_fixedSize.fx │ │ ├── post_glow_inset.fx │ │ ├── post_glow_screenSize.fx │ │ ├── post_glowtrail.fx │ │ ├── post_godrays.fx │ │ ├── post_halftone_dots.fx │ │ ├── post_halftone_grainy.fx │ │ ├── post_halo.fx │ │ ├── post_kuwahara.fx │ │ ├── post_negOffset.fx │ │ ├── post_negative.fx │ │ ├── post_objsAsDisplacements.fx │ │ ├── post_posterize.fx │ │ ├── post_pulsing.fx │ │ ├── post_radialBlur.fx │ │ ├── post_scratched_film.fx │ │ ├── post_sepia.fx │ │ ├── post_shadow_overlay.fx │ │ ├── post_spotlight.fx │ │ ├── post_starFilter.fx │ │ ├── post_tiles.fx │ │ ├── post_titleOverlay.fx │ │ ├── post_toonShadow.fx │ │ ├── post_unsharpMask.fx │ │ ├── pre_color.fx │ │ ├── pre_cubeBg.fx │ │ ├── pre_gradient.fx │ │ ├── pre_gradient_hsv.fx │ │ ├── pre_texture.fx │ │ ├── pulse23.fx │ │ ├── readme.txt │ │ ├── reflections.fx │ │ ├── relief_mapping.fx │ │ ├── ribbonDistort.fx │ │ ├── scene_Mandelbrot.fx │ │ ├── scene_deferred.fx │ │ ├── scene_deferred_no_mrt.fx │ │ ├── scene_displaceMap.fx │ │ ├── scene_lineDraw.fx │ │ ├── scene_objectsAsDisplacements.fx │ │ ├── scene_seeTextureBias.fx │ │ ├── scene_tonemap.fx │ │ ├── scene_uv_diffusion.fx │ │ ├── scene_uvds_skin.fx │ │ ├── shadowSpot.fx │ │ ├── shadow_PCSS.fx │ │ ├── subcutaneous.fx │ │ ├── uvDetective.fx │ │ ├── vbomb.fx │ │ ├── velvety.fx │ │ └── wood.fx │ ├── PoiyomiToon │ │ ├── LICENSE.txt │ │ ├── Poiyomi Early Outline.shader │ │ ├── Poiyomi Early Z.shader │ │ ├── Poiyomi Grab Pass.shader │ │ ├── Poiyomi Outline.shader │ │ ├── Poiyomi World.shader │ │ ├── Poiyomi.shader │ │ └── README.txt │ ├── Sdk │ │ ├── Direct3D │ │ │ ├── AntiAlias │ │ │ │ └── AntiAlias.fx │ │ │ ├── BasicHLSL │ │ │ │ └── BasicHLSL.fx │ │ │ ├── CompiledEffect │ │ │ │ └── CompiledEffect.fx │ │ │ ├── ConfigSystem │ │ │ │ └── main.fx │ │ │ ├── CustomUI │ │ │ │ └── CustomUI.fx │ │ │ ├── DepthOfField │ │ │ │ └── DepthOfField.fx │ │ │ ├── EffectParam │ │ │ │ ├── EffectParam.fx │ │ │ │ ├── reflect.fx │ │ │ │ └── specular.fx │ │ │ ├── HDRCubeMap │ │ │ │ └── HDRCubeMap.fx │ │ │ ├── HDRFormats │ │ │ │ ├── HDRFormats.fx │ │ │ │ └── skybox.fx │ │ │ ├── HDRLighting │ │ │ │ └── HDRLighting.fx │ │ │ ├── HDRPipeline │ │ │ │ └── Shader Code │ │ │ │ │ ├── FinalPass.psh │ │ │ │ │ ├── HDRSource.psh │ │ │ │ │ ├── HDRSource.vsh │ │ │ │ │ ├── Luminance.psh │ │ │ │ │ ├── OcclusionMesh.vsh │ │ │ │ │ └── PostProcessing.psh │ │ │ ├── HLSLwithoutEffects │ │ │ │ └── HLSLwithoutEffects.vsh │ │ │ ├── Instancing │ │ │ │ └── Instancing.fx │ │ │ ├── IrradianceVolume │ │ │ │ ├── LDPRT.fx │ │ │ │ ├── NdotL.fx │ │ │ │ ├── PRT.fx │ │ │ │ ├── SHFuncView.fx │ │ │ │ ├── SHIrradianceEnvMap.fx │ │ │ │ ├── Scene.fx │ │ │ │ └── Wireframe.fx │ │ │ ├── LocalDeformablePRT │ │ │ │ ├── LocalDeformablePRT.fx │ │ │ │ └── skybox.fx │ │ │ ├── MeshFromOBJ │ │ │ │ └── MeshFromObj.fx │ │ │ ├── MultiAnimation │ │ │ │ ├── MultiAnimation.fx │ │ │ │ └── skin.vsh │ │ │ ├── OptimizedMesh │ │ │ │ └── OptimizedMesh.fx │ │ │ ├── PRTDemo │ │ │ │ ├── LDPRT.fx │ │ │ │ ├── LightProbe.fx │ │ │ │ ├── NdotL.fx │ │ │ │ ├── SHFuncView.fx │ │ │ │ ├── SHIrradianceEnvMap.fx │ │ │ │ └── prt.fx │ │ │ ├── ParallaxOcclusionMapping │ │ │ │ └── ParallaxOcclusionMapping.fx │ │ │ ├── Pick │ │ │ │ └── Pick.fx │ │ │ ├── PixelMotionBlur │ │ │ │ ├── PixelMotionBlur.fx │ │ │ │ └── PixelMotionBlurNoMRT.fx │ │ │ ├── PostProcess │ │ │ │ ├── PP_ColorBloomH.fx │ │ │ │ ├── PP_ColorBloomV.fx │ │ │ │ ├── PP_ColorBrightPass.fx │ │ │ │ ├── PP_ColorCombine4.fx │ │ │ │ ├── PP_ColorDownFilter4.fx │ │ │ │ ├── PP_ColorEdgeDetect.fx │ │ │ │ ├── PP_ColorGBlurH.fx │ │ │ │ ├── PP_ColorGBlurV.fx │ │ │ │ ├── PP_ColorInverse.fx │ │ │ │ ├── PP_ColorMonochrome.fx │ │ │ │ ├── PP_ColorToneMap.fx │ │ │ │ ├── PP_ColorUpFilter4.fx │ │ │ │ ├── PP_DofCombine.fx │ │ │ │ ├── PP_NormalEdgeDetect.fx │ │ │ │ ├── PP_NormalMap.fx │ │ │ │ ├── PP_PositionMap.fx │ │ │ │ ├── Scene.fx │ │ │ │ └── pp_colorcombine.fx │ │ │ ├── ShadowMap │ │ │ │ └── shadowmap.fx │ │ │ ├── ShadowVolume │ │ │ │ └── ShadowVolume.fx │ │ │ ├── SimpleSample │ │ │ │ └── SimpleSample.fx │ │ │ ├── SkinnedMesh │ │ │ │ └── skinnedmesh.fx │ │ │ ├── StateManager │ │ │ │ ├── AlphaTest.fx │ │ │ │ ├── reflective01.fx │ │ │ │ ├── skybox01.fx │ │ │ │ ├── snow.fx │ │ │ │ └── textbump.fx │ │ │ └── Tutorials │ │ │ │ └── PIXGameDebugging │ │ │ │ └── PIXGameDebugging.fx │ │ ├── Direct3D10 │ │ │ ├── 10BitScanout10 │ │ │ │ └── 10BitScanout10.fx │ │ │ ├── AdvancedParticles │ │ │ │ ├── AdvancedParticles.fx │ │ │ │ ├── Common.fxh │ │ │ │ ├── Meshes.fx │ │ │ │ ├── Paint.fx │ │ │ │ └── RenderToVolume.fx │ │ │ ├── BasicHLSL10 │ │ │ │ ├── BasicHLSL.fx │ │ │ │ └── BasicHLSL10.fx │ │ │ ├── ContentStreaming │ │ │ │ └── ContentStreaming.fx │ │ │ ├── CubeMapGS │ │ │ │ └── CubeMapGS.fx │ │ │ ├── DDSWithoutD3DX │ │ │ │ └── DDSWithoutD3DX.fx │ │ │ ├── DeferredParticles │ │ │ │ └── DeferredParticles.fx │ │ │ ├── DepthOfField10.1 │ │ │ │ └── DepthOfField10.1.fx │ │ │ ├── DrawPredicated │ │ │ │ └── DrawPredicated.fx │ │ │ ├── EffectPools │ │ │ │ ├── EffectPools.fxh │ │ │ │ ├── EffectPools1.fx │ │ │ │ ├── EffectPools2.fx │ │ │ │ └── EffectPools3.fx │ │ │ ├── FixedFuncEMU │ │ │ │ └── FixedFuncEMU.fx │ │ │ ├── GPUBoids │ │ │ │ └── GPUBoids.fx │ │ │ ├── GPUSpectrogram │ │ │ │ └── GPUSpectrogram.fx │ │ │ ├── HDAO10.1 │ │ │ │ ├── HDAO10.1.fx │ │ │ │ └── Sprite.fx │ │ │ ├── HDRFormats10 │ │ │ │ ├── HDRFormats.fx │ │ │ │ ├── HDRFormats10.fx │ │ │ │ ├── skybox.fx │ │ │ │ └── skybox10.fx │ │ │ ├── HLSLWithoutFX10 │ │ │ │ ├── HLSLwithoutFX.psh │ │ │ │ ├── HLSLwithoutFX.vsh │ │ │ │ └── HLSLwithoutFX10.vsh │ │ │ ├── Instancing10 │ │ │ │ └── Instancing.fx │ │ │ ├── MeshFromOBJ10 │ │ │ │ └── MeshFromOBJ10.fx │ │ │ ├── Motionblur10 │ │ │ │ └── MotionBlur10.fx │ │ │ ├── MultiMon10 │ │ │ │ └── MultiMon10.fx │ │ │ ├── MultiStreamRendering │ │ │ │ └── MultiStreamRendering.fx │ │ │ ├── NBodyGravity │ │ │ │ └── NBodyGravity.fx │ │ │ ├── ParticlesGS │ │ │ │ └── particlesgs.fx │ │ │ ├── Pick10 │ │ │ │ └── Pick10.fx │ │ │ ├── PipesGS │ │ │ │ └── PipesGS.fx │ │ │ ├── ProceduralMaterials │ │ │ │ ├── Noise.fx │ │ │ │ ├── ProceduralHelpers.fxh │ │ │ │ └── ProceduralMaterials.fx │ │ │ ├── RaycastTerrain │ │ │ │ └── RaycastTerrain.fx │ │ │ ├── ShadowVolume10 │ │ │ │ ├── ShadowVolume.fx │ │ │ │ └── ShadowVolume10.fx │ │ │ ├── SimpleSample10 │ │ │ │ ├── SimpleSample.fx │ │ │ │ └── SimpleSample10.fx │ │ │ ├── Skinning10 │ │ │ │ └── Skinning10.fx │ │ │ ├── SoftParticles │ │ │ │ └── SoftParticles.fx │ │ │ ├── SparseMorphTargets │ │ │ │ ├── LightProbe.fx │ │ │ │ └── SparseMorphTargets.fx │ │ │ ├── SubD10 │ │ │ │ ├── CreateTangentPatch.fxh │ │ │ │ ├── GenPatch.fxh │ │ │ │ ├── SubD10.fx │ │ │ │ └── SubDtoBezier.fx │ │ │ ├── TransparencyAA10.1 │ │ │ │ ├── Sprite.fx │ │ │ │ └── TransparencyAA10.1.fx │ │ │ └── Tutorials │ │ │ │ ├── Direct3D10Workshop │ │ │ │ ├── Exercise00 │ │ │ │ │ └── Exercise00.fx │ │ │ │ ├── Exercise00_Solved │ │ │ │ │ └── Exercise00.fx │ │ │ │ ├── Exercise01 │ │ │ │ │ └── Exercise01.fx │ │ │ │ ├── Exercise01_Solved │ │ │ │ │ └── Exercise01.fx │ │ │ │ ├── Exercise02 │ │ │ │ │ └── Exercise02.fx │ │ │ │ ├── Exercise02_Solved │ │ │ │ │ └── Exercise02.fx │ │ │ │ ├── Exercise03 │ │ │ │ │ └── Exercise03.fx │ │ │ │ ├── Exercise03_Solved │ │ │ │ │ └── Exercise03.fx │ │ │ │ ├── Exercise04 │ │ │ │ │ └── Exercise04.fx │ │ │ │ ├── Exercise04_Solved │ │ │ │ │ └── Exercise04.fx │ │ │ │ ├── Exercise05 │ │ │ │ │ └── Exercise05.fx │ │ │ │ ├── Exercise05_Solved │ │ │ │ │ └── Exercise05.fx │ │ │ │ ├── Exercise06 │ │ │ │ │ └── Exercise06.fx │ │ │ │ └── Exercise06_Solved │ │ │ │ │ └── Exercise06.fx │ │ │ │ ├── Direct3D10WorkshopGDC2007 │ │ │ │ ├── Exercise01 │ │ │ │ │ ├── Exercise01.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise01_Solved │ │ │ │ │ ├── Exercise01.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise02 │ │ │ │ │ ├── Exercise02.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise02_Solved │ │ │ │ │ ├── Exercise02.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise03 │ │ │ │ │ ├── Exercise03.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise03_Solved │ │ │ │ │ ├── Exercise03.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise04 │ │ │ │ │ ├── Exercise04.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise05 │ │ │ │ │ ├── Exercise05.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise05_Solved │ │ │ │ │ ├── Exercise05.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── Exercise06 │ │ │ │ │ ├── Exercise06.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ └── Exercise06_Solved │ │ │ │ │ ├── Exercise06.fx │ │ │ │ │ ├── GPUSpectrogram.fx │ │ │ │ │ └── ParticlesGS.fx │ │ │ │ ├── PIXWorkshopGDC2007 │ │ │ │ ├── Exercise01 │ │ │ │ │ └── Exercise01.fx │ │ │ │ ├── Exercise01_Solved │ │ │ │ │ └── Exercise01.fx │ │ │ │ ├── Exercise02 │ │ │ │ │ └── Exercise02.fx │ │ │ │ ├── Exercise02_Solved │ │ │ │ │ └── Exercise02.fx │ │ │ │ ├── Exercise03 │ │ │ │ │ └── Exercise03.fx │ │ │ │ └── Exercise03_Solved │ │ │ │ │ └── Exercise03.fx │ │ │ │ ├── Tutorial02 │ │ │ │ └── Tutorial02.fx │ │ │ │ ├── Tutorial03 │ │ │ │ └── Tutorial03.fx │ │ │ │ ├── Tutorial04 │ │ │ │ └── Tutorial04.fx │ │ │ │ ├── Tutorial05 │ │ │ │ └── Tutorial05.fx │ │ │ │ ├── Tutorial06 │ │ │ │ └── Tutorial06.fx │ │ │ │ ├── Tutorial07 │ │ │ │ └── Tutorial07.fx │ │ │ │ ├── Tutorial08 │ │ │ │ └── Tutorial08.fx │ │ │ │ ├── Tutorial09 │ │ │ │ └── Tutorial09.fx │ │ │ │ ├── Tutorial10 │ │ │ │ └── Tutorial10.fx │ │ │ │ ├── Tutorial11 │ │ │ │ └── Tutorial11.fx │ │ │ │ ├── Tutorial12 │ │ │ │ └── Tutorial12.fx │ │ │ │ ├── Tutorial13 │ │ │ │ └── Tutorial13.fx │ │ │ │ └── Tutorial14 │ │ │ │ └── Tutorial14.fx │ │ ├── Direct3D11 │ │ │ ├── AdaptiveTessellationCS40 │ │ │ │ ├── TessellatorCS40_EdgeFactorCS.hlsl │ │ │ │ ├── TessellatorCS40_NumVerticesIndicesCS.hlsl │ │ │ │ ├── TessellatorCS40_ScatterIDCS.hlsl │ │ │ │ ├── TessellatorCS40_TessellateIndicesCS.hlsl │ │ │ │ ├── TessellatorCS40_TessellateVerticesCS.hlsl │ │ │ │ ├── TessellatorCS40_common.hlsl │ │ │ │ └── TessellatorCS40_defines.h │ │ │ ├── BC6HBC7EncoderDecoder11 │ │ │ │ ├── BC6HDecode.hlsl │ │ │ │ ├── BC6HEncode.hlsl │ │ │ │ ├── BC7Decode.hlsl │ │ │ │ └── BC7Encode.hlsl │ │ │ ├── BasicCompute11 │ │ │ │ └── BasicCompute11.hlsl │ │ │ ├── BasicHLSL11 │ │ │ │ ├── BasicHLSL.fx │ │ │ │ ├── BasicHLSL11_PS.hlsl │ │ │ │ └── BasicHLSL11_VS.hlsl │ │ │ ├── CascadedShadowMaps11 │ │ │ │ ├── RenderCascadeScene.hlsl │ │ │ │ └── RenderCascadeShadow.hlsl │ │ │ ├── ComputeShaderSort11 │ │ │ │ └── ComputeShaderSort11.hlsl │ │ │ ├── ContactHardeningShadows11 │ │ │ │ └── ContactHardeningShadows11.hlsl │ │ │ ├── DDSWithoutD3DX11 │ │ │ │ └── DDSWithoutD3DX.hlsl │ │ │ ├── DecalTessellation11 │ │ │ │ ├── AdaptiveTessellation.hlsl │ │ │ │ └── DecalTessellation11.hlsl │ │ │ ├── DetailTessellation11 │ │ │ │ ├── AdaptiveTessellation.h │ │ │ │ ├── DetailTessellation11.hlsl │ │ │ │ ├── POM.hlsl │ │ │ │ ├── Particle.hlsl │ │ │ │ └── shader_include.h │ │ │ ├── DynamicShaderLinkage11 │ │ │ │ ├── DynamicShaderLinkage11_LightPSH.h │ │ │ │ ├── DynamicShaderLinkage11_MaterialPSH.h │ │ │ │ ├── DynamicShaderLinkage11_PS.hlsl │ │ │ │ ├── DynamicShaderLinkage11_PSBuffers.h │ │ │ │ └── DynamicShaderLinkage11_VS.hlsl │ │ │ ├── DynamicShaderLinkageFX11 │ │ │ │ ├── DynamicShaderLinkageFX11.fx │ │ │ │ ├── DynamicShaderLinkageFX11_LightPSH.h │ │ │ │ ├── DynamicShaderLinkageFX11_MaterialPSH.h │ │ │ │ ├── DynamicShaderLinkageFX11_PS.hlsl │ │ │ │ ├── DynamicShaderLinkageFX11_PSBuffers.h │ │ │ │ └── DynamicShaderLinkageFX11_VS.hlsl │ │ │ ├── FluidCS11 │ │ │ │ ├── FluidCS11.hlsl │ │ │ │ └── FluidRender.hlsl │ │ │ ├── HDRToneMappingCS11 │ │ │ │ ├── BrightPassAndHorizFilterCS.hlsl │ │ │ │ ├── DumpToTexture.hlsl │ │ │ │ ├── FilterCS.hlsl │ │ │ │ ├── FinalPass.hlsl │ │ │ │ ├── PSApproach.hlsl │ │ │ │ ├── ReduceTo1DCS.hlsl │ │ │ │ ├── ReduceToSingleCS.hlsl │ │ │ │ └── skybox11.hlsl │ │ │ ├── MultithreadedRendering11 │ │ │ │ ├── MultithreadedRendering11_PS.hlsl │ │ │ │ └── MultithreadedRendering11_VS.hlsl │ │ │ ├── NBodyGravityCS11 │ │ │ │ ├── NBodyGravityCS11.hlsl │ │ │ │ └── ParticleDraw.hlsl │ │ │ ├── OIT11 │ │ │ │ ├── OIT_CS.hlsl │ │ │ │ ├── OIT_PS.hlsl │ │ │ │ └── SceneVS.hlsl │ │ │ ├── PNTriangles11 │ │ │ │ ├── AdaptiveTessellation.hlsl │ │ │ │ └── PNTriangles11.hlsl │ │ │ ├── SimpleBezier11 │ │ │ │ └── SimpleBezier11.hlsl │ │ │ ├── SimpleSample11 │ │ │ │ ├── SimpleSample.fx │ │ │ │ └── SimpleSample.hlsl │ │ │ ├── SubD11 │ │ │ │ └── SubD11.hlsl │ │ │ ├── Tutorials │ │ │ │ ├── Tutorial02 │ │ │ │ │ └── Tutorial02.fx │ │ │ │ ├── Tutorial03 │ │ │ │ │ └── Tutorial03.fx │ │ │ │ ├── Tutorial04 │ │ │ │ │ └── Tutorial04.fx │ │ │ │ ├── Tutorial05 │ │ │ │ │ └── Tutorial05.fx │ │ │ │ ├── Tutorial06 │ │ │ │ │ └── Tutorial06.fx │ │ │ │ └── Tutorial07 │ │ │ │ │ └── Tutorial07.fx │ │ │ ├── VarianceShadows11 │ │ │ │ ├── 2DQuadShaders.hlsl │ │ │ │ ├── RenderVarianceScene.hlsl │ │ │ │ └── RenderVarianceShadow.hlsl │ │ │ └── WindowsTouch │ │ │ │ ├── Soldier.fx │ │ │ │ └── quad.hlsl │ │ ├── Direct3D12 │ │ │ ├── D3D1211On12 │ │ │ │ └── shaders.hlsl │ │ │ ├── D3D12Bundles │ │ │ │ ├── shader_mesh_alt_pixel.hlsl │ │ │ │ ├── shader_mesh_simple_pixel.hlsl │ │ │ │ └── shader_mesh_simple_vert.hlsl │ │ │ ├── D3D12DynamicIndexing │ │ │ │ ├── shader_mesh_dynamic_indexing_pixel.hlsl │ │ │ │ └── shader_mesh_simple_vert.hlsl │ │ │ ├── D3D12ExecuteIndirect │ │ │ │ ├── compute.hlsl │ │ │ │ └── shaders.hlsl │ │ │ ├── D3D12HelloWorld │ │ │ │ ├── HelloBundles │ │ │ │ │ └── shaders.hlsl │ │ │ │ ├── HelloConstBuffers │ │ │ │ │ └── shaders.hlsl │ │ │ │ └── HelloTriangle │ │ │ │ │ └── shaders.hlsl │ │ │ ├── D3D12Multithreading │ │ │ │ └── shaders.hlsl │ │ │ ├── D3D12PipelineStateCache │ │ │ │ ├── BlitPixelShader.hlsl │ │ │ │ ├── BlurPixelShader.hlsl │ │ │ │ ├── DistortPixelShader.hlsl │ │ │ │ ├── EdgeDetectPixelShader.hlsl │ │ │ │ ├── GrayScalePixelShader.hlsl │ │ │ │ ├── InvertPixelShader.hlsl │ │ │ │ ├── PixelatePixelShader.hlsl │ │ │ │ ├── QuadVertexShader.hlsl │ │ │ │ ├── SimplePixelShader.hlsl │ │ │ │ ├── SimpleVertexShader.hlsl │ │ │ │ ├── UberPixelShader.hlsl │ │ │ │ ├── WarpPixelShader.hlsl │ │ │ │ └── WavePixelShader.hlsl │ │ │ ├── D3D12PredicationQueries │ │ │ │ └── shaders.hlsl │ │ │ └── D3D12nBodyGravity │ │ │ │ ├── ParticleDraw.hlsl │ │ │ │ └── nBodyGravityCS.hlsl │ │ ├── DirectX SDK EULA.txt │ │ └── readme.txt │ └── UnityBuiltinShaders │ │ ├── CGIncludes │ │ ├── AutoLight.cginc │ │ ├── GLSLSupport.glslinc │ │ ├── GraniteShaderLib3.cginc │ │ ├── HLSLSupport.cginc │ │ ├── Lighting.cginc │ │ ├── SpeedTree8Common.cginc │ │ ├── SpeedTreeBillboardCommon.cginc │ │ ├── SpeedTreeCommon.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-Skinning-Util.cginc │ │ ├── Internal-Skinning.compute │ │ ├── Internal-VT-TranslationTableReplace.compute │ │ ├── Internal-VT-TranslationTableUpsample.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 │ │ │ ├── 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 │ │ ├── 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 │ │ ├── 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 └── UnityShaderParser.Tests.csproj ├── UnityShaderParser.sln └── UnityShaderParser ├── Common ├── BaseLexer.cs ├── BaseParser.cs ├── BaseSyntaxElements.cs └── ShaderParser.cs ├── HLSL ├── HLSLEditor.cs ├── HLSLLexer.cs ├── HLSLParser.cs ├── HLSLPrinter.cs ├── HLSLSyntaxElements.cs ├── HLSLSyntaxFacts.cs ├── HLSLSyntaxVisitor.cs └── PreProcessor │ ├── ConstExpressionEvaluator.cs │ ├── HLSLPreProcessor.cs │ └── IPreProcessorIncludeResolver.cs ├── ShaderLab ├── ShaderLabEditor.cs ├── ShaderLabLexer.cs ├── ShaderLabParser.cs ├── ShaderLabPrinter.cs ├── ShaderLabSyntaxElements.cs ├── ShaderLabSyntaxFacts.cs └── ShaderLabSyntaxVisitor.cs └── UnityShaderParser.csproj /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8618: Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. 4 | dotnet_diagnostic.CS8618.severity = silent 5 | -------------------------------------------------------------------------------- /.github/workflows/test-ci.yml: -------------------------------------------------------------------------------- 1 | name: UnityShaderParser CI 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | build: 11 | runs-on: windows-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | - name: Setup dotnet 16 | uses: actions/setup-dotnet@v3 17 | with: 18 | dotnet-version: '6.0.x' 19 | - name: Install dependencies 20 | run: dotnet restore 21 | - name: Build 22 | run: dotnet build 23 | - name: Test with the dotnet CLI 24 | run: dotnet test 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | UnityShaderParser/bin/ 3 | UnityShaderParser/obj/ 4 | UnityShaderParser.Tests/bin/ 5 | UnityShaderParser.Tests/obj/ 6 | UnityShaderParser.Experiments/bin/ 7 | UnityShaderParser.Experiments/obj/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2024, Pema Malling 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /UnityShaderParser.Experiments/Program.cs: -------------------------------------------------------------------------------- 1 | using UnityShaderParser.Common; 2 | using UnityShaderParser.HLSL; 3 | using UnityShaderParser.HLSL.PreProcessor; 4 | 5 | string shaderPath = @"D:\Projects\UnityShaderParser\UnityShaderParser\UnityShaderParser.Tests\TestShaders\Homemade\Tricky.hlsl"; 6 | string shaderSource = File.ReadAllText(shaderPath); 7 | Console.WriteLine($"Before:\n{shaderSource}\n"); 8 | 9 | // Ignore macros for the purpose of editing 10 | var config = new HLSLParserConfig() { PreProcessorMode = PreProcessorMode.StripDirectives }; 11 | 12 | List decls = ShaderParser.ParseTopLevelDeclarations(shaderSource, config, out var diags, out var prags); 13 | 14 | string editedShaderSource = HLSLEditor.RunEditor(shaderSource, decls); 15 | Console.WriteLine($"After:\n{editedShaderSource}\n"); 16 | 17 | class IfConditionReplacer : HLSLEditor 18 | { 19 | public IfConditionReplacer(string source, List> tokens) 20 | : base(source, tokens) { } 21 | 22 | public override void VisitIfStatementNode(IfStatementNode node) 23 | { 24 | Edit(node.Condition, "true"); // replace conditions with 'true' 25 | base.VisitIfStatementNode(node); 26 | } 27 | } -------------------------------------------------------------------------------- /UnityShaderParser.Experiments/UnityShaderParser.Experiments.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/FxDis/readme.txt: -------------------------------------------------------------------------------- 1 | From FXDIS: 2 | http://code.google.com/p/fxdis-d3d1x/ -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ds5/basic.hlsl: -------------------------------------------------------------------------------- 1 | struct HS_CONSTANT_OUTPUT 2 | { 3 | float edges[2] : SV_TessFactor; 4 | }; 5 | 6 | struct HS_OUTPUT 7 | { 8 | float3 cpoint : CPOINT; 9 | }; 10 | 11 | struct DS_OUTPUT 12 | { 13 | float4 position : SV_Position; 14 | }; 15 | 16 | [domain("isoline")] 17 | DS_OUTPUT main(HS_CONSTANT_OUTPUT input, OutputPatch op, float2 uv : SV_DomainLocation) 18 | { 19 | DS_OUTPUT output; 20 | 21 | float t = uv.x; 22 | 23 | float3 pos = pow(1.0f - t, 3.0f) * op[0].cpoint + 3.0f * pow(1.0f - t, 2.0f) * t * op[1].cpoint + 3.0f * (1.0f - t) * pow(t, 2.0f) * op[2].cpoint + pow(t, 3.0f) * op[3].cpoint; 24 | 25 | output.position = float4(pos, 1.0f); 26 | 27 | return output; 28 | } 29 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ds5/basic.knowngood: -------------------------------------------------------------------------------- 1 | struct HS_CONSTANT_OUTPUT 2 | { 3 | float edges[2] : SV_TessFactor; 4 | }; 5 | struct HS_OUTPUT 6 | { 7 | float3 cpoint : CPOINT; 8 | }; 9 | struct DS_OUTPUT 10 | { 11 | float4 position : SV_Position; 12 | }; 13 | [domain("isoline")] 14 | DS_OUTPUT main(HS_CONSTANT_OUTPUT input, OutputPatch op, float2 uv : SV_DomainLocation) 15 | { 16 | DS_OUTPUT output; 17 | float t = uv.x; 18 | float3 pos = pow(1.0f - t, 3.0f) * op[0].cpoint + 3.0f * pow(1.0f - t, 2.0f) * t * op[1].cpoint + 3.0f * (1.0f - t) * pow(t, 2.0f) * op[2].cpoint + pow(t, 3.0f) * op[3].cpoint; 19 | output.position = float4(pos, 1.0f); 20 | return output; 21 | } 22 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/hs5/basic.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_OUTPUT 2 | { 3 | float3 cpoint : CPOINT; 4 | }; 5 | 6 | struct HS_CONSTANT_OUTPUT 7 | { 8 | float edges[2] : SV_TessFactor; 9 | }; 10 | 11 | struct HS_OUTPUT 12 | { 13 | float3 cpoint : CPOINT; 14 | }; 15 | 16 | HS_CONSTANT_OUTPUT HSConst() 17 | { 18 | HS_CONSTANT_OUTPUT output; 19 | 20 | output.edges[0] = 1.0f; // Detail factor (see below for explanation) 21 | output.edges[1] = 8.0f; // Density factor 22 | 23 | return output; 24 | } 25 | 26 | [domain("isoline")] 27 | [partitioning("integer")] 28 | [outputtopology("line")] 29 | [outputcontrolpoints(4)] 30 | [patchconstantfunc("HSConst")] 31 | HS_OUTPUT main(InputPatch ip, uint id : SV_OutputControlPointID) 32 | { 33 | HS_OUTPUT output; 34 | output.cpoint = ip[id].cpoint; 35 | return output; 36 | } 37 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ps4/primID.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct PS_INPUT 3 | { 4 | uint PrimID : SV_PrimitiveID; 5 | }; 6 | 7 | float4 main( PS_INPUT input ) : SV_Target 8 | { 9 | float4 colour; 10 | float fPrimID = input.PrimID; 11 | colour.r = fPrimID; 12 | colour.g = 2 * fPrimID; 13 | colour.b = (1.0/64.0) * fPrimID; 14 | colour.a = (1.0/32.0) * fPrimID; 15 | return colour; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ps5/conservative_depth.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct PS_INPUT 3 | { 4 | float4 colour : COLOR0; 5 | float depth : DEPTH; 6 | }; 7 | 8 | struct PS_OUTPUT_GE 9 | { 10 | float colour : SV_Target; 11 | float depth : SV_DepthGreaterEqual; 12 | }; 13 | 14 | struct PS_OUTPUT_LE 15 | { 16 | float colour : SV_Target; 17 | float depth : SV_DepthLessEqual; 18 | }; 19 | 20 | 21 | PS_OUTPUT_GE DepthGreaterThan( PS_INPUT Input ) 22 | { 23 | PS_OUTPUT_GE Output; 24 | 25 | Output.colour = Input.colour; 26 | Output.depth = Input.depth; 27 | 28 | return Output; 29 | } 30 | 31 | PS_OUTPUT_LE DepthLessThan( PS_INPUT Input ) 32 | { 33 | PS_OUTPUT_LE Output; 34 | 35 | Output.colour = Input.colour; 36 | Output.depth = Input.depth; 37 | 38 | return Output; 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ps5/interface_arrays.hlsl: -------------------------------------------------------------------------------- 1 | 2 | interface iChangeColour 3 | { 4 | float3 ChangeColour(float3 colour); 5 | }; 6 | 7 | class cDoubleColour : iChangeColour 8 | { 9 | float3 ChangeColour(float3 colour) { 10 | return colour * float3(2, 2, 2); 11 | } 12 | }; 13 | 14 | class cHalfColour : iChangeColour 15 | { 16 | float3 ChangeColour(float3 colour) { 17 | return colour / float3(2, 2, 2); 18 | } 19 | }; 20 | 21 | 22 | class cUnchangedColour : iChangeColour 23 | { 24 | float3 ChangeColour(float3 colour) { 25 | return colour; 26 | } 27 | }; 28 | 29 | interface iAlpha 30 | { 31 | float ChooseAlpha(); 32 | }; 33 | 34 | class OneAlpha : iAlpha 35 | { 36 | float ChooseAlpha() { 37 | return 1.0; 38 | } 39 | }; 40 | 41 | class TwoThirdsAlpha : iAlpha 42 | { 43 | float ChooseAlpha() { 44 | return 0.66; 45 | } 46 | }; 47 | 48 | struct PS_INPUT 49 | { 50 | float3 Colour : COLOR0; 51 | }; 52 | 53 | iChangeColour gAbstractColourChanger[2]; 54 | iChangeColour gAbstractColourChangerB; 55 | iAlpha gAlphaChooser[3]; 56 | 57 | int alphaIndex; 58 | 59 | float4 main( PS_INPUT Input ) : SV_TARGET 60 | { 61 | float3 ModifiedColour = gAbstractColourChanger[1].ChangeColour(Input.Colour); 62 | ModifiedColour = gAbstractColourChangerB.ChangeColour(ModifiedColour); 63 | 64 | return float4(ModifiedColour,gAlphaChooser[alphaIndex].ChooseAlpha()); 65 | } 66 | 67 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ps5/interfaces.hlsl: -------------------------------------------------------------------------------- 1 | 2 | interface iChangeColour 3 | { 4 | float3 ChangeColour(float3 colour); 5 | }; 6 | 7 | class cDoubleColour : iChangeColour 8 | { 9 | float3 ChangeColour(float3 colour) { 10 | return colour * float3(2, 2, 2); 11 | } 12 | }; 13 | 14 | class cHalfColour : iChangeColour 15 | { 16 | float3 ChangeColour(float3 colour) { 17 | return colour / float3(2, 2, 2); 18 | } 19 | }; 20 | 21 | 22 | class cUnchangedColour : iChangeColour 23 | { 24 | float3 ChangeColour(float3 colour) { 25 | return colour; 26 | } 27 | }; 28 | 29 | interface iAlpha 30 | { 31 | float ChooseAlpha(); 32 | }; 33 | 34 | class OneAlpha : iAlpha 35 | { 36 | float ChooseAlpha() { 37 | return 1.0; 38 | } 39 | }; 40 | 41 | class TwoThirdsAlpha : iAlpha 42 | { 43 | float ChooseAlpha() { 44 | return 0.66; 45 | } 46 | }; 47 | 48 | struct PS_INPUT 49 | { 50 | float3 Colour : COLOR0; 51 | }; 52 | 53 | iChangeColour gAbstractColourChanger; 54 | iChangeColour gAbstractColourChangerB; 55 | iAlpha gAlphaChooser; 56 | 57 | float4 main( PS_INPUT Input ) : SV_TARGET 58 | { 59 | float3 ModifiedColour = gAbstractColourChanger.ChangeColour(Input.Colour); 60 | ModifiedColour = gAbstractColourChangerB.ChangeColour(ModifiedColour); 61 | 62 | return float4(ModifiedColour,gAlphaChooser.ChooseAlpha()); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ps5/sample.frag: -------------------------------------------------------------------------------- 1 | #version 140 2 | in vec4 frag_TEXCOORD0; 3 | out vec4 rast_SV_Target; 4 | struct PS_INPUT { 5 | vec4 TexC; 6 | }; 7 | uniform sampler2D TextureBase; 8 | uniform sampler2D TextureDetail; 9 | vec4 xx_main(PS_INPUT xx_input) { 10 | vec4 base = texture(TextureBase, xx_input.TexC); 11 | vec4 detail = texture(TextureDetail, xx_input.TexC); 12 | return base * detail; 13 | } 14 | void main() { 15 | PS_INPUT xx_input; 16 | xx_input.TexC = frag_TEXCOORD0; 17 | vec4 result = xx_main(xx_input); 18 | rast_SV_Target = result; 19 | } 20 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/ps5/sample.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct PS_INPUT 3 | { 4 | float4 TexC : TEXCOORD0; 5 | }; 6 | SamplerState TextureSampler 7 | { 8 | Filter = MIN_MAG_MIP_LINEAR; 9 | AddressU = Wrap; 10 | AddressV = Wrap; 11 | }; 12 | 13 | Texture2D TextureBase; 14 | Texture2D TextureDetail; 15 | 16 | float4 main( PS_INPUT input ) : SV_Target 17 | { 18 | float4 base = TextureBase.Sample(TextureSampler, input.TexC); 19 | float4 detail = TextureDetail.Sample(TextureSampler, input.TexC); 20 | return base * detail; 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/readme.txt: -------------------------------------------------------------------------------- 1 | From HLSLCrossCompiler by James Jones: 2 | https://github.com/James-Jones/HLSLCrossCompiler -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs4/mov.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | }; 6 | 7 | VS_OUTPUT main( in float4 vPosition : POSITION ) 8 | { 9 | VS_OUTPUT Output; 10 | 11 | Output.Position = vPosition; 12 | 13 | return Output; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs4/mov.vert: -------------------------------------------------------------------------------- 1 | #version 140 2 | in vec4 POSITION; 3 | struct VS_OUTPUT { 4 | vec4 Position; 5 | }; 6 | VS_OUTPUT xx_main(in vec4 vPosition) { 7 | VS_OUTPUT Output; 8 | Output.Position = vPosition; 9 | return Output; 10 | } 11 | void main() { 12 | vec4 vPosition; 13 | vPosition = POSITION; 14 | VS_OUTPUT result = xx_main(vPosition); 15 | vec4 temp = result.Position; 16 | gl_Position = temp * vec4(1, -1, 2, 1) - vec4(0, 0, temp.w, 0); 17 | } 18 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs4/multiple_const_buffers.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | float4 Albedo : COLOR0; 6 | }; 7 | 8 | cbuffer transformsA 9 | { 10 | float4x4 modelview; 11 | int unusedTestA; 12 | } 13 | cbuffer transformsB 14 | { 15 | int unusedTestB; 16 | float4x4 projection; 17 | } 18 | 19 | //default/global cbuffer 20 | float4 diffuse; 21 | 22 | VS_OUTPUT main( in float4 vPosition : POSITION ) 23 | { 24 | VS_OUTPUT Output; 25 | 26 | float4x4 mvp = modelview * projection; 27 | 28 | Output.Position = mul(vPosition, mvp); 29 | Output.Albedo = diffuse; 30 | 31 | return Output; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs4/switch.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | float4 Colour : COLOR0; 6 | }; 7 | 8 | int SwitchValue; 9 | 10 | VS_OUTPUT main( in float4 vPosition : POSITION ) 11 | { 12 | VS_OUTPUT Output; 13 | 14 | 15 | Output.Position = vPosition; 16 | 17 | switch(SwitchValue) 18 | { 19 | case 0: 20 | { 21 | Output.Colour = float4(1, 0, 0, 1); 22 | break; 23 | } 24 | case 1: 25 | { 26 | Output.Colour = float4(1, 1, 0, 1); 27 | break; 28 | } 29 | default: 30 | { 31 | Output.Colour = float4(1, 1, 1, 1); 32 | break; 33 | } 34 | } 35 | 36 | return Output; 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs5/any.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | }; 6 | 7 | VS_OUTPUT main( in float4 vPosition : POSITION ) 8 | { 9 | VS_OUTPUT Output; 10 | 11 | if(any(vPosition)) 12 | { 13 | vPosition.z = 2.0; 14 | } 15 | 16 | Output.Position = vPosition; 17 | 18 | return Output; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs5/const_temp.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | }; 6 | 7 | row_major float4x4 mWorldViewProj; 8 | 9 | VS_OUTPUT main( in float4 vPosition : POSITION, in float4 vTexCoord : TEXCOORD0 ) 10 | { 11 | VS_OUTPUT Output; 12 | 13 | Output.Position = mul(vPosition, mWorldViewProj) + vTexCoord; 14 | 15 | return Output; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs5/mad_imm.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | }; 6 | 7 | VS_OUTPUT main( in float4 vPosition : POSITION, in float4 vTexCoord : TEXCOORD0 ) 8 | { 9 | VS_OUTPUT Output; 10 | float4 Offset; 11 | 12 | Offset.x = 0.1; 13 | Offset.y = 0.2; 14 | Offset.z = 0.3; 15 | Offset.w = 0.4; 16 | 17 | Output.Position = vPosition + Offset * vTexCoord; 18 | 19 | return Output; 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs5/mov.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | }; 6 | 7 | VS_OUTPUT main( in float4 vPosition : POSITION ) 8 | { 9 | VS_OUTPUT Output; 10 | 11 | Output.Position = vPosition; 12 | 13 | return Output; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/HlslCrossCompiler/vs5/sincos.hlsl: -------------------------------------------------------------------------------- 1 | 2 | struct VS_OUTPUT 3 | { 4 | float4 Position : SV_Position; 5 | }; 6 | 7 | float angle; 8 | 9 | VS_OUTPUT main( in float4 vPosition : POSITION ) 10 | { 11 | VS_OUTPUT Output; 12 | float cos; 13 | 14 | vPosition.x = sin(angle*2); 15 | sincos(angle, vPosition.w, cos); 16 | 17 | vPosition.z += cos; 18 | 19 | Output.Position = vPosition; 20 | 21 | return Output; 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Homemade/Include/IncludeB.hlsl: -------------------------------------------------------------------------------- 1 | void B() {} -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Homemade/IncludeA.hlsl: -------------------------------------------------------------------------------- 1 | void A() {} 2 | 3 | #include "Include/IncludeB.hlsl" -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Homemade/PackageRequirements.shader: -------------------------------------------------------------------------------- 1 | // https://docs.unity3d.com/2022.3/Documentation/Manual/SL-PackageRequirements.html 2 | Shader "Package Requirements" 3 | { 4 | SubShader 5 | { 6 | PackageRequirements 7 | { 8 | "com.some.package.x": "[2.3.4,3.4.5]" 9 | "com.some.package.z" : "[1.1,3.2]" 10 | "unity" : "2021.2" 11 | } 12 | Pass 13 | { 14 | PackageRequirements 15 | { 16 | "com.some.package.y": "[1.2.2,2.5]" 17 | "com.some.package.z" : "[2.0,3.1]" 18 | "com.some.package.w" : "unity=[2021.2.1,2021.2.5]" 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Homemade/Tricky.hlsl: -------------------------------------------------------------------------------- 1 | typedef float BOBB; 2 | 3 | namespace Foobar::BOOBsdsad 4 | { 5 | namespace NAME 6 | { 7 | } 8 | 9 | typedef const float FLAAT, BLAAT::DD, BLOM; 10 | 11 | const static BlendState WhatArStateObjectsEven[1] : I: LOVE: SEMANTICS: register(anyIdentifierAllowedHere1337) 12 | < int blabla = 27; string blacksheep = "Hello There"; > 13 | { 14 | Can::Have::NameSpaces = Any + Expression + Allowed; 15 | AndArrayRanksButOnlyASingleOne[0] = aaa(1); 16 | }; 17 | 18 | void foo() 19 | { 20 | if (b + c) 21 | { 22 | return d; 23 | } 24 | 25 | int a = 3 * (5 + 7); 26 | int boo = (some, more, 333 + 33); 27 | int a = b ? c : d ? e : f; 28 | Foo::Bar::Baz(); 29 | 30 | vector vec = float4(1, 2, 3, 4); 31 | matrix mat = 0; 32 | 33 | unsigned int foobar = 3; 34 | 35 | vector dd = 3; 36 | 37 | bool a = bool(true); 38 | half b = half(1); 39 | int c = int(45); 40 | uint d = uint(5); 41 | float f = float(55); 42 | double dd = double(55); 43 | double acv = min16float(11); 44 | double acv2 = min16int(11); 45 | double acv23 = min16uint(11); 46 | double acv24 = string("foo"); 47 | 48 | [foobar] [baz] typedef const float FLAAT, BLAAT, BLOM; 49 | 50 | [boobaz] { 51 | int a = 3; 52 | } 53 | 54 | do 55 | { 56 | typedef const float FLAAT, BLAAT, BLOM; 57 | } while (i < 2); 58 | } 59 | 60 | struct bla { int a; }; 61 | 62 | struct bla { int a; } b; 63 | 64 | void foo() 65 | { 66 | [bla] nointerpolation struct bla { int a; } b; 67 | } 68 | } -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Homemade/TrickyTags.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/InternalErrorShader" 2 | { 3 | SubShader 4 | { 5 | Tags { "Foo" = "Bar" "Foo" = "Bar" } 6 | 7 | Pass 8 | { 9 | } 10 | } 11 | Fallback Off 12 | } 13 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Nvidia/NVIDIA Shader Library License.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pema99/UnityShaderParser/a9ba792d8ae68c8b0a00a554fbec10d893654eca/UnityShaderParser.Tests/TestShaders/Nvidia/NVIDIA Shader Library License.txt -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Nvidia/include/nvInverse.fxh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pema99/UnityShaderParser/a9ba792d8ae68c8b0a00a554fbec10d893654eca/UnityShaderParser.Tests/TestShaders/Nvidia/include/nvInverse.fxh -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Nvidia/readme.txt: -------------------------------------------------------------------------------- 1 | From NVIDIA Shader Library 2 | http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/PoiyomiToon/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Poiyomi Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/PoiyomiToon/README.txt: -------------------------------------------------------------------------------- 1 | From https://github.com/poiyomi/PoiyomiToonShader -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D/CustomUI/CustomUI.fx: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: CustomUI.fx 3 | // 4 | // The effect file for the CustomUI sample. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //-------------------------------------------------------------------------------------- 8 | 9 | 10 | //-------------------------------------------------------------------------------------- 11 | // Global variables 12 | //-------------------------------------------------------------------------------------- 13 | float g_fTime; // App's time in seconds 14 | float4x4 g_mWorld; // World matrix for object 15 | float4x4 g_mWorldViewProjection; // World * View * Projection matrix 16 | texture g_txScene; 17 | 18 | sampler g_samScene = 19 | sampler_state 20 | { 21 | Texture = ; 22 | MinFilter = Linear; 23 | MagFilter = Linear; 24 | MipFilter = Point; 25 | }; 26 | 27 | 28 | void VertScene( float4 Pos : POSITION, 29 | float2 Tex : TEXCOORD0, 30 | out float4 oPos : POSITION, 31 | out float2 oTex : TEXCOORD0 ) 32 | { 33 | oPos = mul( Pos, g_mWorldViewProjection ); 34 | oTex = Tex; 35 | } 36 | 37 | 38 | float4 PixScene( float2 Tex : TEXCOORD0 ) : COLOR0 39 | { 40 | return tex2D( g_samScene, Tex ); 41 | } 42 | 43 | 44 | //-------------------------------------------------------------------------------------- 45 | // Techniques 46 | //-------------------------------------------------------------------------------------- 47 | technique RenderScene 48 | { 49 | pass P0 50 | { 51 | VertexShader = compile vs_2_0 VertScene(); 52 | PixelShader = compile ps_2_0 PixScene(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D/HDRFormats/skybox.fx: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // File: SkyBox.fx 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //----------------------------------------------------------------------------- 8 | 9 | 10 | //----------------------------------------------------------------------------- 11 | // Global variables 12 | //----------------------------------------------------------------------------- 13 | float4x4 g_mInvWorldViewProjection; 14 | 15 | texture g_EnvironmentTexture; 16 | 17 | sampler EnvironmentSampler = sampler_state 18 | { 19 | Texture = (g_EnvironmentTexture); 20 | MipFilter = POINT; 21 | MinFilter = POINT; 22 | MagFilter = POINT; 23 | }; 24 | 25 | 26 | //----------------------------------------------------------------------------- 27 | // Skybox stuff 28 | //----------------------------------------------------------------------------- 29 | struct SkyboxVS_Input 30 | { 31 | float4 Pos : POSITION; 32 | }; 33 | 34 | struct SkyboxVS_Output 35 | { 36 | float4 Pos : POSITION; 37 | float3 Tex : TEXCOORD0; 38 | }; 39 | 40 | SkyboxVS_Output SkyboxVS( SkyboxVS_Input Input ) 41 | { 42 | SkyboxVS_Output Output; 43 | 44 | Output.Pos = Input.Pos; 45 | Output.Tex = normalize( mul(Input.Pos, g_mInvWorldViewProjection) ); 46 | 47 | return Output; 48 | } 49 | 50 | float4 SkyboxPS( SkyboxVS_Output Input ) : COLOR 51 | { 52 | float4 color = texCUBE( EnvironmentSampler, Input.Tex ); 53 | return color; 54 | } 55 | 56 | technique Skybox 57 | { 58 | pass p0 59 | { 60 | VertexShader = compile vs_2_0 SkyboxVS(); 61 | PixelShader = compile ps_2_0 SkyboxPS(); 62 | } 63 | } 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D/HDRPipeline/Shader Code/HDRSource.psh: -------------------------------------------------------------------------------- 1 | //====================================================================== 2 | // 3 | // HIGH DYNAMIC RANGE RENDERING DEMONSTRATION 4 | // Written by Jack Hoxley, October 2005 5 | // 6 | //====================================================================== 7 | 8 | 9 | 10 | //------------------------------------------------------------------ 11 | // GLOBAL VARIABLES 12 | //------------------------------------------------------------------ 13 | float HDRScalar = 3.0f; // Constant exposed to the application. 14 | // Larger values will generate a brighter colour. 15 | 16 | 17 | 18 | //------------------------------------------------------------------ 19 | // SHADER ENTRY POINT 20 | //------------------------------------------------------------------ 21 | float4 main( in float4 c : COLOR ) : COLOR 22 | { 23 | 24 | return float4( 25 | c.r * HDRScalar, 26 | c.g * HDRScalar, 27 | c.b * HDRScalar, 28 | 1.0f 29 | ); 30 | 31 | } -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D10/HDRFormats10/skybox.fx: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // File: SkyBox.fx 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //----------------------------------------------------------------------------- 8 | 9 | 10 | //----------------------------------------------------------------------------- 11 | // Global variables 12 | //----------------------------------------------------------------------------- 13 | float4x4 g_mInvWorldViewProjection; 14 | 15 | texture g_EnvironmentTexture; 16 | 17 | sampler EnvironmentSampler = sampler_state 18 | { 19 | Texture = (g_EnvironmentTexture); 20 | MipFilter = POINT; 21 | MinFilter = POINT; 22 | MagFilter = POINT; 23 | }; 24 | 25 | 26 | //----------------------------------------------------------------------------- 27 | // Skybox stuff 28 | //----------------------------------------------------------------------------- 29 | struct SkyboxVS_Input 30 | { 31 | float4 Pos : POSITION; 32 | }; 33 | 34 | struct SkyboxVS_Output 35 | { 36 | float4 Pos : POSITION; 37 | float3 Tex : TEXCOORD0; 38 | }; 39 | 40 | SkyboxVS_Output SkyboxVS( SkyboxVS_Input Input ) 41 | { 42 | SkyboxVS_Output Output; 43 | 44 | Output.Pos = Input.Pos; 45 | Output.Tex = normalize( mul(Input.Pos, g_mInvWorldViewProjection) ); 46 | 47 | return Output; 48 | } 49 | 50 | float4 SkyboxPS( SkyboxVS_Output Input ) : COLOR 51 | { 52 | float4 color = texCUBE( EnvironmentSampler, Input.Tex ); 53 | return color; 54 | } 55 | 56 | technique Skybox 57 | { 58 | pass p0 59 | { 60 | VertexShader = compile vs_2_0 SkyboxVS(); 61 | PixelShader = compile ps_2_0 SkyboxPS(); 62 | } 63 | } 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D10/HLSLWithoutFX10/HLSLwithoutFX.psh: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // File: HLSLwithoutEffects.psh 3 | // 4 | // Desc: The pixel shader file for the HLSLWithoutFX sample. It contains a pixel 5 | // shader which passes the color from the vertex shader through. 6 | // 7 | // Copyright (c) Microsoft Corporation. All rights reserved. 8 | //----------------------------------------------------------------------------- 9 | 10 | //----------------------------------------------------------------------------- 11 | // Vertex shader output structure 12 | //----------------------------------------------------------------------------- 13 | struct VS_OUTPUT 14 | { 15 | float4 Position : SV_Position; // vertex position 16 | float4 Diffuse : COLOR0; // vertex diffuse color 17 | }; 18 | 19 | 20 | //----------------------------------------------------------------------------- 21 | // Name: main 22 | // Type: Pixel shader 23 | // Desc: Passes the input color through 24 | //----------------------------------------------------------------------------- 25 | float4 main( VS_OUTPUT input ) : SV_Target 26 | { 27 | return input.Diffuse; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D10/Tutorials/Tutorial02/Tutorial02.fx: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: Tutorial02.fx 3 | // 4 | // Copyright (c) Microsoft Corporation. All rights reserved. 5 | //-------------------------------------------------------------------------------------- 6 | 7 | //-------------------------------------------------------------------------------------- 8 | // Vertex Shader 9 | //-------------------------------------------------------------------------------------- 10 | float4 VS( float4 Pos : POSITION ) : SV_POSITION 11 | { 12 | return Pos; 13 | } 14 | 15 | 16 | //-------------------------------------------------------------------------------------- 17 | // Pixel Shader 18 | //-------------------------------------------------------------------------------------- 19 | float4 PS( float4 Pos : SV_POSITION ) : SV_Target 20 | { 21 | return float4( 1.0f, 1.0f, 0.0f, 1.0f ); // Yellow, with Alpha = 1 22 | } 23 | 24 | 25 | //-------------------------------------------------------------------------------------- 26 | technique10 Render 27 | { 28 | pass P0 29 | { 30 | SetVertexShader( CompileShader( vs_4_0, VS() ) ); 31 | SetGeometryShader( NULL ); 32 | SetPixelShader( CompileShader( ps_4_0, PS() ) ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D10/Tutorials/Tutorial03/Tutorial03.fx: -------------------------------------------------------------------------------- 1 | // 2 | // Vertex Shader 3 | // 4 | float4 VS( float4 Pos : POSITION ) : SV_POSITION 5 | { 6 | return Pos; 7 | } 8 | 9 | 10 | // 11 | // Pixel Shader 12 | // 13 | float4 PS( float4 Pos : SV_POSITION ) : SV_Target 14 | { 15 | return float4( 1.0f, 1.0f, 0.0f, 1.0f ); // Yellow, with Alpha = 1 16 | } 17 | 18 | 19 | technique10 Render 20 | { 21 | pass P0 22 | { 23 | SetVertexShader( CompileShader( vs_4_0, VS() ) ); 24 | SetGeometryShader( NULL ); 25 | SetPixelShader( CompileShader( ps_4_0, PS() ) ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/AdaptiveTessellationCS40/TessellatorCS40_ScatterIDCS.hlsl: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: TessellatorCS40_ScatterIDCS.hlsl 3 | // 4 | // The CS to scatter vertex ID and triangle ID 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //-------------------------------------------------------------------------------------- 8 | StructuredBuffer InputScanned : register(t0); 9 | RWStructuredBuffer TriIDIndexIDOut : register(u0); 10 | 11 | cbuffer cbCS : register(b1) 12 | { 13 | uint4 g_param; 14 | } 15 | 16 | [numthreads(128, 1, 1)] 17 | void CSScatterVertexTriIDIndexID( uint3 DTid : SV_DispatchThreadID ) 18 | { 19 | if (DTid.x < g_param.x) 20 | { 21 | uint start = InputScanned[DTid.x-1].x; 22 | uint end = InputScanned[DTid.x].x; 23 | 24 | for ( uint i = start; i < end; ++i ) 25 | { 26 | TriIDIndexIDOut[i] = uint2(DTid.x, i - start); 27 | } 28 | } 29 | } 30 | 31 | [numthreads(128, 1, 1)] 32 | void CSScatterIndexTriIDIndexID( uint3 DTid : SV_DispatchThreadID ) 33 | { 34 | if (DTid.x < g_param.x) 35 | { 36 | uint start = InputScanned[DTid.x-1].y; 37 | uint end = InputScanned[DTid.x].y; 38 | 39 | for ( uint i = start; i < end; ++i ) 40 | { 41 | TriIDIndexIDOut[i] = uint2(DTid.x, i - start); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/AdaptiveTessellationCS40/TessellatorCS40_defines.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: TessellatorCS40_defines.h 3 | // 4 | // This file defines common constants which are included by both CPU code and shader code 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //-------------------------------------------------------------------------------------- 8 | 9 | #define MAX_FACTOR 16 10 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/BasicHLSL11/BasicHLSL11_VS.hlsl: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: BasicHLSL11_VS.hlsl 3 | // 4 | // The vertex shader file for the BasicHLSL11 sample. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //-------------------------------------------------------------------------------------- 8 | 9 | //-------------------------------------------------------------------------------------- 10 | // Globals 11 | //-------------------------------------------------------------------------------------- 12 | cbuffer cbPerObject : register( b0 ) 13 | { 14 | matrix g_mWorldViewProjection : packoffset( c0 ); 15 | matrix g_mWorld : packoffset( c4 ); 16 | }; 17 | 18 | //-------------------------------------------------------------------------------------- 19 | // Input / Output structures 20 | //-------------------------------------------------------------------------------------- 21 | struct VS_INPUT 22 | { 23 | float4 vPosition : POSITION; 24 | float3 vNormal : NORMAL; 25 | float2 vTexcoord : TEXCOORD0; 26 | }; 27 | 28 | struct VS_OUTPUT 29 | { 30 | float3 vNormal : NORMAL; 31 | float2 vTexcoord : TEXCOORD0; 32 | float4 vPosition : SV_POSITION; 33 | }; 34 | 35 | //-------------------------------------------------------------------------------------- 36 | // Vertex Shader 37 | //-------------------------------------------------------------------------------------- 38 | VS_OUTPUT VSMain( VS_INPUT Input ) 39 | { 40 | VS_OUTPUT Output; 41 | 42 | Output.vPosition = mul( Input.vPosition, g_mWorldViewProjection ); 43 | Output.vNormal = mul( Input.vNormal, (float3x3)g_mWorld ); 44 | Output.vTexcoord = Input.vTexcoord; 45 | 46 | return Output; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/FluidCS11/FluidCS11.hlsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pema99/UnityShaderParser/a9ba792d8ae68c8b0a00a554fbec10d893654eca/UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/FluidCS11/FluidCS11.hlsl -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/HDRToneMappingCS11/DumpToTexture.hlsl: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DumpToTexture.hlsl 3 | // 4 | // The PS for converting CS output buffer to a texture, used in CS path of 5 | // HDRToneMappingCS11 sample 6 | // 7 | // Copyright (c) Microsoft Corporation. All rights reserved. 8 | //-------------------------------------------------------------------------------------- 9 | StructuredBuffer buffer : register( t0 ); 10 | 11 | struct QuadVS_Output 12 | { 13 | float4 Pos : SV_POSITION; 14 | float2 Tex : TEXCOORD0; 15 | }; 16 | 17 | cbuffer cbPS : register( b0 ) 18 | { 19 | uint4 g_param; 20 | }; 21 | 22 | float4 PSDump( QuadVS_Output Input ) : SV_TARGET 23 | { 24 | // To calculate the buffer offset, it is natural to use the screen space coordinates, 25 | // Input.Pos is the screen space coordinates of the pixel being written 26 | return buffer[ (Input.Pos.x - 0.5) + (Input.Pos.y - 0.5) * g_param.x ]; 27 | } 28 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/HDRToneMappingCS11/skybox11.hlsl: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // File: SkyBox11.hlsl 3 | // 4 | // Desc: 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //----------------------------------------------------------------------------- 8 | 9 | cbuffer cbPerObject : register( b0 ) 10 | { 11 | row_major matrix g_mWorldViewProjection : packoffset( c0 ); 12 | } 13 | 14 | TextureCube g_EnvironmentTexture : register( t0 ); 15 | SamplerState g_sam : register( s0 ); 16 | 17 | struct SkyboxVS_Input 18 | { 19 | float4 Pos : POSITION; 20 | }; 21 | 22 | struct SkyboxVS_Output 23 | { 24 | float4 Pos : SV_POSITION; 25 | float3 Tex : TEXCOORD0; 26 | }; 27 | 28 | SkyboxVS_Output SkyboxVS( SkyboxVS_Input Input ) 29 | { 30 | SkyboxVS_Output Output; 31 | 32 | Output.Pos = Input.Pos; 33 | Output.Tex = normalize( mul(Input.Pos, g_mWorldViewProjection) ); 34 | 35 | return Output; 36 | } 37 | 38 | float4 SkyboxPS( SkyboxVS_Output Input ) : SV_TARGET 39 | { 40 | float4 color = g_EnvironmentTexture.Sample( g_sam, Input.Tex ); 41 | return color; 42 | } 43 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/OIT11/SceneVS.hlsl: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // File: SceneVS.hlsl 3 | // 4 | // Desc: Vertex shader for the scene. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | //----------------------------------------------------------------------------- 8 | 9 | 10 | cbuffer cbPerObject : register( b0 ) 11 | { 12 | row_major matrix g_mWorldViewProjection : packoffset( c0 ); 13 | } 14 | 15 | struct SceneVS_Input 16 | { 17 | float4 pos : POSITION; 18 | float4 color : COLOR; 19 | }; 20 | 21 | struct SceneVS_Output 22 | { 23 | float4 pos : SV_POSITION; 24 | float4 color : COLOR0; 25 | }; 26 | 27 | SceneVS_Output SceneVS( SceneVS_Input input ) 28 | { 29 | SceneVS_Output output; 30 | 31 | output.color = input.color; 32 | output.pos = mul(input.pos, g_mWorldViewProjection ); 33 | 34 | return output; 35 | } 36 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/Tutorials/Tutorial02/Tutorial02.fx: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: Tutorial02.fx 3 | // 4 | // Copyright (c) Microsoft Corporation. All rights reserved. 5 | //-------------------------------------------------------------------------------------- 6 | 7 | //-------------------------------------------------------------------------------------- 8 | // Vertex Shader 9 | //-------------------------------------------------------------------------------------- 10 | float4 VS( float4 Pos : POSITION ) : SV_POSITION 11 | { 12 | return Pos; 13 | } 14 | 15 | 16 | //-------------------------------------------------------------------------------------- 17 | // Pixel Shader 18 | //-------------------------------------------------------------------------------------- 19 | float4 PS( float4 Pos : SV_POSITION ) : SV_Target 20 | { 21 | return float4( 1.0f, 1.0f, 0.0f, 1.0f ); // Yellow, with Alpha = 1 22 | } 23 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/Tutorials/Tutorial03/Tutorial03.fx: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: Tutorial02.fx 3 | // 4 | // Copyright (c) Microsoft Corporation. All rights reserved. 5 | //-------------------------------------------------------------------------------------- 6 | 7 | //-------------------------------------------------------------------------------------- 8 | // Vertex Shader 9 | //-------------------------------------------------------------------------------------- 10 | float4 VS( float4 Pos : POSITION ) : SV_POSITION 11 | { 12 | return Pos; 13 | } 14 | 15 | 16 | //-------------------------------------------------------------------------------------- 17 | // Pixel Shader 18 | //-------------------------------------------------------------------------------------- 19 | float4 PS( float4 Pos : SV_POSITION ) : SV_Target 20 | { 21 | return float4( 1.0f, 1.0f, 0.0f, 1.0f ); // Yellow, with Alpha = 1 22 | } 23 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/Tutorials/Tutorial04/Tutorial04.fx: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: Tutorial04.fx 3 | // 4 | // Copyright (c) Microsoft Corporation. All rights reserved. 5 | //-------------------------------------------------------------------------------------- 6 | 7 | //-------------------------------------------------------------------------------------- 8 | // Constant Buffer Variables 9 | //-------------------------------------------------------------------------------------- 10 | cbuffer ConstantBuffer : register( b0 ) 11 | { 12 | matrix World; 13 | matrix View; 14 | matrix Projection; 15 | } 16 | 17 | //-------------------------------------------------------------------------------------- 18 | struct VS_OUTPUT 19 | { 20 | float4 Pos : SV_POSITION; 21 | float4 Color : COLOR0; 22 | }; 23 | 24 | //-------------------------------------------------------------------------------------- 25 | // Vertex Shader 26 | //-------------------------------------------------------------------------------------- 27 | VS_OUTPUT VS( float4 Pos : POSITION, float4 Color : COLOR ) 28 | { 29 | VS_OUTPUT output = (VS_OUTPUT)0; 30 | output.Pos = mul( Pos, World ); 31 | output.Pos = mul( output.Pos, View ); 32 | output.Pos = mul( output.Pos, Projection ); 33 | output.Color = Color; 34 | return output; 35 | } 36 | 37 | 38 | //-------------------------------------------------------------------------------------- 39 | // Pixel Shader 40 | //-------------------------------------------------------------------------------------- 41 | float4 PS( VS_OUTPUT input ) : SV_Target 42 | { 43 | return input.Color; 44 | } 45 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/Tutorials/Tutorial05/Tutorial05.fx: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: Tutorial05.fx 3 | // 4 | // Copyright (c) Microsoft Corporation. All rights reserved. 5 | //-------------------------------------------------------------------------------------- 6 | 7 | //-------------------------------------------------------------------------------------- 8 | // Constant Buffer Variables 9 | //-------------------------------------------------------------------------------------- 10 | cbuffer ConstantBuffer : register( b0 ) 11 | { 12 | matrix World; 13 | matrix View; 14 | matrix Projection; 15 | } 16 | 17 | //-------------------------------------------------------------------------------------- 18 | struct VS_INPUT 19 | { 20 | float4 Pos : POSITION; 21 | float4 Color : COLOR; 22 | }; 23 | 24 | struct PS_INPUT 25 | { 26 | float4 Pos : SV_POSITION; 27 | float4 Color : COLOR; 28 | }; 29 | 30 | 31 | //-------------------------------------------------------------------------------------- 32 | // Vertex Shader 33 | //-------------------------------------------------------------------------------------- 34 | PS_INPUT VS( VS_INPUT input ) 35 | { 36 | PS_INPUT output = (PS_INPUT)0; 37 | output.Pos = mul( input.Pos, World ); 38 | output.Pos = mul( output.Pos, View ); 39 | output.Pos = mul( output.Pos, Projection ); 40 | output.Color = input.Color; 41 | 42 | return output; 43 | } 44 | 45 | 46 | //-------------------------------------------------------------------------------------- 47 | // Pixel Shader 48 | //-------------------------------------------------------------------------------------- 49 | float4 PS( PS_INPUT input) : SV_Target 50 | { 51 | return input.Color; 52 | } 53 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D11/VarianceShadows11/RenderVarianceShadow.hlsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | //-------------------------------------------------------------------------------------- 5 | // Globals 6 | //-------------------------------------------------------------------------------------- 7 | cbuffer cbPerObject : register( b0 ) 8 | { 9 | matrix g_mWorldViewProjection : packoffset( c0 ); 10 | }; 11 | 12 | //-------------------------------------------------------------------------------------- 13 | // Input / Output structures 14 | //-------------------------------------------------------------------------------------- 15 | struct VS_INPUT 16 | { 17 | float4 vPosition : POSITION; 18 | }; 19 | 20 | struct VS_OUTPUT 21 | { 22 | float4 vPosition : SV_POSITION; 23 | }; 24 | 25 | //-------------------------------------------------------------------------------------- 26 | // Vertex Shader 27 | //-------------------------------------------------------------------------------------- 28 | VS_OUTPUT VSMain( VS_INPUT Input ) 29 | { 30 | VS_OUTPUT Output; 31 | 32 | 33 | Output.vPosition = mul( Input.vPosition, g_mWorldViewProjection ); 34 | 35 | return Output; 36 | } 37 | 38 | 39 | float2 PSMain (VS_OUTPUT Input) : SV_TARGET 40 | { 41 | float2 rt; 42 | rt.x = Input.vPosition.z; 43 | rt.y = rt.x * rt.x; 44 | return rt; 45 | } -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D1211On12/shaders.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct PSInput 13 | { 14 | float4 position : SV_POSITION; 15 | float4 color : COLOR; 16 | }; 17 | 18 | PSInput VSMain(float4 position : POSITION, float4 color : COLOR) 19 | { 20 | PSInput result; 21 | 22 | result.position = position; 23 | result.color = color; 24 | 25 | return result; 26 | } 27 | 28 | float4 PSMain(PSInput input) : SV_TARGET 29 | { 30 | return input.color; 31 | } 32 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12Bundles/shader_mesh_alt_pixel.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct PSInput 13 | { 14 | float4 position : SV_POSITION; 15 | float2 uv : TEXCOORD0; 16 | }; 17 | 18 | Texture2D g_txDiffuse : register(t0); 19 | SamplerState g_sampler : register(s0); 20 | 21 | float4 PSMain(PSInput input) : SV_TARGET 22 | { 23 | float3 color = g_txDiffuse.Sample(g_sampler, input.uv).rgb; 24 | 25 | // Reduce R and B contributions to the output color. 26 | float3 filter = float3(0.25f, 1.0f, 0.25f); 27 | 28 | return float4(color.xyz * filter, 1.0f); 29 | } 30 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12Bundles/shader_mesh_simple_pixel.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct PSInput 13 | { 14 | float4 position : SV_POSITION; 15 | float2 uv : TEXCOORD0; 16 | }; 17 | 18 | Texture2D g_txDiffuse : register(t0); 19 | SamplerState g_sampler : register(s0); 20 | 21 | float4 PSMain(PSInput input) : SV_TARGET 22 | { 23 | return g_txDiffuse.Sample(g_sampler, input.uv); 24 | } 25 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12Bundles/shader_mesh_simple_vert.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct VSInput 13 | { 14 | float3 position : POSITION; 15 | float3 normal : NORMAL; 16 | float2 uv : TEXCOORD0; 17 | float3 tangent : TANGENT; 18 | }; 19 | 20 | struct PSInput 21 | { 22 | float4 position : SV_POSITION; 23 | float2 uv : TEXCOORD0; 24 | }; 25 | 26 | cbuffer cb0 : register(b0) 27 | { 28 | float4x4 g_mWorldViewProj; 29 | }; 30 | 31 | PSInput VSMain(VSInput input) 32 | { 33 | PSInput result; 34 | 35 | result.position = mul(float4(input.position, 1.0f), g_mWorldViewProj); 36 | result.uv = input.uv; 37 | 38 | return result; 39 | } 40 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12DynamicIndexing/shader_mesh_dynamic_indexing_pixel.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct PSInput 13 | { 14 | float4 position : SV_POSITION; 15 | float2 uv : TEXCOORD0; 16 | }; 17 | 18 | struct MaterialConstants 19 | { 20 | uint matIndex; // Dynamically set index for looking up from g_txMats[]. 21 | }; 22 | 23 | ConstantBuffer materialConstants : register(b0, space0); 24 | Texture2D g_txDiffuse : register(t0); 25 | Texture2D g_txMats[] : register(t1); 26 | SamplerState g_sampler : register(s0); 27 | 28 | float4 PSMain(PSInput input) : SV_TARGET 29 | { 30 | float3 diffuse = g_txDiffuse.Sample(g_sampler, input.uv).rgb; 31 | float3 mat = g_txMats[materialConstants.matIndex].Sample(g_sampler, input.uv).rgb; 32 | return float4(diffuse * mat, 1.0f); 33 | } -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12DynamicIndexing/shader_mesh_simple_vert.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct VSInput 13 | { 14 | float3 position : POSITION; 15 | float3 normal : NORMAL; 16 | float2 uv : TEXCOORD0; 17 | float3 tangent : TANGENT; 18 | }; 19 | 20 | struct PSInput 21 | { 22 | float4 position : SV_POSITION; 23 | float2 uv : TEXCOORD0; 24 | }; 25 | 26 | cbuffer cb0 : register(b0) 27 | { 28 | float4x4 g_mWorldViewProj; 29 | }; 30 | 31 | PSInput VSMain(VSInput input) 32 | { 33 | PSInput result; 34 | 35 | result.position = mul(float4(input.position, 1.0f), g_mWorldViewProj); 36 | result.uv = input.uv; 37 | 38 | return result; 39 | } 40 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12ExecuteIndirect/shaders.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | cbuffer ConstantBuffer : register(b0) 13 | { 14 | float4 velocity; 15 | float4 offset; 16 | float4 color; 17 | float4x4 projection; 18 | }; 19 | 20 | struct PSInput 21 | { 22 | float4 position : SV_POSITION; 23 | float4 color : COLOR; 24 | }; 25 | 26 | PSInput VSMain(float4 position : POSITION) 27 | { 28 | PSInput result; 29 | 30 | result.position = mul(position + offset, projection); 31 | 32 | float intensity = saturate((4.0f - result.position.z) / 2.0f); 33 | result.color = float4(color.xyz * intensity, 1.0f); 34 | 35 | return result; 36 | } 37 | 38 | float4 PSMain(PSInput input) : SV_TARGET 39 | { 40 | return input.color; 41 | } 42 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12HelloWorld/HelloBundles/shaders.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct PSInput 13 | { 14 | float4 position : SV_POSITION; 15 | float4 color : COLOR; 16 | }; 17 | 18 | PSInput VSMain(float4 position : POSITION, float4 color : COLOR) 19 | { 20 | PSInput result; 21 | 22 | result.position = position; 23 | result.color = color; 24 | 25 | return result; 26 | } 27 | 28 | float4 PSMain(PSInput input) : SV_TARGET 29 | { 30 | return input.color; 31 | } 32 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12HelloWorld/HelloConstBuffers/shaders.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | cbuffer ConstantBuffer : register(b0) 13 | { 14 | float4 offset; 15 | }; 16 | 17 | struct PSInput 18 | { 19 | float4 position : SV_POSITION; 20 | float4 color : COLOR; 21 | }; 22 | 23 | PSInput VSMain(float4 position : POSITION, float4 color : COLOR) 24 | { 25 | PSInput result; 26 | 27 | result.position = position + offset; 28 | result.color = color; 29 | 30 | return result; 31 | } 32 | 33 | float4 PSMain(PSInput input) : SV_TARGET 34 | { 35 | return input.color; 36 | } 37 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12HelloWorld/HelloTriangle/shaders.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct PSInput 13 | { 14 | float4 position : SV_POSITION; 15 | float4 color : COLOR; 16 | }; 17 | 18 | PSInput VSMain(float4 position : POSITION, float4 color : COLOR) 19 | { 20 | PSInput result; 21 | 22 | result.position = position; 23 | result.color = color; 24 | 25 | return result; 26 | } 27 | 28 | float4 PSMain(PSInput input) : SV_TARGET 29 | { 30 | return input.color; 31 | } 32 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/BlitPixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "QuadVertexShader.hlsl" 13 | 14 | float4 Blit(float2 uv) 15 | { 16 | return g_tex.Sample(g_samp, uv); 17 | } 18 | 19 | float4 mainBlit(PSInput input) : SV_TARGET 20 | { 21 | return Blit(input.uv); 22 | } 23 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/DistortPixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "QuadVertexShader.hlsl" 13 | 14 | float4 Distort(float2 uv) 15 | { 16 | // Calculate the distance of this pixel from the center. 17 | float pixelDistance = distance(float2(0.5f, 0.5f), uv); 18 | 19 | // Weight the pixel by its distance. 20 | float weight = 1.0f + pixelDistance; 21 | 22 | float x = (uv.x - 0.5f) + 0.5f; 23 | float y = (uv.y - 0.5f) + 0.5f; 24 | 25 | x = pow(abs(x), weight); 26 | y = pow(abs(y), weight); 27 | 28 | return g_tex.Sample(g_samp, float2(x, y)); 29 | } 30 | 31 | float4 mainDistort(PSInput input) : SV_TARGET 32 | { 33 | return Distort(input.uv); 34 | } 35 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/GrayScalePixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "QuadVertexShader.hlsl" 13 | 14 | float4 GrayScale(float2 uv) 15 | { 16 | float3 luminance = float3(0.21f, 0.72f, 0.07f); 17 | float3 color = g_tex.Sample(g_samp, uv).xyz; 18 | float output = dot(luminance, color); 19 | 20 | return float4(output, output, output, 1.0f); 21 | } 22 | 23 | float4 mainGray(PSInput input) : SV_TARGET 24 | { 25 | return GrayScale(input.uv); 26 | } 27 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/InvertPixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "QuadVertexShader.hlsl" 13 | 14 | float4 InvertPixel(float2 uv) 15 | { 16 | return float4(1.0f, 1.0f, 1.0f, 1.0f) - g_tex.Sample(g_samp, uv); 17 | } 18 | 19 | float4 mainInvert(PSInput input) : SV_TARGET 20 | { 21 | return InvertPixel(input.uv); 22 | } 23 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/PixelatePixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "QuadVertexShader.hlsl" 13 | 14 | float4 Pixelate(float2 uv) 15 | { 16 | uint2 var = uint2(uv.x * 100, uv.y * 100); 17 | uv = float2((float)var.x / 100, (float)var.y / 100); 18 | 19 | return g_tex.Sample(g_samp, uv); 20 | } 21 | 22 | float4 mainPixel(PSInput input) : SV_TARGET 23 | { 24 | return Pixelate(input.uv); 25 | } 26 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/QuadVertexShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #ifndef VS 13 | #define VS 14 | 15 | struct VSInput 16 | { 17 | float4 position : POSITION; 18 | float2 uv : TEXCOORD; 19 | }; 20 | 21 | struct PSInput 22 | { 23 | float4 position : SV_POSITION; 24 | float2 uv : TEXCOORD; 25 | }; 26 | 27 | Texture2D g_tex : register(t0); 28 | SamplerState g_samp : register(s0); 29 | 30 | PSInput mainQuad(VSInput input) 31 | { 32 | PSInput result; 33 | result.position = input.position; 34 | result.uv = input.uv; 35 | 36 | return result; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/SimplePixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "SimpleVertexShader.hlsl" 13 | 14 | float4 main(PSInput input) : SV_TARGET 15 | { 16 | return float4(input.color, 1.0f); 17 | } 18 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/SimpleVertexShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | struct VSInput 13 | { 14 | float4 position : POSITION; 15 | float3 color : COLOR; 16 | }; 17 | 18 | struct PSInput 19 | { 20 | float4 position : SV_POSITION; 21 | float3 color : COLOR; 22 | }; 23 | 24 | cbuffer PerDraw : register(b1) 25 | { 26 | float4x4 worldViewProjection; 27 | }; 28 | 29 | PSInput main(VSInput input) 30 | { 31 | PSInput result; 32 | 33 | result.position = mul(input.position, worldViewProjection); 34 | result.color = input.color; 35 | 36 | return result; 37 | } 38 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/WarpPixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "QuadVertexShader.hlsl" 13 | 14 | float4 Warp(float2 uv) 15 | { 16 | float2 dir = uv - float2(0.5f, 0.5f); 17 | float len = length(dir) * 6.0f; 18 | float2 newCoord = uv + dir * sin(pow(2.0f, len)); 19 | 20 | return g_tex.Sample(g_samp, newCoord); 21 | } 22 | 23 | float4 mainWarp(PSInput input) : SV_TARGET 24 | { 25 | return Warp(input.uv); 26 | } 27 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PipelineStateCache/WavePixelShader.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | #include "QuadVertexShader.hlsl" 13 | 14 | float4 Wave(float2 uv) 15 | { 16 | float angle = distance(float2(0.5f, 0.5f), uv) * 50.0f; 17 | uv.x = 0.5f + (uv.x - 0.5f) * cos(angle) - (uv.y - 0.5f) * sin(angle); 18 | uv.y = 0.5f + (uv.x - 0.5f) * sin(angle) + (uv.y - 0.5f) * cos(angle); 19 | 20 | return g_tex.Sample(g_samp, uv); 21 | } 22 | 23 | float4 mainWave(PSInput input) : SV_TARGET 24 | { 25 | return Wave(input.uv); 26 | } 27 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/Direct3D12/D3D12PredicationQueries/shaders.hlsl: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | cbuffer ConstantBuffer : register(b0) 13 | { 14 | float4 offset; 15 | }; 16 | 17 | struct PSInput 18 | { 19 | float4 position : SV_POSITION; 20 | float4 color : COLOR; 21 | }; 22 | 23 | PSInput VSMain(float4 position : POSITION, float4 color : COLOR) 24 | { 25 | PSInput result; 26 | 27 | result.position = position + offset; 28 | result.color = color; 29 | 30 | return result; 31 | } 32 | 33 | float4 PSMain(PSInput input) : SV_TARGET 34 | { 35 | return input.color; 36 | } 37 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/DirectX SDK EULA.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pema99/UnityShaderParser/a9ba792d8ae68c8b0a00a554fbec10d893654eca/UnityShaderParser.Tests/TestShaders/Sdk/DirectX SDK EULA.txt -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/Sdk/readme.txt: -------------------------------------------------------------------------------- 1 | From DirectX SDK (June 2010) Samples -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | 10 | // 2 threads for z because we parralelize the algorithm on the z 11 | [numthreads(8,8,2)] 12 | void CreateFoveatedShadingRateTexture(uint3 id : SV_DispatchThreadID) 13 | { 14 | _Result[id] = GetShadingRateLevel(id); 15 | } 16 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | 10 | // 1 thread for z because we run both eyes and then combine them with a min operator 11 | [numthreads(8,8,1)] 12 | void CreateFoveatedShadingRateTexture(uint3 id : SV_DispatchThreadID) 13 | { 14 | uint leftShadingRateLevel = GetShadingRateLevel(uint3(id.xy, kLeftEyeId)); 15 | uint rightShadingRateLevel = GetShadingRateLevel(uint3(id.xy, kRightEyeId)); 16 | _Result[uint2(id.x, id.y)] = min(rightShadingRateLevel, leftShadingRateLevel); 17 | } 18 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | Fallback Off 44 | } 45 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | fixed4 color : COLOR; 21 | }; 22 | 23 | v2f_surf vert_surf (appdata_full v) 24 | { 25 | v2f_surf o; 26 | o.pos = UnityObjectToClipPos(v.vertex); 27 | o.color = v.color; 28 | return o; 29 | } 30 | 31 | float4 frag_surf (v2f_surf IN) : SV_Target 32 | { 33 | return IN.color; 34 | } 35 | ENDCG 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/TestShaders/UnityBuiltinShaders/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 | -------------------------------------------------------------------------------- /UnityShaderParser.Tests/UnityShaderParser.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | PreserveNewest 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /UnityShaderParser/UnityShaderParser.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Library 5 | netstandard2.0 6 | disable 7 | disable 8 | 7.3 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | --------------------------------------------------------------------------------