KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.48k stars 316 forks source link

Make emissive clamping optional or remove? #1643

Closed blitz-research closed 2 years ago

blitz-research commented 2 years ago

Hi,

My custom 3D engine supports emissive material values > 1.0 for hdr 'glow' effects.

I can create a blender material that theoertically achieves this by setting emission strength > 1, however the gltf2 exporter clamps the output emissive factor components to 1.

Would it be possible to make this clamping optional or even remove it? I have tested this myself by removing the following line (144) from gltf2_blender_gather_materials.py, and it seems to work fine:

    factor = [min(1.0, f) for f in factor]

I guess another approach would be to add an 'emissive strength' property to the gltf2 format, but the spec for that doesn't mention any limits for emissive color so maybe this is the way it's supposed to be done?

Bye, Mark

scurest commented 2 years ago

The spec limits emissiveFactor to the 0-1 range

Each element in the array MUST be greater than or equal to 0 and less than or equal to 1. [5.19.8 material.emissiveFactor]

But there's a KHR_materials_emissive_strength.

blitz-research commented 2 years ago

Ok, after years of chin-stroking, looks like glTF2 people are about to add a KHR_materials_emissive_strength extension, guess this is the 'right' way to do it so I'll just stick with my hack for now but it'd be nice to see support for this added eventually.

julienduroure commented 2 years ago

I confirm that KHR_materials_emissive_strength will be supported soon.

julienduroure commented 2 years ago

Will be fixed by #1646