当前位置:网站首页>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
边栏推荐
猜你喜欢
tflite模型转换和量化
机器人(自动化)课程的持续学习-2022-
运算放大器应用汇总1
Force buckle ----- path sum III
opencv第三方库
Redis configuration and optimization of NoSQL
Implementation of map and set
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
自适应非欧表征广告检索系统AMCAD
Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements
随机推荐
【系统管理】清理任务栏的已删除程序的图标缓存
Collection of idea gradle Lombok errors
一些常用软件相关
Redis source code learning (31), dictionary learning, dict.c (1)
termux设置电脑连接手机。(敲打命令贼快),手机termux端口8022
How to manage the expiration of enterprise distribution certificates- How to manage Enterprise Distribution certificate expiration?
使用 TiDB Lightning 恢复 GCS 上的备份数据
Ggplot facet detail adjustment summary
PHP 实现根据概率抽奖
The true face of function pointer in single chip microcomputer and the operation of callback function
Native MySQL
How to detect whether the MySQL code runs deadlock +binlog view
What is the experience of maintaining Wanxing open source vector database
Redis源码学习(31),字典学习,dict.c(一)
Implementation steps of docker deploying mysql8
【mysql】mysql中行排序
ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly
Implementation of map and set
PHP implements lottery according to probability
Index of MySQL