Création d'un petit party-game anonyme de Build + Bagar sous Unity
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

standardSurfaceShader.shader 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Shader "Custom/standardSurfaceShader"
  2. {
  3. Properties
  4. {
  5. _Color ("Color", Color) = (1,1,1,1)
  6. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  7. _Glossiness ("Smoothness", Range(0,1)) = 0.5
  8. _Metallic ("Metallic", Range(0,1)) = 0.0
  9. }
  10. SubShader
  11. {
  12. Tags { "RenderType"="Opaque" }
  13. LOD 200
  14. CGPROGRAM
  15. // Physically based Standard lighting model, and enable shadows on all light types
  16. #pragma surface surf Standard fullforwardshadows
  17. // Use shader model 3.0 target, to get nicer looking lighting
  18. #pragma target 3.0
  19. sampler2D _MainTex;
  20. struct Input
  21. {
  22. float2 uv_MainTex;
  23. };
  24. half _Glossiness;
  25. half _Metallic;
  26. fixed4 _Color;
  27. // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
  28. // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
  29. // #pragma instancing_options assumeuniformscaling
  30. UNITY_INSTANCING_BUFFER_START(Props)
  31. // put more per-instance properties here
  32. UNITY_INSTANCING_BUFFER_END(Props)
  33. void surf (Input IN, inout SurfaceOutputStandard o)
  34. {
  35. // Albedo comes from a texture tinted by color
  36. fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
  37. o.Albedo = c.rgb;
  38. // Metallic and smoothness come from slider variables
  39. o.Metallic = _Metallic;
  40. o.Smoothness = _Glossiness;
  41. o.Alpha = c.a;
  42. }
  43. ENDCG
  44. }
  45. FallBack "Diffuse"
  46. }