Disabling specific KHR extensions

Hi all,
samples like dragon by Khronos (https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DragonAttenuation/screenshot/screenshot_large.png) use KHR_materials_transmission, KHR_materials_volume, KHR_materials_variants extensions.

Everything is working really nice on desktop, although on mobile (e.g. smartphone) refraction indeed has huge impact on fps.

Is there a way to disable specific KHR_* extensions in THREE?
In that case, one could disable certain extensions on low-profile devices

I think there are basically three ways to ‘downgrade’ materials for better performance:

  1. after loading in three.js, swap materials for something cheaper (MeshBasicMaterial < MeshLambertMaterial < MeshPhongMaterial < MeshStandardMaterial < MeshPhysicalMaterial)
  2. disable extensions in GLTFLoader so that more advanced extensions are ignored
  3. offline, create a version of the model that uses fewer extensions

The most flexible of these is (1), since you can target things like MeshLambertMaterial or MeshPhongMaterial that no glTF file will create by default. I would probably do this first, to figure out which materials you actually want to use on mobile.

Once you’ve done that, you may also want to do (3), in case the original .glb contains textures for thickness or volume that you don’t need to download at all on mobile.

I think we could set something up to support (2), but you may need to open a github feature request for it, and I’m not sure if it would help as much as the other two options in this case.

4 Likes

Thanks Don. I’ll surely try those