Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / POSSIBLE BUG? - Texture disappearing on Android, but appears on PC

Author
Message
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 25th Feb 2017 16:18 Edited at: 25th Feb 2017 16:40
Hello everybody. There's something weird happening.
I have a 3d model of a stage that I load into AppGameKit as a 3D scene.
The stage appears normal on PC, but when broadcasted to Android, some of the textures disappeared on Android.
Also, there seems to be some sort of ?transparency/alpha blending issues on Android.
I don't think the 3D model or texture violated any rules for Android. Tried clearing the cache, loaded other models, changed alpha and transparency mode, but the issue persisted.
Can you guys take a look and see what's wrong with it?
How do I make the texture appears correctly on Android?

Thanks in advance.
Try it on PC (Windows 7 GTX 970), and compare it with Android (the app will run as VR on Android) (mine is Xperia Z3 on Android 6 )
Included the project folder below.

Attachments

Login to view attachments
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 26th Feb 2017 12:15
Any idea anybody?
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 26th Feb 2017 17:53
Try to change your texture with the other small file. Just try and try.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 26th Feb 2017 18:01
I tried your app on Windows and on Android. The bed texture is missing on android, but if I load the bed texture in place of the floor texture, the bed texture is shown on the floor. If I do it the other way around, loading the floor texture in place of the bed texture, then that texture is also missing on the bed, where as it shows correctly as on the floor when loaded for the floor. Could it be something with your model?
13/0
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 26th Feb 2017 21:23 Edited at: 27th Feb 2017 05:10
Quote: "Could it be something with your model?"


Rather unlikely, because I tried with other models with other format too (.smd, .x,), even with boned model, but the result is the same.
I even tried the 'metro' stage that is featured in AGK2 example VR project (in "User demos/Virtual Reality"), still same result.
I don't think the problem is the models. Previously before AppGameKit updates (not sure which version), it all works fine.

Here's the scene with 'metro' model.
Navigate on Android using gyroscope and press the button on screen to walk. You can still see the crazy ?alpha blending/missing textures when the wall are overlapping

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Feb 2017 09:15
Android is case sensitive so ensure that your filenames match both in the code and their filename.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 27th Feb 2017 14:23
I'm not sure if I got the same problem, the bed was missing completely and the stool legs didn't go all the way to the floor, however it may be caused by the same problem. In your call to SetRenderToImage you are using 0 for the depth image, which means the scene will be drawn without a depth buffer, this is bad for 3D. You should use -1 to specify you want a depth buffer but you don't care what happens to it.

Also on line 436 you are rendering the entire scene again on Android, which cause performance issues. You don't need to do this since the scene is already rendered to the two images, you just have to draw the two sprites to the screen and then Swap. You can do this with DrawSprite( LeftEye.Sprite ) and DrawSprite( RightEye.Sprite ). This wouldn't have caused any visible problems since the two sprites would have been drawn over the scene anyway.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 27th Feb 2017 15:03 Edited at: 27th Feb 2017 15:58
Thank you guys, Paul suggestion works.
I changed SetRenderToImage( LeftEye.RenderImage,-1 ) to -1, and it all looks fine now.
I thought the -1 part are used to help lighting shaders or something, so I didn't mess with it previously

I tried to delete the final Render()
and replaced with DrawSprite( LeftEye.Sprite ) for each eye. Works like a charm. Thanks a lot.

Here's the fixed project, just in case anybody wanted it.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-24 19:56:25
Your offset time is: 2024-11-24 19:56:25