Is it possible to disable the specular component of a light source rather than in materials?
In 3ds max you have the ability to disable speculars per-light, which is very handy when you only want the diffuse effect of the light for faking effects like global illumination.
Disabling speculars in materials means I will lose speculars from lights that I actually want to generate speculars, so I’m looking for some kind of solution.
In BabylonJS Sandbox I see that pointlights have this specular colour slot, and I thought it could remove speculars by making it completely black, but setting it to black has no effect on the speculars it seems.
Here is an example of what happens if I reduce the specular in BabylonJS Sanbox editor. As you can see the specular in the window disappears when I turn of the light, but reducing the specular colour to black does not affect the specular at all:
As for the BabylonJS exporter for 3ds max, it would be nice if when exporting lightsources with Specular turned off under Advanced Effects the exporter will produce a lightsource with black speculars.
That change would’nt bring much in my opinion, since specular only works with the point light. I’m even not too sure why we have this (without a specular power). This all feels a bit clumsy and doesn’t make much sense to me. Currently, the scenario is that the materials have a specular color and power. The light is a light and the specularity comes from the materials the light is casted on. That I can understand.
On the other hand, I admit it would eventually come in handy to set these properties on a light, but then it should work for all lights (not just the point light).
Because WebGL can be a limited environment in terms of what you can put in there, faking stuff like global illumination or diffuse light using pointlights is oldschool, but it works. But it also requires the specular component to be off for the approach to be flexible and convincing enough visually.
I am currently working on a project that utilizes this approach and it can really improve the lighting of the scene by very cheap means. A highly dynamic environment would not be suitable for such approach, but that is not what my project is about.
Yup. I totally understand why you are asking for this and why you are using it with a point light.
All I’m saying is that at the end of day, some sort of consitency will be required in the way we handle lights (and exports from Blender, max or else…)
I looked at this, and there is no problem with the Inspector, it is reflecting the changes correctly in scene. The white shown the in the gif isn’t coming from the specular, but from the diffuse component.
The same example I showed in a previous post, rewritten with PBR materials, looks the same as your gif: Point Lights | Babylon.js Playground (babylonjs.com) (the lights are a bit hard to see but they are there, and they look the same no matter the specular color that was set). I think PBR materials calculate lights in a different way, so I’ll tag @sebavan to take a look if the rendering is all right.
I believe solving your issue would mean implementing a completely different approach for lighting.
As I said, it would be handy in some cases and 3d apps eventually allow you to do this but understand that it would most certainly mean a lot of work. There are still workarounds that could be acceptable I believe. What if you set a same id to all your materials you want to react the same with specular. You could next call on this id to have them all set at once. If you are using PBR, you can also act on directIntensity which I believe should not be affected too much by a point or hemi. Last, the only thing I can see is to exclude them from this light. Eventually include them in a softer copy of this light or a light with a different angle that will not all too much catch the specular (though, it will add one more light so it’s not the best in terms of performance. I’m afraid these are the only options available as of just now.