当前位置:网站首页>Unity3D在一建筑GL材料可以改变颜色和显示样本
Unity3D在一建筑GL材料可以改变颜色和显示样本
2022-07-06 21:26:00 【全栈程序员站长】
大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。
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(); }
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/116697.html原文链接:https://javaforall.cn
边栏推荐
猜你喜欢
Restcloud ETL Community Edition June featured Q & A
VHDL implementation of arbitrary size matrix addition operation
What is the experience of maintaining Wanxing open source vector database
[leetcode] 700 and 701 (search and insert of binary search tree)
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
[hcie TAC] question 3
接口数据安全保证的10种方式
On file uploading of network security
ABAP 動態內錶分組循環
一些常用软件相关
随机推荐
使用 Dumpling 备份 TiDB 集群数据到 GCS
Docker部署Mysql8的实现步骤
我的勇敢对线之路--详细阐述,浏览器输入URL发生了什么
The true face of function pointer in single chip microcomputer and the operation of callback function
二叉搜索树的实现
使用 BR 恢复 GCS 上的备份数据
机械臂速成小指南(十):可达工作空间
Clock in during winter vacation
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
SSL证书部署
QT thread and other 01 concepts
二进制、八进制、十六进制
Class constant pool and runtime constant pool
机器学习笔记 - 使用机器学习进行鸟类物种分类
First understand the principle of network
浅谈网络安全之文件上传
How to detect whether the MySQL code runs deadlock +binlog view
20. (ArcGIS API for JS) ArcGIS API for JS surface collection (sketchviewmodel)
25. (ArcGIS API for JS) ArcGIS API for JS line modification line editing (sketchviewmodel)
Create commonly used shortcut icons at the top of the ad interface (menu bar)