当前位置:网站首页>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
}
}
}边栏推荐
- 记录小知识点
- CTF_ Web: Advanced questions of attack and defense world expert zone WP (1-4)
- GBase 8s的封锁技术的基本介绍
- Laravel document sorting 4. Controller
- How to draw an industry investment map
- Shutter fittedbox component
- unity Quad剔除背面并剔除透明部分的shader
- PostgreSQL数据库WAL——RM_HEAP_ID日志记录动作
- 地方/園區產業規劃之 “ 如何進行產業定比特 ”
- GBASE 8s的隔离级别介绍
猜你喜欢

Lecture record: history and development of strapdown inertial navigation solution

A detailed summary of TCP connection triple handshake

Basic use of OBS browser+ browser

Coinlist queuing tutorial to improve the winning rate

unity Quad剔除背面并剔除透明部分的shader

CTF_ Web: Advanced questions of attack and defense world expert zone WP (15-18)

How to draw an industry investment map

无法安装redis接口

Text keyword extraction: ansj

关于TCP连接三次握手的详细总结
随机推荐
2020.3.3 notes async/await and promise and Then processes and threads
微信小程序父子组件之间传值
navicat可不可以直接操作安卓数据库SQLite
"Comment positionner l'industrie" dans la planification industrielle locale / parc
Introduction to intstream API
Shutter fittedbox component
Numpy NP tips: use OpenCV to interpolate and zoom the array to a fixed shape cv2 resize(res, dsize=(64, 64), interpolation=cv2. INTER_ CUBIC)
ThinkPHP is integrated with esaywechat. What's wrong with wechat payment callback without callback?
什么是数据持久化?
EasyRecovery15非常好用的电脑数据恢复软件
A detailed summary of TCP connection triple handshake
kenlm
JS arrow function
1. Phase II of the project - user registration and login
【LeetCode】22. bracket-generating
GBASE 8s的触发器
Doubts about judging the tinyint field type of MySQL
GBASE 8s的并行操作问题场景描述
SQL injection details
Sourcetree pulls the code and prompts to fill in authentic, but the configuration cannot change the user