Falloff lights support

If I’m not mistaken, Both Collada and glTF formats support fallOffAngle and falloffExponent.

Does three-js lights supports this feature?

Can you please add a little bit more details to your post? Are you talking about spotlights?

ColladaLoader definitely does not parse such properties. I’m sure @donmccurdy can say something about the current status of GLTFLoader in this context.

Sure

This is the same model in blend4web and in three-js

If you’ll look closely on the blend4web example you’ll see that the texture color is changing according to the camera normal, it looks slightly gray when the camera angle is high.

You can find glTF github fallOffAngle mentioned on here and here

Um, it seems both links are identical.

Sorry about that, here is the three-js one.

Why do you think the different shading between three.js and blend4web has something to do with these parameters? AFAIK, fallOffAngle and falloffExponent are only focused on spotlights. If your render a scene with let’s say a hemisphere and directional light, these parameters are irrelevant.

BTW: Can you please share the glTF model? I was not able to render the glb extracted from the networking module in the following viewers:

https://gltf-viewer.donmccurdy.com/
https://sandbox.babylonjs.com/

The glTF file in your link does not contain any lights. Lights that glTF 2.0 supports are defined in KHR_lights_punctual, what you see about KHR_materials_common is from glTF 1.0.

Assuming you’re talking about spot lights (this is still not clear from your question?), glTF 2.0 has an innerConeAngle and outerConeAngle property. three.js supports that via two properties, angle and penumbra, which can be used to get the same results.

I don’t recall what falloffExponent does exactly, but I think it is similar to penumbra, and no longer needed with the inner/outer angles.

Sure can:
458791351443612901.zip (1.1 MB)

If you wish to test this model on babylonjs sandbox be sure to toggle off the Ambient texture channel as AO makes models dark on babylonjs when using substance painter to export glTF.

After testing on https://gltf-viewer.donmccurdy.com/ I think I do see
the effect that the 3D manager was looking for (I’ll be sure to ask here tomorrow).

Looks like you may be right, this viewer is achieving that effect by moving the directional light with the camera.
That way it looks like the light intensity is calculated from the normal of the camera.

I guess what I have to do if I want to achieve this effect is just copy the position of the directional light from the camera’s position on each frame.

I guess that would work with spot light as well.

I’ll keep this thread posted in case I’m wrong about the falloff effect but I think that’s what the 3D artists was looking for.

Appreciate your help @donmccurdy @Mugen87

Update:

After implementing according to the conclusions above here terns out that’s not exactly the desired falloff effect.

This is 3DS MAX falloff implementation and explanation.

As you can see you can define many falloff parameters including the colors of the effect according to the normal witch will be impractical to implement with lights only.

Here is a three-js example for velvet falloff implementation though it utilize some third party repository witch kind of running and gets render outside of three-js and of course the shaders are not supported on glTF so real world use cases are problematic.