-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transparent background for 3d model scene #45
Comments
I'm afraid that I don't understand what you mean by "obfuscated with a black screen". The library does not contain an android renderer by default. There is #34 , but it's not really integrated yet. So I'm curious how you are currently rendering. Did you implement an own (The description sounds like it could have something to do with |
I'm currently using the https://github.com/mikikg/AndroidJgltfViewer for rendering the gltf model. My main aim is to render a 3d model in an AR app, for this we are using maxst framework, where a custom background render is used to render camera image data,
So my issue is how can i integrate this background render with the gltf Renderer ? |
Admittedly, I'd need a refresher for some parts of the GL code, particularly the shader parts (I haven't worked much with GL lately...). On top of that, I'd have to make a more detailed review of the changes that are done in the But a first, wild guess, which I already mentioned in the first answer: I assume that the background renderer that you showed ist called, rendering the background image. And I assume that after that call, there is a call to A first attempt (quickly, just to see whether this indeed is the issue) would be to remove the (If it does have the desired effect, then one could think about a sensible option to support this feature. This could, for example, be adding some |
Admittedly support for android would have been fantastic but I understand its not possible to work on everything of interest.
Can you help me in debugging the above method? I do not understand the inner working of gltf model rendering and any help will be much appreciated. If possible please also point me towards resources where i can learn how the library is rendering the gltf model. |
It's not entirely clear why you assume that this is the crucial part of the code here - except, of course, for the fact that this is where all the rendering takes place ;-) These "render commands" that are assembled and put into a lists there are essentially small
essentially calls
The
calls things like
And the "main"
And of course, all these calls are done with the specific program, uniforms, and buffers that are required for rendering that particular model. I'm not sure whether that helps you in any way. But I'll try to reproduce the issue (i.e. try to render "my own background", and see whether I can prevent it from becoming black). I cannot promise anything, but will report back later... |
OK, from a quick test, I think that the desired effect can be achieved by changing the code at https://github.com/mikikg/AndroidJgltfViewer/blob/master/app/src/main/java/de/javagl/jgltf/viewer/gles/GlViewerGles.java#L147 to
to make sure that
The result of my test, by loading the "duck" and dragging it around, has a certain aesthetic: However, if it does not solve your issue, I'll try to render an "actual" backround, by porting the code for the background renderer that you posted. |
the issue still persists, I am still getting a black screen. Another point, all the commands are regarding model rendering, so why is background getting affected ? |
Well, it shouldn't be, obviously - and as it can be seen in the screensot, these commands should not affect the background: The duck is just painted on top of everything. However: All rendering from JglTF should take place in the `render´ method at https://github.com/mikikg/AndroidJgltfViewer/blob/master/app/src/main/java/de/javagl/jgltf/viewer/gles/GlViewerGles.java#L140 . Right now (mainly because I cannot quickly test or reproduce this), some "bisection steps".
|
I'll just close this due to inactivity. The |
Hi,
Thanks for making such an awesome library. I am using this library in android and trying to render a 3d model. The model is getting rendered correctly but the camera preview is getting obfuscated by a black screen. I have used the camera's view and projection matrix, how can I use the camera image data as the scene background or is it possible to make the scene background transparent?
The text was updated successfully, but these errors were encountered: