Home › Forums › Bug Reports and Feature Requests › Fantasy Vehicle working in iOS only if shadows are disabled
Tagged: bake shadows, iOS limitations, Shadows, workaround
- This topic has 10 replies, 5 voices, and was last updated 5 years, 2 months ago by Ivan Lyubovnikov.
-
AuthorPosts
-
2019-10-11 at 1:07 pm #20080illussimoCustomer
Recently I had updated my Fantasy Vehicle to Blender 2.8 and Verge3D 2.14. I had to disable shadows in the Verge3D render settings to get it working on iOS (otherwise iOS only loads a few parts of my vehicle. A known limitation of iOS..). By the way, it is now updated to 2.15, but unfortunately, this is an iOS issue, not a Verge3D issue so I still had to disable shadows. In this scene, for now, the shadows are not that important.
https://illussimo.com/webgl/myVehicle2018/my_vehicle_2018.html
But for another application that I am building and hope to publish by the end of next week, I have baked all the shadows and ao to make it work in iOS.
It seems iOS makes a shadow map even for lights that have no shadow implemented and also loads lights first and only then the object textures.
Is there a workaround for this?
Simone2019-10-13 at 8:40 am #20138Yuri KovelenovStaffHi Simone,
To be more precise, the iOS issue relates to the limitation on the number of WebGL texture objects assigned to a single shader (iOS maximum is 8). This includes shadow maps and vanilla textures, and also some EEVEE modes such color ramps that are baked to textures upon export. Once a WebGL shader exceeds that limit, it fails to compile (crashes) and the corresponding material does not render.
Sorry, but the only way to make it work on iOS is to carefully review your materials and lighting.
2019-10-14 at 1:34 pm #20257illussimoCustomerThanks for your quick reply.
I have a maximum of 4 texture maps per object and mostly less. I have roughness, metalness and AO in the different channels packed in one texture for efficiency. So that should be fine.
In one project I have nearly only used procedural textures. Some of them have colour-ramps. Do you mean that if a colour-ramp is used it is seen as a texture?
Even then my scenes should load in iOS. And they do and work fine if shadows are disabled in the Verge3D render settings.
Somehow it seems shadows are the bottleneck for iOS.
When I bake the shadows which even adds extra textures to my objects everything still loads and works without problems in iOS. So, for now, that seems the way to go to make things also work in iOS.
I hide and show different shadow textures if things have moved in my scene. There is always some workaround…
2019-10-14 at 2:17 pm #20267dssctrCustomerHi Simone,
I had a similar issue when I accidentally duplicated my lights to six. When I realized what i had done, I removed a single source and sneak peaked each time. At a fewer number of lights(like 3 or 4) everything worked fine. Try removing a non-essential light (if you have any)and see if this helps. If I recall, it had a greater impact than even the removal of my HDR lighting.Hope this helps,
Rick2019-10-14 at 2:51 pm #20272Yuri KovelenovStaffDo you mean that if a colour-ramp is used it is seen as a texture?
yes, color ramps and vector curves are baked to texture
Somehow it seems shadows are the bottleneck for iOS.
the shadows seem to add up to your textures and thus exceed the limit of 8 textures.
Environment is also considered as a texture. But it is more efficient to use image-based lighting provided by environment texture than to have multiple lamps.
2019-10-14 at 4:07 pm #20284jemCustomerHi Yuri,
I have run into this issue in the past. I think that there is a thread on the forum on this topic from about a year ago. I know that this is an Apple issue and I wish they would fix their software, but is there a way that we, as implementers, can see the number of textures in a material? It would be convenient if the export log showed the number of textures per material. This would be similar to a compile-time warning if I were writing in C. I could use this information to fix Apple issues before I moved to QA.
Even if I had this information, it would not be perfect because of lights and shadows. I think that a light with a shadow adds a texture to a material at run time. I would just have to keep that in mind when I was trying to stay under the Apple texture limit of 8.Jeremy Wernick
2019-10-14 at 4:33 pm #20288illussimoCustomerBut it is more efficient to use image-based lighting provided by environment texture than to have multiple lamps.
I already did that, but I needed additional lamps to make everything the way I want it to look.
Maybe next year Apple will comply with WebGL standards…
For now, with baking the shadows and unchecking (real) shadows in the Verge3D settings I got everything working fine.
2019-10-14 at 6:17 pm #20297dssctrCustomerHi Simone,
Another tip I found that works with mobile textures is to convert any Blender PNGs to JPG. I converted a 4k 10MB Png texture to 451Kb jpg at 50% quality with minimal visual loss in Photoshop. This, in turn, freed up a whole lot of memory for mobile so that it ran much smoother. -Rick2019-10-14 at 10:33 pm #20298illussimoCustomerThank you Tidlybit. Yes, that is important and I had done that (in 80% quality), but most of the textures just didn’t load in iOS when using real shadows.
With shadows baked to textures and with real shadows turned of in Verge3D everything loads and runs smoothly. So yes, converting textures from ping to jpg, not using too many lights, and baking shadows will work fine in iOS in most cases.2019-10-15 at 8:40 am #20312Yuri KovelenovStaffcan see the number of textures in a material
We’ll think about it!
2019-10-17 at 9:29 am #20399Ivan LyubovnikovStaffcan see the number of textures in a material
We’ve just implemented this!
more details: how-many-textures-does-this-material-use
Co-founder and lead developer at Soft8Soft.
-
AuthorPosts
- You must be logged in to reply to this topic.