- Unity 2018 Shaders and Effects Cookbook
- John P. Doran Alan Zucconi
- 101字
- 2021-06-18 19:04:17
There's more...
Where swizzling really shows its full potential is when it's applied to packed matrices. Cg allows types such as float4x4, which represents a matrix of floats with four rows and four columns. You can access a single element of the matrix using the _mRC notation, where R is the row and C is the column:
float4x4 matrix; // ... float first = matrix._m00; float last = matrix._m33;
The _mRC notation can also be chained:
float4 diagonal = matrix._m00_m11_m22_m33;
An entire row can be selected using squared brackets:
float4 firstRow = matrix[0]; // Equivalent to float4 firstRow = matrix._m00_m01_m02_m03;
推薦閱讀
- C程序設計簡明教程(第二版)
- 數據庫原理及應用(Access版)第3版
- Building a Home Security System with Raspberry Pi
- Hands-On Image Processing with Python
- Arduino開發實戰指南:LabVIEW卷
- Programming ArcGIS 10.1 with Python Cookbook
- 三維圖形化C++趣味編程
- 數據結構(Java語言描述)
- Learn Programming in Python with Cody Jackson
- Implementing Cisco Networking Solutions
- PLC編程與調試技術(松下系列)
- D3.js 4.x Data Visualization(Third Edition)
- Tableau 10 Bootcamp
- 跟戴銘學iOS編程:理順核心知識點
- H5+移動營銷設計寶典