当前位置:网站首页>Unity3d can change colors and display samples in a building GL material
Unity3d can change colors and display samples in a building GL material
2022-07-07 04:07:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack , I've prepared for you today Idea Registration code .
void CreateLineMaterial() { if (!mat) { mat = new Material(“Shader \”Lines/Colored Blended\” {” + “SubShader { Pass { ” + ” Blend SrcAlpha OneMinusSrcAlpha ” + ” ZWrite Off Cull Off Fog { Mode Off } ” + ” BindChannels {” + ” Bind \”vertex\”, vertex Bind \”color\”, color }” + “} } }”); mat.hideFlags = HideFlags.HideAndDontSave; mat.shader.hideFlags = HideFlags.HideAndDontSave; } }
void OnPostRender() { if (!mat) { CreateLineMaterial(); return; } GL.PushMatrix(); mat.SetPass(0); GL.LoadOrtho(); GL.Begin(GL.QUADS); GL.Color(Color.red); GL.Vertex3(0, 0.5F, 0); GL.Vertex3(0.5F, 1, 0); GL.Vertex3(1, 0.5F, 0); GL.Vertex3(0.5F, 0, 0); GL.Color(Color.cyan); GL.Vertex3(0, 0, 0); GL.Vertex3(0, 0.25F, 0); GL.Vertex3(0.25F, 0.25F, 0); GL.Vertex3(0.25F, 0, 0); GL.End(); GL.PopMatrix(); }
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116697.html Link to the original text :https://javaforall.cn
边栏推荐
- It's too convenient. You can complete the code release and approval by nailing it!
- 2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析
- 二进制、八进制、十六进制
- ggplot 分面的细节调整汇总
- The first introduction of the most complete mongodb in history
- 【写给初发论文的人】撰写综述性科技论文常见问题
- 史上最全MongoDB之安全认证
- Enter the rough outline of the URL question (continuously updated)
- 用头像模仿天狗食月
- Binary, octal, hexadecimal
猜你喜欢

map和set的实现

史上最全学习率调整策略lr_scheduler

如何检测mysql代码运行是否出现死锁+binlog查看

It's too convenient. You can complete the code release and approval by nailing it!

Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements

The most complete security certification of mongodb in history

用头像模仿天狗食月
![[MySQL] row sorting in MySQL](/img/97/8a451fa62796838e11242c86eecd8d.png)
[MySQL] row sorting in MySQL

What is the experience of maintaining Wanxing open source vector database

ABAP 動態內錶分組循環
随机推荐
使用切面实现记录操作日志
红米k40s root玩机笔记
[MySQL] row sorting in MySQL
OSCP工具之一: dirsearch用法大全
再AD 的 界面顶部(菜单栏)创建常用的快捷图标
[development software] tilipa Developer Software
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
Force buckle ----- path sum III
Arduino droplet detection
List interview common questions
Kotlin Android 环境搭建
Preprocessing - interpolation
2022电工杯A题高比例风电电力系统储能运行及配置分析思路
数据的存储
Kalman filter-1
Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements
学习使用js把两个对象合并成一个对象的方法Object.assign()
使用 TiDB Lightning 恢复 GCS 上的备份数据
ABAP 动态内表分组循环
见到小叶栀子