当前位置:网站首页>Unity Quad culls shaders with back faces and transparent parts
Unity Quad culls shaders with back faces and transparent parts
2022-06-25 04:31:00 【Shallow Street SSS】
First create a ImageEffectShader,

Once you've created it , The part of the change element
Change it to this way 
You can cut out the transparent part of the picture
Because I need its depth to write , So I turned on depth writing , If there is no such need, you can put ZWrite Change it to Off
Shader "Custom/NewImageEffectShader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
// No culling or depth
Cull Back ZWrite On ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
clip(col.a - 0.5);
return col;
}
ENDCG
}
}
}边栏推荐
- Coinlist queuing tutorial to improve the winning rate
- How to install opencv? Opencv download installation tutorial
- 515. 在每个树行中找最大值 / 剑指 Offer II 095. 最长公共子序列
- 地方/園區產業規劃之 “ 如何進行產業定比特 ”
- "Comment positionner l'industrie" dans la planification industrielle locale / parc
- GBASE 8S内存管理
- Zoran community
- SQL, CTE, flg case problems
- GBase 8s的封锁技术的基本介绍
- GBASE 8s的并行操作问题场景描述
猜你喜欢

Finereport (sail soft) handling the problem that the histogram data label is blocked

How many images can opencv open?

论文阅读《LSD-SLAM: Large-Scale Direct Monocular SLAM》

How to install opencv? Opencv download installation tutorial

微信小程序父子组件之间传值

1280_C语言求两个无符号整形的平均值

讲座记录《多种空间大地测量技术的数据处理方法和应用》

【openwrt】推荐一个国内开发的openwrt的版本,iStoreOS简介,非常好用,主要是做了一些优化。解决了汉化的问题。

Coinlist how to operate the middle lot number security tutorial

Read lsd-slam: large scale direct monolithic slam
随机推荐
Where is the red area of OpenCV?
Thorough understanding of database transactions
General steps for QT compiling database plug-ins
Laravel document sorting 4. Controller
5 key indicators of SEO: ranking + traffic + session + length of stay + bounce rate
CTF_ Web:8-bit controllable character getshell
GBASE 8s 索引R树
【esp32学习之路6——flash加密】
How many images can opencv open?
php封装curl发送get、post请求方法,并使用
Coinlist how to operate the middle lot number security tutorial
Laravel document sorting 8. Middleware
MySQL order by
"Renaissance" in the digital age? The bottom digital collection makes people happy and sad
讲座记录《捷联惯导解算的历史及发展》
Nodejs 通过Heidisql连接mysql出现ER_BAD_DB_ERROR: Unknown database 'my_db_books'
1. Phase II of the project - user registration and login
CTF_ Web: how to recognize and evaluate a regular expression
i. Max development board learning record
What is data persistence?