How to define constant array in GLSL (OpenGL ES 2.0)?

前端 未结 2 396
心在旅途
心在旅途 2020-12-15 21:38

I just want to store an array of weights that needs to every fragment calculation.

This:

float weights[5] = float[5](3.4, 4.2, 5.0, 5.2, 1.1);
         


        
2条回答
  •  攒了一身酷
    2020-12-15 22:24

    precision highp float;
    
    const float a[5] = float[5](3.4, 4.2, 5.0, 5.2, 1.1);
    

    It's working with Android KitKat version (OpenGL ES 2.0).

提交回复
热议问题