Imposter_Opaque.shader 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /************************************************************************************
  2. Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
  3. Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
  4. https://developer.oculus.com/licenses/oculussdk/
  5. Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
  6. under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
  7. ANY KIND, either express or implied. See the License for the specific language governing
  8. permissions and limitations under the License.
  9. ************************************************************************************/
  10. Shader "Hidden/Imposter_Opaque" {
  11. Properties {
  12. _MainTex ("Texture", 2D) = "white" {}
  13. }
  14. SubShader {
  15. Tags {"Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque"}
  16. LOD 100
  17. Blend One Zero
  18. Pass {
  19. CGPROGRAM
  20. #pragma vertex vert
  21. #pragma fragment frag
  22. #include "UnityCG.cginc"
  23. struct appdata {
  24. float4 vertex : POSITION;
  25. float2 uv : TEXCOORD0;
  26. UNITY_VERTEX_INPUT_INSTANCE_ID
  27. };
  28. struct v2f {
  29. float2 uv : TEXCOORD0;
  30. float4 vertex : SV_POSITION;
  31. UNITY_VERTEX_OUTPUT_STEREO
  32. };
  33. sampler2D _MainTex;
  34. float4 _MainTex_ST;
  35. v2f vert (appdata v) {
  36. v2f o;
  37. UNITY_SETUP_INSTANCE_ID(v);
  38. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  39. o.vertex = UnityObjectToClipPos(v.vertex);
  40. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  41. return o;
  42. }
  43. fixed4 frag(v2f i) : SV_Target {
  44. return tex2D(_MainTex, i.uv);
  45. }
  46. ENDCG
  47. }
  48. }
  49. }