当前位置:网站首页>OpenGL common functions
OpenGL common functions
2022-07-07 15:39:00 【Vegetable chicken on the road】
Clamp function
Clamp The function can limit randomly varying values to a given interval [min, max] Inside :
template<class T>
T Clamp(T x, T min, T max)
{
if (x > max)
return max;
if (x < min)
return min;
return x;
}
mod function
mod A function is a complement function , The format for : mod(nExp1,nExp2), That is, the remainder of two numerical expressions after division
mix function
mix(x, y, a): x, y Linear aliasing , x(1-a) + y*a; a by 0 The result is x, a by 1 The result is y
smoothstep(start, end, parameter) function
Will return a 0 To 1 Value , This value represents the proportional distance between the minimum and maximum values of the parameter .smoothstep Function will be used to gradually but non linearly increase attributes over a period of time .
step(edge,x) function
step By way of x Compare with edges to generate step function .
For elements that return values i, If x[i]<edge[i], Then return to 0.0, Otherwise return to 1.0.
pow() function
pow(x, y) return x Of y The next power , namely xy
fract() function
fract(x): Take the decimal part
dot() function
dot(x, y): Dot product , Multiply the components separately after Add up ;
Given two n Dimension vector a=(a1,a2,…,an) and b=(b1,b2,…,bn), Find the dot product a·b=a1b1+a2b2+…+anbn.
sqrt() function
sqrt(x): x Root of
边栏推荐
- Stream learning notes
- How to deploy the super signature distribution platform system?
- 【数据挖掘】视觉模式挖掘:Hog特征+余弦相似度/k-means聚类
- 【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
- 全日制研究生和非全日制研究生的区别!
- The rebound problem of using Scrollview in cocos Creator
- 数学建模——什么是数学建模
- What are the safest securities trading apps
- [target detection] yolov5 Runtong voc2007 data set
- [quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)
猜你喜欢
2022年5月互联网医疗领域月度观察
【数字IC验证快速入门】24、SystemVerilog项目实践之AHB-SRAMC(4)(AHB继续深入)
Keil5 does not support online simulation of STM32 F0 series
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
What is data leakage
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
知否|两大风控最重要指标与客群好坏的关系分析
TypeScript 发布 4.8 beta 版本
【OBS】RTMPSockBuf_Fill, remote host closed connection.
HPDC smart base Talent Development Summit essay
随机推荐
Matlab experience summary
With 8 modules and 40 thinking models, you can break the shackles of thinking and meet the thinking needs of different stages and scenes of your work. Collect it quickly and learn it slowly
Window环境下配置Mongodb数据库
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)
[data mining] visual pattern mining: hog feature + cosine similarity /k-means clustering
The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service
Change win10 Screensaver
如何在opensea批量发布NFT(Rinkeby测试网)
【OBS】RTMPSockBuf_ Fill, remote host closed connection.
【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
全日制研究生和非全日制研究生的区别!
Ctfshow, information collection: web14
Stream learning notes
Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
MySQL bit type resolution
Database exception resolution caused by large table delete data deletion
Mathematical modeling -- what is mathematical modeling
【数字IC验证快速入门】22、SystemVerilog项目实践之AHB-SRAMC(2)(AMBA总线介绍)
使用Scrapy框架爬取网页并保存到Mysql的实现
PAT 甲级 1103 Integer Factorizatio