Sign in to follow this  

Visible Light Sources (Sun)

This topic is 4514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Well there's really no code I can post that would address my current issue.

I'm trying to figure out how I can make my mesh appear yellow when lighting is disabled. I tried coloring the vectors in my mesh via Truespace, yet it is still white. Materials are useless in an environment with no lighting, so I can't depend on materials to make the sphere yellow when I disable lighting.

Share this post


Link to post
Share on other sites
Try leaving lighting enabled, turn off all your lights and just set a value for an ambient light to get your material to light up the way you want it.

Share this post


Link to post
Share on other sites
Quote:
Original post by PAiNIC
Try leaving lighting enabled, turn off all your lights and just set a value for an ambient light to get your material to light up the way you want it.


Exactly. AFAIK, a material won't show up without lighting.

Share this post


Link to post
Share on other sites
So far I've only been able to accomplish what I need via the following method:

1) Create a directional light that is positioned at the exact eye position of the camera, and emitting towards the camera's lookat position. This light is initially disabled.
2) Create a point light at the center of the sun (sphere). This light is initially enabled.
3) Enable the directional light.
4) Draw the sun.
5) Disable the directional light.
6) Draw the other planets.


Using the above steps provides a way to light up the part of the sun that is facing the camera, giving the appearance that the entire sphere is lit up. Since the camera basically has an orthogonal view of the light emission from the sun, you really won't see any shading on the side if the light is bright enough and if the material has a high enough emission.

I guess this will have to do for now. Thanks for your help everyone.

Share this post


Link to post
Share on other sites
The way I did it was, disable lighting and set the Diffuse/Ambient/Emssion to full yellow, it worked here.

Share this post


Link to post
Share on other sites
Sign in to follow this