PeapBoy Posted August 17, 2016 Share Posted August 17, 2016 Hi guys ! I just spotted what I think is a bug (or rather a compatibility issue). Here is a *very* simple PG : http://www.babylonjs-playground.com/#27DV4V#6 It only prints the depth map on a plane. Here is a screenshot of the PG with Chrome 52 on Windows 7 : Here is a screenshot of the PG with Safari on an Ipad (iOS 9.2.1) : As you can see, no depth map with Apple, the plane is totally black (or gray with the light here). Maybe are you aware of this issue ? (do I hope too much ? ) Is there a WebGL restriction I don't know with Apple ? I had the chance to run the PG on different Macs and iPhones (different versions also), and the issue appears on every Apple device. I don't own any Apple devices but I can make tests at work if you need them. I would be glad to help if I can. PS: I make some tests and it looks like a simple render target texture with a shader material which computes the depth could work. And it seems like the RTT of the depthRenderer has a lot of different properties than the basic RTT I made. Quote Link to comment Share on other sites More sharing options...
Kesshi Posted August 17, 2016 Share Posted August 17, 2016 The DepthRenderer uses a float texture and IOS does not support rendering into a float texture. Maybe a fallback could be added here to use a half_float or integer texture instead. Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted August 17, 2016 Author Share Posted August 17, 2016 Hi Kesshi ! It seems so obvious when you answer so quickly... Thank you. I have absolutely no experience with Apple, so I'm just discovering the existence of differences like this one. Sorry if it's annoying. I'll play with texture type tomorrow and see what happens. [EDIT] You were totally right. Replacing float type by unsigned integer type resolved the issue. Thank you a lot. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 19, 2016 Share Posted August 19, 2016 Hello peapBoy, you could even think about contributing your changes back to Babylon.js For isntance we can just add a parameter here to specify the depth texture format: https://github.com/BabylonJS/Babylon.js/blob/2a0c505951937132e926d2375c6ca28d39b19365/src/babylon.scene.ts#L2435 Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted August 19, 2016 Author Share Posted August 19, 2016 Hi Deltakosh, In fact, I never contributed to any project on github so I don't really know how to do it. But there is a first time for everything. But you're right, an optional "type" parameter could be added there, and we could then check in DepthRenderer constructor if it's undefined or not with TEXTURETYPE_FLOAT set by default. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 25, 2016 Share Posted August 25, 2016 You'll see.. It is fun to contribute and you will be proud of you. Helping others is always a pleasure:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.