惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
AWS News Blog
AWS News Blog
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
T
Threatpost
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
F
Full Disclosure
博客园_首页
N
Netflix TechBlog - Medium
Security Latest
Security Latest
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
博客园 - Franky
P
Palo Alto Networks Blog
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - 游戏行者

ubuntu 24 之后,登录时出现server refused our key,不认原来的ssh key的解决方法 zoho企业邮件管理页,如何登录 thunderBird如何选择配置文件 鼠标对码 PVE更换主板后,如何修改绑定网卡 关于ubuntu和debian的配置,以及vultr的防火墙设置 - 游戏行者 entity framework core使用sqlServer localDB指定文件路径 windows 10如何更改字体大小和开启防蓝光 ubuntu挂载ntfs分区(读写模式) vmware ubuntu虚拟机设置共享文件夹之后,虚拟机重启找不到的问题 Esxi(vSphere) 安装经验 瑞芯微系列主板刷机方法 f#如何设定main函数 探索texture对象的生命周期 Opengl vertex shader中, layout location最多允许几个,或者说,顶点可以有多少个属性 opengl 如何从指定位置画三角形,理解opengl的指针 vk.xml生成之坑 写代码的技巧 vulkan的QueueFamilyProperties
opengl管理texture参数的函数总结
游戏行者 · 2020-09-01 · via 博客园 - 游戏行者

glTexParameter和glTextureParameter两个系列的函数(都分为i和f,还有iv,fv等)。

void glTexParameteri( GLenum target, GLenum pname, GLint param);

glTexParameter是用来处理Active Texture的。要先用Active Texture来激活它。当然,也可以在Texture刚刚创建之后就设置它的属性。其中target可以是GL_TEXTURE_2DGL_TEXTURE_3DGL_TEXTURE_2D_ARRAYGL_TEXTURE_2D_MULTISAMPLEGL_TEXTURE_2D_MULTISAMPLE_ARRAYGL_TEXTURE_CUBE_MAP,   GL_TEXTURE_CUBE_MAP_ARRAY 之一。

可见它也是隐喻,同一个Vao,只能有一套这类Texture,所以才能用target来标志要操作哪个Texture。

glTextureParameter,则是用来处理用ID表示的Texture。这种方式,无疑更加合理,更加清晰。但是可惜,只有opengl 4.5以后才有。opengl es则没有。

用glTexParameter,基本也就无法在创建后改变Texture参数了,找起来很麻烦。好在也没多少这种需求。

然后,带v的函数,大多是是用来处理一个四元数的。一个是颜色,GL_TEXTURE_BORDER_COLOR, 还有一个GL_TEXTURE_SWIZZLE_RGBA,用来表示颜色的重新排序。

对于border的颜色,glTexparameterIiv版本函数和glTexParameterfv函数,操作的是同一个颜色。f版的颜色,取值范围是0到1之间,i版就把这个颜色值分布到0和Int的最大值之间。比如,f版设定的颜色是(0.1,0.2,0.3,0,4),I版的颜色值就是int的最大值乘以这四个数。

注意,glTexParameterIv函数(一个i),是特殊的。它是用特殊方式表示的浮点数。转换公式是f=(2c+1)/(2^b-1)。这个函数就专门用于设置GL_TEXTURE_BORDER_COLOR,实际上也不需要用到它,很麻烦,跟另外两个函数功能一样的,属于画蛇添足的东西。