欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C#教程

當(dāng)前位置:主頁 > 軟件編程 > C#教程 >

Unity3D Shader實(shí)現(xiàn)掃描顯示效果(2)

來源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:C#教程|點(diǎn)擊: 次

上一篇使用的方式是對(duì)UV進(jìn)行剪裁,如果用于模型的話,會(huì)出現(xiàn)一些問題。本篇使用的方式是對(duì)模型進(jìn)行模型空間的剪裁,可設(shè)置剪裁方向。效果如下:

設(shè)置界面如下:

mode用于設(shè)置剪裁方向。
clip用于設(shè)置剪裁值。

shader實(shí)現(xiàn)如下:

Shader "XM/ScanEffect2" 
{
 Properties {
  _Color ("Color", Color) = (1,1,1,1)
  _MainTex ("Albedo (RGB)", 2D) = "white" {}
  _Glossiness ("Smoothness", Range(0,1)) = 0.5
  _Metallic ("Metallic", Range(0,1)) = 0.0
  _Clip("Clip", float) = 0
  [KeywordEnum(None, Left, Up, Forward)]_Mode("Mode", Float) = 0
 }
 SubShader {
  Tags { "RenderType"="Opaque" }
  LOD 200

  CGPROGRAM
  // Physically based Standard lighting model, and enable shadows on all light types
  #pragma surface surf Standard fullforwardshadows vertex:vert

  // Use shader model 3.0 target, to get nicer looking lighting
  #pragma target 3.0

  sampler2D _MainTex;

  struct Input {
   float2 uv_MainTex;
   float4 localPos;
  };

  half _Glossiness;
  half _Metallic;
  fixed4 _Color;
  float _Clip;
  float _Mode;

  void vert(inout appdata_full i, out Input o)
  {
   UNITY_INITIALIZE_OUTPUT(Input, o);
   o.localPos = i.vertex;
  }

  void surf (Input i, inout SurfaceOutputStandard o) {

   if(i.localPos.x >= _Clip && _Mode == 1 || i.localPos.y >= _Clip && _Mode == 2|| i.localPos.z >= _Clip && _Mode == 3)
   {
    clip(-1);
   }

   // Albedo comes from a texture tinted by color
   fixed4 c = tex2D (_MainTex, i.uv_MainTex) * _Color;
   o.Albedo = c.rgb;
   // Metallic and smoothness come from slider variables
   o.Metallic = _Metallic;
   o.Smoothness = _Glossiness;
   o.Alpha = c.a;
  }
  ENDCG
 }
 FallBack "Diffuse"
}


以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持我們。

上一篇:Unity UGUI實(shí)現(xiàn)卡片橢圓方向滾動(dòng)

欄    目:C#教程

下一篇:Unity3D使用右鍵菜單打開工程

本文標(biāo)題:Unity3D Shader實(shí)現(xiàn)掃描顯示效果(2)

本文地址:http://mengdiqiu.com.cn/a1/C_jiaocheng/4844.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有