A light that does not emit from a point

Godot 4.2

This is a retro fps. This post is more a recommendation for the engine more than a question; however, if anyone reading this knows a way to do this with the shaders, you are welcome to tell me how to do it.

A Geometric Based Lighting Node Would End a Lot of My Frustrations:

It would be really nice to have the ability to create a 3D light that does not emit from a point. This light would rather come in the form of some kind of a PolygonShape3D. Anything inside of that shape will be illuminated. This light would not be able to cast any kind of shadows. This kind of lighting would not be fancy in any kind of way, shape or form.

You may think of this kind of lighting system as being similar to the lighting of a sector in the Doom Engine or in the Build Engine. The light does not come from a point. Simply put, anything in the light’s shape will be illuminated.

An optional blurred effect along the parameter of the shape would be good too, especially for lighting up a map. For an example: We have a room that is all one mesh and we only want one side of the room to be lit this blurring effect along the parameter of the geometric light would look better than a hard line between what is lit up and what is in darkness.

For a retro kind of game this would be super useful. Those omni lights are the bane of my existence right now. My maps are all one object imported from blender and lighting tends to break down when you go above 8 lights per an object, or so I have read; so I am in the middle of figuring my way through that right now but that is not what this post is about.

I am not skilled enough to make an addon that can do this geometric based lighting and I have too little experience with shaders to figure out a way anyway. I thought I found a video that did this which was about volumetric lights but that was not it. That was just an additional effect.

Your description is not really clear. Can you make a mock up in Blender and post it? Or a screenshot of an existing game that uses something like this.

Directional lights are not emitted from a point btw. So maybe use that.

If I understand correctly he wants localized ambient lighting inside a region defined by a polygon shape, encapsulated in a custom node3d or something.
@Thomas_Eubank is that it?

2 Likes

godot has that already.

you can give a material emission, in order for it to work then it has to be through a GI, like VoxelGI, LightmapGI, or even ReflectionProbes.
understand that this is GI, not direct light, because direct light is cheap because it’s simple, it’s a sphere (point), a cone (spot) or flat (directional).
a mesh can only work as GI because otherwise every single point on the surface would have to be calculated every frame, and it would still not look as good, or very different when it comes to scene lighting, that’s why we fake something like a light tube with point lights.

this is too many steps just for flat lighting. set it on the materials instead.

there are no lights in Id tech 1, it’s just lit or unlit surfaces. you can do the same by setting the material to unshaded and then changing the albedo color.

you want a half life 2 flashlight. I don’t think it’s coded into any default godot shaders or nodes, but could be done with a shader maybe. It really depends on your scene and what you are looking for.
that said, you can achieve the same result with point lights with shadow disabled.

I think that’s only for compat, if at all. godot doesn’t have a limit on the number of lights, and shadows get packed into an atlas.

another option is to increase the angular distance option of omnilights. this has a performance cost, but increases the size of the light, turning it into a sphere instead of a point.

In that case a shader can check if the fragment is inside the volume and write to IRRADIANCE accordingly. For parametric volumes like spheres or cones, checking against the volume would be relatively simple. For an arbitrary mesh, an additional rendering pass may be required.

@Thomas_Eubank Until we get the exact description (or a mockup) of the use case, it’s hard to give more specific suggestions.

2 Likes

If it’s a light without shadow casting, then presumably that means anything within the shape should just give the illusion of being brighter, not neccessarily a real light?

A long time ago, in Unreal Engine 4 or 5, I created a fake light effect using meshes for their shape.

I don’t know how you’d do it in Godot, but from memory it went something like:

I used an unshaded, transparent material, it was set to two-sided, and (from memory) I used a fresnel to make it appear more diffuse (like a foggy street light glow), with a variable to modify this effect.

Because it was two-sided this meant it looked like a light glow from outside the mesh, and still looked like a lit area within the mesh.

As the material was procedural and just a colour tint, it worked on any mesh so all 3D polygonal shapes probably worked (though I was only using it on spheres if memory serves). Naturally you want the mesh to be non-colliding.

Figured I’d mention it, since maybe you’re happy with fake lights if you don’t need shadows.