Sphere as light source

#1

Hi!

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

Edit: Point light! :wink:

1 Like
#4

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.

Also check out the billboards sample and the use of lights.

#5

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

#6

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.

#7

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 :slight_smile:

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
#8

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;
material.SetTechnique(0u, CoreAssets.Techniques.NoTextureVColAddAlpha);
sphere.SetMaterial(material);

Anybody a solution with point light?

#9

Hello, yep, point light is what I want here.
But see my “solution” without any light.

#10

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.

#12

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
#13

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

#14

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
#15

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

#16

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?

#17

many hands, make light work

#18

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

1 Like
#19

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

1 Like
#20

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

#21

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.

#22

@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?

#23

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