How do I perform bit operations in glsl

前端 未结 2 2215
滥情空心
滥情空心 2021-02-06 01:14

How do I perform bit operations in glsl?

Using the regular C style bitwise operators |, &, ^, or ! does not work

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-06 01:37

    You need to put either

    #version 130
    

    or

    #extension GL_EXT_gpu_shader4 : enable
    

    in the top of your shader to get access to the bit operators

提交回复
热议问题