Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Is there a way to make colored lights with <1 falloff that do not have white colored radius borders around them? If I have a red light, there seems to always be a gradual fade into white colored lighting. I may not have set up the engine in my game correctly, but after tweaking all the different settings it seems as if the color begins in the center strong, but then gradually turns white the further out you look. 

Do you have any screenshot examples to show exactly what you mean?

The light attenuation model is uses an easing function to soften the area where the falloff occurs.  You could edit it in the shaders to use another easing function.

For example, in the fragment shader of shd_light_ss_hlsl on line 189 the easing is done by:

float edge = sin((1.0 - smoothstep(focus, radius + 1.0, light_len)) * M_PI_2);

You could keep just:

float edge = smoothstep(focus, radius + 1.0, light_len);

That would remove the easing and might get what you want.

Thanks for this. I tried it but the lights became extremely dulled down. I had to pump up their intensity, and even then it did not look very bright. 

If you want an idea of what I'm suggesting, look at the le_light_fire object in the example project. There is a red glow on the ground at the center of the light object, but as it moves outwardly, the glow turns white. 

I'm also wondering if this is an issue with the underlying material map that is being used. When I use the same light on another more metal material map the white ring disappears.

(+1)

I might be the ambient occlusion value of your material.

I'll look at the fire object too.