weixin_39603613 2020-11-30 04:47
浏览 0

double check that alpha works correctly

I think something is weird with alpha in gl-react-native.

We need to make a test proof example that alpha works correctly (draw a linear black opacity=100% to black opacity=0% over an image, same with white. compare with the same effect done with gimp also do the same on gl-react side).

该提问来源于开源项目:gre/gl-react-native-v2

  • 写回答

6条回答 默认 最新

  • weixin_39603613 2020-11-30 04:47
    关注

    (use case: http://i.imgur.com/mp79p5T.png over http://i.imgur.com/S22HNaU.png )

    screen shot 2015-09-24 at 15 31 11 - the 2 top results are right: transparent <Image> (so native UIImage) over the rainbow (both tested using an UIImage (left) & a GLKView (right)) - the 2 bottom results are wrong: transparent GLKView over the rainbow.

    the alpha seems to combine in a non linear way using a GLKView on top of anything.

    currently using this formula:

     objc
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    

    is there something wrong here?

    (code https://github.com/ProjectSeptemberInc/gl-react-native/blob/424c7cf25c03a20e5b0471b5a0fc36b202811cb5/Examples/Tests/index.ios.js#L89-L115 )

    评论

报告相同问题?