0
A
回答
1
我假設你可以計算點積。所以只需乘以另一個包含(0,0,0,1)的vec4即可。
編輯:但是,你確定你不能簡單地使用.w?我發現的所有文檔和示例都說可以。
4
我認爲你可能誤讀了規範 - 閱讀單個組件完全有效。 GLSL甚至允許隱式排列和原始組件的組合,例如,
lowp vec4 someVector;
// someVector.xy is a lowp vec2 containing the first two scalars from someVector
// someVector.zwx is a lowp vec3 containing the third, fourth and first scalars in that order
// someVector.w is a lowp float containing the fourth scalar
例如,我使用的片段着色器:
void main()
{
lowp vec4 srcPixel = texture2D(tex2D, texCoordVarying);
lowp vec4 yuvPixel = rgbToYuv * srcPixel;
yuvPixel.r *= 3.0;
gl_FragColor = yuvToRgb * yuvPixel;
}
與合適的基質和varyings提高紋理三倍的亮度。
相關問題
- 1. OpenGL ES 2D陰影的陰影
- 2. OpenGL ES使用glReadPixels讀取浮點值()
- 3. OpenGL ES 2.0中的浮點紋理
- 4. OpenGL ES black as alpha(transperancy)
- 5. Alpha與OpenGL ES 2.0混合?
- 6. OpenGL ES 2.0 PNG alpha通道
- 7. 陰影貼圖紋理alpha
- 8. 創建OpenGL陰影
- 9. OpenGL ES:從着色器獲取轉換的頂點
- 10. iPhone OpenGL ES不正確的alpha混合
- 11. 的OpenGL ES繞點
- 12. SASS使用Alpha的文字陰影
- 13. opengl es投影和android中的相機
- 14. OpenGL-ES變量紋理alpha(2D)?
- 15. 在浮動divs盒陰影
- 16. C語言中的浮點錯誤
- 17. C語言中的浮點下溢
- 18. 帶有浮動陰影的動畫陰影效果
- 19. 從OpenGL ES 1.1過渡到OpenGL ES 2.0
- 20. OpenGL ES:將單浮點數傳遞給頂點着色器?
- 21. 如何在OpenGL ES 2.0中將浮點數組傳遞給Shader?
- 22. 從PostgreSQL獲取浮點值
- 23. 從NSDictionary獲取浮點值
- 24. OpenGL ES獲取對象的座標
- 25. 從UTF8獲取語言
- 26. Ortho OpenGL ES的投影問題
- 27. OpenGL ES VBO奇怪的內存影響
- 28. OpenGL ES 2.0的着色器浮點數據精度
- 29. 如何用C語言中的兩個十進制值獲取浮點值?
- 30. OpenGL的陰影彼得平搖