当前位置:网站首页>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
边栏推荐
- How to manage the expiration of enterprise distribution certificates- How to manage Enterprise Distribution certificate expiration?
- 【系统管理】清理任务栏的已删除程序的图标缓存
- 三重半圆环进度条,直接拿去就能用
- 【编码字体系列】OpenDyslexic字体
- QT opens a file and uses QFileDialog to obtain the file name, content, etc
- 【mysql】mysql中行排序
- Class常量池与运行时常量池
- 2022夏每日一题(一)
- List interview common questions
- One of oscp tools: dirsearch usage Encyclopedia
猜你喜欢
Simple implementation of AVL tree insertion and verification operations
Hisilicon 3559 universal platform construction: RTSP real-time playback support
Gpt-3 is a peer review online when it has been submitted for its own research
【knife-4j 快速搭建swagger】
Class constant pool and runtime constant pool
opencv第三方库
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
Quick completion guide of manipulator (10): accessible workspace
cuda编程
随机推荐
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
力扣------路径总和 III
自适应非欧表征广告检索系统AMCAD
Implementation of map and set
【编码字体系列】OpenDyslexic字体
Tflite model transformation and quantification
中青杯2022A题高校数学建模竞赛与课程教育思路分析
ggplot 分面的细节调整汇总
CUDA Programming
Analysis on urban transportation ideas of 2022 Zhongqing cup C
[dpdk] dpdk sample source code analysis III: dpdk-l3fwd_ 001
机器人(自动化)课程的持续学习-2022-
What is the experience of maintaining Wanxing open source vector database
Kalman filter-1
[development software] tilipa Developer Software
【mysql】mysql中行排序
见到小叶栀子
运算放大器应用汇总1
Collection of idea gradle Lombok errors
The most complete security certification of mongodb in history