diff --git a/punyverse/entity.py b/punyverse/entity.py index 6f01352..877a5b1 100644 --- a/punyverse/entity.py +++ b/punyverse/entity.py @@ -246,6 +246,7 @@ class SphericalBody(Body): self.radius = world.evaluate(info.get('radius', world.length)) / world.length division = info.get('division', max(min(int(self.radius / 8), 60), 10)) + self.light_source = info.get('light_source', False) texture = get_best_texture(info['texture']) self.sphere_id = compile(sphere, self.radius, division, division, texture) @@ -291,7 +292,9 @@ class SphericalBody(Body): get_best_texture(info['ring'].get('texture', None))) def _draw_sphere(self): - with glMatrix(self.location, self.rotation), glRestore(GL_CURRENT_BIT): + with glMatrix(self.location, self.rotation), glRestore(GL_CURRENT_BIT | GL_ENABLE_BIT): + if self.light_source: + glDisable(GL_LIGHTING) glCallList(self.sphere_id) def _draw_atmosphere(self, cam, glMatrixBuffer=GLfloat * 16): diff --git a/punyverse/world.json b/punyverse/world.json index 0274c57..9cd13f3 100644 --- a/punyverse/world.json +++ b/punyverse/world.json @@ -21,6 +21,7 @@ "yaw": 7.25, "mass": 1.9891e+30, "rotation": 2164320, + "light_source": true, "atmosphere": { "corona_texture": "sun_corona.png", "corona_size": 1500,