当前位置:网站首页>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
边栏推荐
- MongoDB数据库基础知识整理
- 最安全的证券交易app都有哪些
- [quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice
- Unity之ASE实现卡通火焰
- Niuke real problem programming - day18
- jacoco代码覆盖率
- The download button and debug button in keil are grayed out
- How to release NFT in batches in opensea (rinkeby test network)
- [deep learning] image hyperspectral experiment: srcnn/fsrcnn
- What is Base64?
猜你喜欢
HW初级流量监控,到底该怎么做
[quick start of Digital IC Verification] 24. AHB sramc of SystemVerilog project practice (4) (AHB continues to deepen)
微信小程序 01
Ctfshow, information collection: web9
Guangzhou Development Zone enables geographical indication products to help rural revitalization
Unity之ASE实现全屏风沙效果
Niuke real problem programming - day18
[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)
Ctfshow, information collection: web5
【OBS】RTMPSockBuf_ Fill, remote host closed connection.
随机推荐
jacoco代码覆盖率
【数字IC验证快速入门】24、SystemVerilog项目实践之AHB-SRAMC(4)(AHB继续深入)
2. Basic knowledge of golang
[Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
MongoD管理数据库的方法介绍
Guangzhou Development Zone enables geographical indication products to help rural revitalization
[server data recovery] a case of RAID data recovery of a brand StorageWorks server
15. Using the text editing tool VIM
Win10 or win11 taskbar, automatically hidden and transparent
Integer learning
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
MySQL bit type resolution
Starting from 1.5, build a microservice framework link tracking traceid
【數據挖掘】視覺模式挖掘:Hog特征+餘弦相似度/k-means聚類
简述keepalived工作原理
HPDC smart base Talent Development Summit essay
Pit avoidance: description of null values in in and not in SQL
A need to review all the knowledge, H5 form is blocked by the keyboard, event agent, event delegation
Runnable是否可以中断
There is a cow, which gives birth to a heifer at the beginning of each year. Each heifer has a heifer at the beginning of each year since the fourth year. Please program how many cows are there in the