Visible Light Sources (Sun)

Started by
13 comments, last by Daggett 18 years, 7 months ago
I'm creating a 3D solar system. I'm keeping this very simple. My planets are nothing more than colored spheres created in Truespace and saved as *.X files. I want the Sun to be actually lit up, like a light bulb, and the other planets should receive light from it. I tried placing a point light in the middle (inside) of the sun, yet this caused no light emission at all. Any tips? Thanks :)
Advertisement
If all you want is simple lighting, a point light 'inside' the sun should do it..
If you're not getting any light out of it it's probably another problem...

maybe your light is misconfigured?
do you have any normals on the spheres? are you sure they are correct?
do you have lighting enabled?
maybe you're using a bad material?
As I stated, the mesh is created in Truespace and normals are automatically saved to the X file.

The sphere is yellow, and when the light is in the middle of the mesh, the mesh looks like a faint yellow circle on the screen rather than a 3D sphere. I think it is trying to be lit up, yet it doesn't appear correctly. It should be a brighter yellow.
I find it weird that it shows any yellow at all..
Your mesh normals are pointing outwards the sphere, so if you create a light inside the sphere it won't be affect the sun.

So if I were you, I'd create a material for the sun with a yellow value for the Emissive component of that material. For the other meshes however, I'd use the diffuse component of other materials.
Perhaps a screenshot or sample code? Troubleshooting problems like this can be difficult with descriptions.

ProgrammingNerd
Here are the screenshots.

This screenshot is when the light is INSIDE of the mesh
http://img.photobucket.com/albums/v356/MrDoomMaster/SS014.jpg


This screenshot is the point light 10 units away from the mesh object
http://img.photobucket.com/albums/v356/MrDoomMaster/SS013.jpg


Also, I have tried enabling material emission, yet this does nothing in my DirectX Application.
turn off lighting for the sun - as it is represents the light source it should be 100% bright all the time. What you are seeing as the light trying to illuminate a triangle/vertex pointing away from it, so it gets very little light.
Quote:Original post by MrDoomMaster
This screenshot is when the light is INSIDE of the mesh
http://img.photobucket.com/albums/v356/MrDoomMaster/SS014.jpg
Yes.
Quote:Original post by MrDoomMaster
This screenshot is the point light 10 units away from the mesh object
http://img.photobucket.com/albums/v356/MrDoomMaster/SS013.jpg
Yes.

Your screenshots look correct. Kamikaze15 explained what is happening and what the solution is.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Well I disable lighting only to find that my sphere is colored white. It should be yellow.
Hi,

Post some revelant source code. It could shed some light on the problem.

ProgrammingNerd

This topic is closed to new replies.

Advertisement