amiga.template 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Shader "BabylonJS/NewShaderProgram" {
  2. Properties {
  3. _Color ("Color", Color) = (1,1,1,1)
  4. _Brightness ("Intensity", Range(1.0, 10.0)) = 1.0
  5. [NoScaleOffset] _MainTex ("Albedo (RGB)", 2D) = "white" {}
  6. [ToggleOff] _BackFaceCulling ("Back Face Culling", Int) = 1
  7. [ToggleOff] _NeedsAlphaTesting ("Needs Alpha Testing", Int) = 0
  8. [ToggleOff] _NeedsAlphaBlending ("Needs Alpha Blending", Int) = 0
  9. [Enum(Disable,0,Additive,1,Combine,2,Subtract,3,Multiply,4,Maximized,5,OneOne,6)] _AlphaMode ("Alpha Blending Mode", int) = 2
  10. }
  11. SubShader {
  12. Tags { "RenderType"="Opaque" }
  13. LOD 100
  14. Pass {
  15. CGPROGRAM
  16. //////////////////////////////////////////////////////////
  17. // BABYLON WEBGL RUNTIME SHADER PROGRAM SECTIONS (GLSL) //
  18. //////////////////////////////////////////////////////////
  19. #ifdef BABYLON
  20. attributes: "position, normal, uv"
  21. uniforms: "worldViewProjection, _Color, _Brightness"
  22. samplers: ""
  23. defines: ""
  24. #endif //BABYLON-END
  25. #ifdef VERTEX
  26. attribute vec3 position;
  27. attribute vec3 normal;
  28. attribute vec2 uv;
  29. uniform mat4 worldViewProjection;
  30. precision highp float;
  31. varying vec2 vUV;
  32. void main(void)
  33. {
  34. gl_Position = worldViewProjection * vec4(position, 1.0);
  35. vUV = uv;
  36. }
  37. #endif //VERTEX-END
  38. #ifdef FRAGMENT
  39. precision highp float;
  40. varying vec2 vUV;
  41. uniform vec4 _Color;
  42. uniform float _Brightness;
  43. uniform sampler2D _MainTex;
  44. void main(void)
  45. {
  46. // Texture Sample (Unlit)
  47. gl_FragColor = texture2D(_MainTex, vUV) * _Color * _Brightness;
  48. }
  49. #endif //FRAGMENT-END
  50. ////////////////////////////////////////////////////////
  51. // DEFAULT UNITY EDITOR SHADER PROGRAM SECTION (HLSL) //
  52. ////////////////////////////////////////////////////////
  53. #pragma vertex vert
  54. #pragma fragment frag
  55. #include "UnityCG.cginc"
  56. struct appdata
  57. {
  58. float4 vertex : POSITION;
  59. float2 uv : TEXCOORD0;
  60. };
  61. struct v2f
  62. {
  63. float2 uv : TEXCOORD0;
  64. float4 vertex : SV_POSITION;
  65. };
  66. float4 _Color;
  67. float _Brightness;
  68. sampler2D _MainTex;
  69. float4 _MainTex_ST;
  70. v2f vert (appdata v)
  71. {
  72. v2f o;
  73. o.vertex = UnityObjectToClipPos(v.vertex);
  74. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  75. return o;
  76. }
  77. fixed4 frag (v2f i) : SV_Target
  78. {
  79. // Texture Sample (Unlit)
  80. return tex2D(_MainTex, i.uv) * _Color * _Brightness;
  81. }
  82. ENDCG
  83. }
  84. }
  85. FallBack "Unlit/Texture"
  86. }