Comments (11)
First: thanks for this fantastic contribution to the react native ecosystem.
I wanted to confirm if what I'm seeing is the same issue as described:
If I place a underneath any other view on Android, the Surface will render on top of any native views. In iOS I see the expected behavior, so I can place text or buttons above the shader/surface.
I've tried many, many things: using position: absolute of course, and various combinations of background transparency/colors.
Is this behavior related to this issue or do I need to open a new issue?
from gl-react-native-v2.
Mmh it depends, what are you rendering in the Surface?
Do you have rasterized content (like native views), I mean content that you passed in an uniform. or are these native views just under the <Surface>
in absolute?
I might not have deeply tested this but I think gl-react-native Surface opacity (from shader) does work on Android. the bug logged here is that the native views when rasterized via gl-react uniforms is always opaque (never have opacity in it).
facebook/react-native#4878 <- Maybe you might be talking about this React Native bug? (that I also discovered when playing with gl-react-native on Android)
from gl-react-native-v2.
Mmmmm, no - I did't pass any textures in as uniforms, just laid native views above the surface:
<View style={styles.container}>
<Surface
width={deviceWidth}
height={300}
opaque={false}
ref="helloGL"
pixelRatio={2}
>
<HelloGL />
</Surface>
<Image style={{position:'absolute', top: 100, left: 30, width: 300, height: 100}} source={{ uri: 'http://i.imgur.com/S22HNaU.png'}} width={300} height={100} />
<Text style={{position:'absolute', top: 100, left: 30, width: 300, height: 100,backgroundColor:'transparent', color:'#FFFFFF', fontSize:36}}>SOME NATIVE TEXT ABOVE AN IMAGE, ABOVE A SHADER</Text>
</View>
Yields different results on iOS / Android:
iOS:
Android:
from gl-react-native-v2.
I'm not sure how position: "absolute" works and if it's well supported in RN Android, have you tried to replace the <Surface>
by a simple red square <View style={{ width: deviceWidth, height: 300, backgroundColor: "red" }} />
?
also have you tried to position: "absolute" the Surface too (style prop should be supported) ?
from gl-react-native-v2.
Works fine with replacing a surface with a simple view, so it seems to be specific to gl-react-native:
from gl-react-native-v2.
And yes, I've tried position: absoluting the surface. That works fine in terms of positioning, but the layer order is not respected on Android like it is on iOS - no matter what order you define the views in on render, the surface is always rendering on top
from gl-react-native-v2.
this is weird.
I'll try to repro it, it might be related to the <View><GLCanvas>
specific internal nesting
from gl-react-native-v2.
can you open another issue?
from gl-react-native-v2.
Opened a new issue:
#57
I'm happy to do some investigation as well, will comment on the new issue
from gl-react-native-v2.
thanks
from gl-react-native-v2.
Is there any progress on this item? Running into this as well.
Thanks
from gl-react-native-v2.
Related Issues (20)
- Tried to register two views with the same name GLCanvas
- Error: RCTImageLoader.h file not found HOT 1
- Multiple shaders
- What is the software license on this repo? HOT 1
- Could not resolve project :RNGL HOT 3
- undefined is not an object (evaluting '_glReact.runtime') HOT 1
- [iOS] Is it broken? HOT 1
- undefined is not an object (evaluatting 'PropTypes.any') HOT 9
- run android, Can run, but will crash after a while HOT 1
- Could not find @ReactModule on app start HOT 7
- Android crash on captureFrame
- React-Native multiple GL Nodes stacked invoke performance issues
- unable to find module for uimanager (lazilyloadIfNeccessary) HOT 2
- Please release a new version that works with react-native 0.58 HOT 3
- Android crash on capture with react-native-image-cropper HOT 1
- Is gl-react-native working on v0.6?
- Any plans for supporting React Native v0.6? HOT 12
- error message: _child2.__callListeners is not a function
- how can i load user device image ?
- Captured image quality is too low and image is black inside surface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gl-react-native-v2.