当前位置:网站首页>卡通shader
卡通shader
2022-06-25 22:42:00 【KillJUMP】
Shader "Killian/ToonShader"
{
Properties
{
_Albedo("Albedo",Color) = (1,1,1,1)
_Shaders("Shades",Range(1,20)) = 3
_InkColor("InkColor",Color)=(0,0,0,0)
_InkSize("InkSize",float)=1.0
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
Cull Front
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float3 normal:NORMAL;
};
struct v2f
{
float4 vertex : SV_POSITION;
};
float4 _InkColor;
float _InkSize;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex+ _InkSize*v.normal);
return o;
}
fixed4 frag(v2f i) : SV_Target
{
return _InkColor;
}
ENDCG
}
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float3 normal:NORMAL;
};
struct v2f
{
float4 vertex : SV_POSITION;
float3 worldNormal:TEXCOORD0;
};
float4 _Albedo;
float _Shaders;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.worldNormal = UnityObjectToWorldNormal(v.normal);
return o;
}
fixed4 frag(v2f i) : SV_Target
{
float cosineAngle = dot(normalize(i.worldNormal),normalize(_WorldSpaceLightPos0.xyz));
cosineAngle = max(cosineAngle, 0.0);
cosineAngle = floor(cosineAngle * _Shaders )/ _Shaders;
return _Albedo * cosineAngle;
}
ENDCG
}
}
}
边栏推荐
- Atlas200dk刷机
- 基于OpenVINOTM开发套件“无缝”部署PaddleNLP模型
- Solution to component stele in SMT chip processing
- Types of feeder and how to work
- C IO stream (I) basic concept_ Basic definition
- Is camkiia the same as gcamp6f?
- Installation and configuration of gradle environment
- After being trapped by the sequelae of the new crown for 15 months, Stanford Xueba was forced to miss the graduation ceremony. Now he still needs to stay in bed for 16 hours every day: I should have e
- Precautions for cleaning PCBA board in SMT chip processing
- Core ideas of SQL optimization
猜你喜欢
![Chapter V exercises (124, 678, 15, 19, 22) [microcomputer principles] [exercises]](/img/16/d67f38d32af6904a7d0be9f2e5be70.png)
Chapter V exercises (124, 678, 15, 19, 22) [microcomputer principles] [exercises]

渗透工具-Burpsuite

【图像检测】基于高斯过程和Radon变换实现血管跟踪和直径估计附matlab代码

leetcode. 14 --- longest public prefix

Analyze the five root causes of product development failure

元宇宙中的法律与自我监管

Regular expression introduction and some syntax

How to deliver a shelter hospital within 48 hours?

Why is it best to use equals for integer comparisons

CaMKIIa和GCaMP6f是一樣的嘛?
随机推荐
Ssl/tls, symmetric and asymmetric encryption, and tlsv1.3
Cloud rendering and Intel jointly create the "core" era of cloud rendering
性能领跑云原生数据库市场!英特尔携腾讯共建云上技术生态
Explanation of chip processing manufacturer__ What is ICT? What is the main test? Advantages and disadvantages of ICT testing?
mysql
How product managers control the progress of product development
Core ideas of SQL optimization
Circuit board edge removal - precautions for V-CUT splitting machine
Things / phenomena / things / things / situations / appearances
Preorder and middle order traversal of forest
1-11solutions to common problems of VMware virtual machine
Drag the mouse to rotate the display around an object
Permission design = function permission + Data permission
STL tutorial 5-basic concepts of STL and the use of string and vector
The development context of Ba Kong Yuan universe industry
使用VS2022编译Telegram桌面端(tdesktop)
Web学习之TypeScript
Why is it best to use equals for integer comparisons
Regular expression introduction and some syntax
Data synchronization