- 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;
推薦閱讀
- Java語(yǔ)言程序設(shè)計(jì)
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- INSTANT CakePHP Starter
- Effective Python Penetration Testing
- 軟件測(cè)試技術(shù)指南
- 從零開(kāi)始學(xué)C語(yǔ)言
- Node.js開(kāi)發(fā)指南
- Test-Driven JavaScript Development
- Visual FoxPro 6.0程序設(shè)計(jì)
- Mastering Android Studio 3
- Python一行流:像專家一樣寫代碼
- 信息學(xué)奧林匹克競(jìng)賽初賽精講精練
- The Applied Data Science Workshop
- Developer,Advocate!
- Vue.js從入門到精通