Commit 8b8e11b8 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

better solution for alpha. might still have some issue

parent 8267b0c0
...@@ -92,32 +92,59 @@ class Tests extends React.Component { ...@@ -92,32 +92,59 @@ class Tests extends React.Component {
</NativeLayer> </NativeLayer>
<NativeLayer width={debugSize} height={debugSize}> <NativeLayer width={debugSize} height={debugSize}>
<Copy width={debugSize} height={debugSize}> <Image source={{ uri: "http://i.imgur.com/S22HNaU.png" }} width={debugSize} height={debugSize} />
http://i.imgur.com/S22HNaU.png <Copy width={debugSize} height={debugSize} opaque={false}>
http://i.imgur.com/mp79p5T.png
</Copy> </Copy>
<Image source={{ uri: "http://i.imgur.com/mp79p5T.png" }} width={debugSize} height={debugSize} />
</NativeLayer> </NativeLayer>
<NativeLayer width={debugSize} height={debugSize}> <NativeLayer width={debugSize} height={debugSize}>
<Image source={{ uri: "http://i.imgur.com/S22HNaU.png" }} width={debugSize} height={debugSize} /> <Image source={{ uri: "http://i.imgur.com/S22HNaU.png" }} width={debugSize} height={debugSize} />
<Copy width={debugSize} height={debugSize} opaque={false}> <Copy width={debugSize} height={debugSize} opaque={false}>
<Copy>
http://i.imgur.com/mp79p5T.png http://i.imgur.com/mp79p5T.png
</Copy> </Copy>
</Copy>
</NativeLayer> </NativeLayer>
<NativeLayer width={debugSize} height={debugSize}> <NativeLayer width={debugSize} height={debugSize}>
<Copy width={debugSize} height={debugSize}> <Image source={{ uri: "http://i.imgur.com/S22HNaU.png" }} width={debugSize} height={debugSize} />
http://i.imgur.com/S22HNaU.png <Copy width={debugSize} height={debugSize} opaque={false}>
<Copy>
<Copy>
http://i.imgur.com/mp79p5T.png
</Copy>
</Copy> </Copy>
</Copy>
</NativeLayer>
<NativeLayer width={debugSize} height={debugSize}>
<Image source={{ uri: "http://i.imgur.com/S22HNaU.png" }} width={debugSize} height={debugSize} />
<Copy width={debugSize} height={debugSize} opaque={false}> <Copy width={debugSize} height={debugSize} opaque={false}>
<Copy>
<Copy>
<Copy>
http://i.imgur.com/mp79p5T.png http://i.imgur.com/mp79p5T.png
</Copy> </Copy>
</Copy>
</Copy>
</Copy>
</NativeLayer> </NativeLayer>
<Layer width={debugSize} height={debugSize}> <NativeLayer width={debugSize} height={debugSize}>
{"http://i.imgur.com/S22HNaU.png"} <Image source={{ uri: "http://i.imgur.com/S22HNaU.png" }} width={debugSize} height={debugSize} />
{"http://i.imgur.com/mp79p5T.png"} <Copy width={debugSize} height={debugSize} opaque={false}>
</Layer> <Copy>
<Copy>
<Copy>
<Copy>
http://i.imgur.com/mp79p5T.png
</Copy>
</Copy>
</Copy>
</Copy>
</Copy>
</NativeLayer>
</View> </View>
</ScrollView>; </ScrollView>;
......
...@@ -336,9 +336,6 @@ RCT_NOT_IMPLEMENTED(-init) ...@@ -336,9 +336,6 @@ RCT_NOT_IMPLEMENTED(-init)
[fbo bind]; [fbo bind];
} }
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.0, 0.0, 0.0, 0.0);
[renderData.shader bind]; [renderData.shader bind];
for (NSString *uniformName in renderData.textures) { for (NSString *uniformName in renderData.textures) {
...@@ -351,22 +348,22 @@ RCT_NOT_IMPLEMENTED(-init) ...@@ -351,22 +348,22 @@ RCT_NOT_IMPLEMENTED(-init)
[renderData.shader setUniform:uniformName withValue:renderData.uniforms[uniformName]]; [renderData.shader setUniform:uniformName withValue:renderData.uniforms[uniformName]];
} }
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glDrawArrays(GL_TRIANGLES, 0, 6); glDrawArrays(GL_TRIANGLES, 0, 6);
}; };
// DRAWING THE SCENE // DRAWING THE SCENE
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO);
glDisable(GL_BLEND);
[self syncContentTextures]; [self syncContentTextures];
recDraw(_renderData); glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); recDraw(_renderData);
glDisable(GL_BLEND);
glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment