Unity_Shader_卡通动画效果

原文地址:https://blog.csdn.net/weixin_42825810/article/details/102750390

 

本人翻译修改过的代码:

Shader "Unlit/ToonLearn"
{
	Properties
	{
		_MainTex ("我是贴图鸭", 2D) = "white" {}
		_RampThreshold("斜面值鸭",Range(0,1))=0.5
		_RampSmooth("平滑度鸭",Range(0,1))=0.1

		_Color("我是颜色鸭",Color)=(1,1,1,1)
		_HColor ("Highlight Color鸭", Color) = (0.8, 0.8, 0.8, 1.0)
        _SColor ("阴影颜色鸭", Color) = (0.2, 0.2, 0.2, 1.0)

        _SpecularColor ("高光颜色鸭", Color) = (0.5, 0.5, 0.5, 1)
        _SpecThreshold ("高光大小鸭", Range(0, 1)) = 0.5
        _SpecSmooth ("高光平滑度鸭", Range(0, 1)) = 0.1
        _Shininess ("高光亮度鸭", Range(0.001, 10)) = 0.2

        _RimColor ("边缘光颜色鸭", Color) = (0.8, 0.8, 0.8, 0.6)
        _RimThreshold ("边缘光强度鸭", Range(0, 1)) = 0.5
        _RimSmooth ("边缘光滑度鸭", Range(0, 1)) = 0.1
	}
	SubShader
	{
		Tags { "RenderType"="Opaque" }
		LOD 100

		Pass
		{
			Tags {"LightMode"="ForwardBase"}

			CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag
			
			#include "UnityCG.cginc"
			#include "Lighting.cginc"

			struct appdata
			{
				float4 vertex : POSITION;
				float2 uv : TEXCOORD0;
				float3 normal:NORMAL;
			};

			struct v2f
			{
				float2 uv : TEXCOORD0;
				float4 vertex : SV_POSITION;
				float3 normal:TEXCOORD1;
			};

			sampler2D _MainTex;
			float4 _MainTex_ST;
			float4 _Color;
			float4 _SColor;
			float4 _HColor;
			float _RampThreshold;
			float _RampSmooth;

			float4 _SpecularColor;
			float _SpecThreshold;
			float _SpecSmooth;
			float _Shininess;

			float4 _RimColor;
			fl
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值