- 2019-10-11 at 1:07 pm #20080
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.
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?
2019-10-13 at 8:40 am #20138
- This topic was modified 7 months, 2 weeks ago by illussimo.
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 #20257
- This reply was modified 7 months, 2 weeks ago by Yuri Kovelenov.
Thanks 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 #20267tidlybitLicensee
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 #20272
Do 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 #20284jemLicensee
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.2019-10-14 at 4:33 pm #20288
But 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 #20297tidlybitLicensee
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 #20298
Thank 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 #203122019-10-17 at 9:29 am #20399
You must be logged in to reply to this topic.