向量的一种特殊乘法 element wise multiplication

物体反射颜色的计算采用这样的模型:

vec3 reflectionColor = objColor * lightColor;//物体反射颜色 = 物体颜色 * 光源颜色。 (vec3(r,g,b), r,g,b在[0,1]范围里)。

比如:光源是自然光:lightColor = vec3(1.0,1.0,1.0);物体是绿色的:objColor  = vec3(0,0,1.0,0.0);

反射光就是:reflectionColor  = vec3(1.0,1.0,1.0) * vec3(0,0,1.0,0.0) = vec3(0,0,1.0,0.0);(绿色,2个向量的分量对应分别相乘)。

这种向量的乘法方式有一个名字叫: element wise multiplication;

时间: 2024-10-09 17:26:17

向量的一种特殊乘法 element wise multiplication的相关文章

布斯乘法Booth's multiplication algorithm from wikipedia

Booth's multiplication algorithm is a multiplication algorithm that multiplies two signed binary numbers in two's complement notation. The algorithm was invented by Andrew Donald Booth in 1950 while doing research on crystallography at Birkbeck Colle

js 实现两种99乘法表

1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>99乘法表</title> 6 </head> 7 <body> 8 <script type="text/javascript"> 9 var i=1; 10 while(i &l

js for和while两种99乘法表

<script type="text/javascript"> for(var i=1; i<=9; i++) { for(var j=1; j<=i;j++)//j<=i { document.write(i+"*"+j+"="+(i*j)+"   "); } document.write("<br>"); } document.write("<b

稀疏矩阵乘法 &#183; Sparse Matrix Multiplication

[抄题]: 给定两个 稀疏矩阵 A 和 B,返回AB的结果.您可以假设A的列数等于B的行数. [暴力解法]: 时间分析: 空间分析: [思维问题]: [一句话思路]: 如果为零则不相乘,优化常数的复杂度. [输入量]:空: 正常情况:特大:特小:程序里处理到的特殊情况:异常情况(不合法不合理的输入): [画图]: [一刷]: [二刷]: [三刷]: [四刷]: [五刷]: [五分钟肉眼debug的结果]: [总结]: [复杂度]:Time complexity: O() Space comple

Understanding Convolution in Deep Learning

Understanding Convolution in Deep Learning Convolution is probably the most important concept in deep learning right now. It was convolution and convolutional nets that catapulted deep learning to the forefront of almost any machine learning task the

Sequence Models

Sequence Models This is the fifth and final course of the deep learning specialization at Coursera which is moderated by deeplearning.ai Here are the course summary as its given on the course link: This course will teach you how to build models for n

[C7] Andrew Ng - Sequence Models

About this Course This course will teach you how to build models for natural language, audio, and other sequence data. Thanks to deep learning, sequence algorithms are working far better than just two years ago, and this is enabling numerous exciting

[C4] Andrew Ng - Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization

About this Course This course will teach you the "magic" of getting deep learning to work well. Rather than the deep learning process being a black box, you will understand what drives performance, and be able to more systematically get good res

[C6] Andrew Ng - Convolutional Neural Networks

About this Course This course will teach you how to build convolutional neural networks and apply it to image data. Thanks to deep learning, computer vision is working far better than just two years ago, and this is enabling numerous exciting applica