当前位置:网站首页>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!
- 【OA】Excel 文档生成器: Openpyxl 模块
- . Net interface can be implemented by default
- ggplot 分面的细节调整汇总
- Redis source code learning (31), dictionary learning, dict.c (1)
- Implementation of map and set
- 数据的存储
- Kalman filter-1
- Quick completion guide of manipulator (10): accessible workspace
- Hisilicon 3559 universal platform construction: RTSP real-time playback support
猜你喜欢
opencv第三方库
When QT uses qtooltip mouse to display text, the picture of the button will also be displayed and the prompt text style will be modified
自适应非欧表征广告检索系统AMCAD
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
Antd Comment 递归循环评论
【系统管理】清理任务栏的已删除程序的图标缓存
Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements
It's too convenient. You can complete the code release and approval by nailing it!
Docker部署Mysql8的实现步骤
Hisilicon 3559 universal platform construction: RTSP real-time playback support
随机推荐
Implementation of map and set
Learn how to use js to merge two objects into one object assign()
How to detect whether the MySQL code runs deadlock +binlog view
UltraEdit-32 温馨提示:右协会,取消 bak文件[通俗易懂]
如何编写一个程序猿另一个面试官眼前一亮的简历[通俗易懂]
Analysis on the thinking of college mathematical modeling competition and curriculum education of the 2022a question of the China Youth Cup
[MySQL] row sorting in MySQL
学习使用js把两个对象合并成一个对象的方法Object.assign()
力扣------路径总和 III
Force buckle ----- path sum III
[leetcode]Spiral Matrix II
使用 TiDB Lightning 恢复 GCS 上的备份数据
2022电工杯A题高比例风电电力系统储能运行及配置分析思路
史上最全MongoDB之部署篇
Antd comment recursive loop comment
MySQL data loss, analyze binlog log file
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
超越Postman,新一代国产调试工具Apifox,用起来够优雅
Operational amplifier application summary 1
Storage of data