- Home /
Modeling the sun - internal light
Dear all, I am currently working on a game about the solar system. The setting is the solar system itself, in which a spaceship can travel. I have modeled the sun as a Unity primitive sphere and I added a light inside it (so as to make it the main light source in the system). The other planets are correctly illuminated, but the outer face of the sun remains dark. How can I make the sun completely lit up (like you would imagine it to be: a ball of light)? Is there a better way of modeling the sun?
Thanks for your support.
Answer by Peter G · Nov 28, 2010 at 01:08 PM
You probably want to use a self-illuminated shader. It uses the alpha value of your texture to determine how lit the object is. This is especially useful if you are using Pro, and you have objects that don't move, then you can bake the illumination into them without having to use a point light.
But, if you really want the entire object lit up all the way, the most efficient way would be to make a shader w/ lighting off that multiplies the texture to make it brighter. Here is an example. The Vertex-Colored iPhone shader.
Shader "iPhone/Vertex Colored" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _MainTex ("Base (RGB)", 2D) = "white" {} }
SubShader { ZWrite On Pass { ColorMaterial AmbientAndDiffuse Lighting Off SeparateSpecular On SetTexture [_MainTex] { Combine texture primary, texture primary } SetTexture [_MainTex] { constantColor [_Color] Combine previous constant DOUBLE, previous constant } } }
}
P.S. I think I removed some properties from the shader. I just copied this out of my current project, and I think I removed the emissive and specular and such. You can add them back in and it should work fine if you need them.
Thanks for your suggestion. I think I will have a look at self-illu$$anonymous$$ated shaders, which seem to be effective enough.
Your answer
![](https://koobas.hobune.stream/wayback/20220613084832im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D solarsystem lighting 0 Answers
Pointlight casting bright dot on textured walls 0 Answers
How to detect whether or not my player is in the sun? 0 Answers
Strange Shadow Boxes or X's Appear on the Terrain When I Add Lights 1 Answer
How to turn off sun effect of directional lighting (in augmented reality)? 0 Answers