当前位置:网站首页>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
边栏推荐
- [quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)
- [Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
- The download button and debug button in keil are grayed out
- Bits and Information & integer notes
- Steps to create P8 certificate and warehousing account
- 【服务器数据恢复】戴尔某型号服务器raid故障的数据恢复案例
- HW初级流量监控,到底该怎么做
- 2022全开源企业发卡网修复短网址等BUG_2022企业级多商户发卡平台源码
- Unity之ASE实现卡通火焰
- 连接ftp服务器教程
猜你喜欢

Starting from 1.5, build a microservice framework link tracking traceid

2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code

【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)

TypeScript 发布 4.8 beta 版本

Ctfshow, information collection: web4

15. Using the text editing tool VIM

Ctfshow, information collection: web5

Summer safety is very important! Emergency safety education enters kindergarten
![[Lanzhou University] information sharing of postgraduate entrance examination and re examination](/img/06/df5a64441814c9ecfa2f039318496e.jpg)
[Lanzhou University] information sharing of postgraduate entrance examination and re examination

【跟着江科大学Stm32】STM32F103C8T6_PWM控制直流电机_代码
随机推荐
Introduction of mongod management database method
【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset
【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
【原创】一切不谈考核的管理都是扯淡!
15. Using the text editing tool VIM
STM32F103C8T6 PWM驱动舵机(SG90)
Gd32 F3 pin mapping problem SW interface cannot be burned
连接ftp服务器教程
[understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper
Ctfshow, information collection: web7
Bits and Information & integer notes
【Markdown语法高级】让你的博客更精彩(四:设置字体样式以及颜色对照表)
Steps to create P8 certificate and warehousing account
数学建模——什么是数学建模
unnamed prototyped parameters not allowed when body is present
最安全的证券交易app都有哪些
[机缘参悟-40]:方向、规则、选择、努力、公平、认知、能力、行动,读3GPP 6G白皮书的五层感悟
居然从408改考自命题!211华北电力大学(北京)
Wechat applet 01