# Sphere as light source

Hi!

Is it possible somehow add a spot light inside a sphere and make the sphere act like a light source?

Edit: Point light!

1 Like

It seems to me it should work putting a point light inside a sphere. But Iām a beginner and donāt know.

You can use emissive material and bloom and bloomhdr to make the effect more dramatic and noticed.

I sure wish people would answer questions instead of going off on tangents unrelated to the question. It makes this board useful for those to come in the future who are trying to solve problems. Movie comments make me want to look elsewhere and not on this board.

Hereās an example, note the DiffEmissive. This is with a lit material and light outside the sphere.

@lheller Do you mean area lights or would a light mask (or even near clip) be enough?

Create a node and add a StaticModel and a Light component to it. For the staticModel use Sphere.mdl resource and thatās about it.

Why would you put a spotlight (which has Direction) inside a sphere, then try to model a spherical light, when a point light represents a light with āallā directions (a spherical light)?
Are you looking for a spherical light which is more intense in a particular direction?
Iām confused

If Iām right about your wanting to model a spherical light which is more intense in some direction, you could try combining some basic lighting models - first try mixing a directional light with a spherical light, and if itās not good enough, try mixing a spotlight, and a spherical light, connected to the same parent node (so having the same world position).

1 Like

What I want to reach is to create something like a star (a celestial object).
As we know, star is a light emitting object.

Anyway, the below works well without any light (UrhoSharp code):

``````var sphere = StarNode.GetOrCreateComponent<Sphere>();
var material = Material.FromColor(Color.White);
material.CullMode = CullMode.None;
material.LineAntiAlias = true;
sphere.SetMaterial(material);
``````

Anybody a solution with point light?

Hello, yep, point light is what I want here.
But see my āsolutionā without any light.

I like pictures - even bad ones - pictures are more clear, generally, than a thousand words - please show me what you see, and just after that, describe again what your goal is, I will try to do it in my project just to make sure it works before i reply.

My goal is something like this:

I am developing a planetarium application where I also want to simulate the star magnitude.
The idea is to render small spheres with point light inside where the light range/brightness is set based on star magnitude value.

2 Likes

stop using spotlights, switch to point lights, youāll be fine, and Iām here to help

Question regarding these lights: do you need these starts to light some objects near it (planets and so on)? Or do you only need the starts only?
If you do not need to light any object by these starts and you just want this bloom effect around the spheres than you donāt need any light source inside the spheres (and you will save a lot of performance) - only special material is required for these starts and bloom post-processing effect.

2 Likes

I already switched to point lights.
But now I think @guk_alex suggested a better solution.

Hello @guk_alex

No, I donāt need to light near objects.

Can u pls give a short example only with one sphere and such material and that bloom effect?

many hands, make light work

I3DB mention it here: Sphere as light source
Material you looking for is DiffEmissive. And the effect is Bloom or BloomHDR.

1 Like

If your stars remain without texture you might as well use billboards instead of spheres for maximum performance.

1 Like

@Modanung
OK, but how to make one billboard component look like a sphere (or at least a circle) ?

Simply assign a material with a circle as texture - which can be made in a few clicks using GIMP - and some unlit or additive Diff technique to the billboards.

@Modanung

Did it, and used DiffAdd technique for billboardsetās material.
But unfortunately only some of the circles are glowing. Like on the screenshot.

I need all the circles glowing.
Any idea?

Maybe you could incorporate the glow into the circle image? Or use two billboards per star, one unlit opaque and one additive.

1 Like