From 1c3abeeaa7c2ddbde52fd1452c3d269b3378269d Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 2 Nov 2013 15:07:23 -0400 Subject: [PATCH] Added a diffuse texture on the sun. --- punyverse/glgeom.py | 4 ++-- punyverse/world.json | 6 ++++-- punyverse/world.py | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/punyverse/glgeom.py b/punyverse/glgeom.py index c9e52a1..c3632f9 100644 --- a/punyverse/glgeom.py +++ b/punyverse/glgeom.py @@ -86,14 +86,14 @@ def flare(rinner, router, res, prob, tex): last_y = 0 last_theta = 0 factor = TWOPI / res - rdelta = (router - rinner) * 5 + rdelta = (router - rinner) glBegin(GL_QUADS) for i in xrange(res + 1): theta = last_theta + factor x = cos(theta) y = sin(theta) if random() > prob: - distance = router + rdelta * random() + distance = rinner + rdelta * random() avg_theta = (last_theta + theta) / 2 x0, y0 = rinner * last_x, rinner * last_y x1, y1 = rinner * x, rinner * y diff --git a/punyverse/world.json b/punyverse/world.json index 649ebf7..3e79958 100644 --- a/punyverse/world.json +++ b/punyverse/world.json @@ -23,9 +23,11 @@ "rotation": 2164320, "atmosphere": { "corona_texture": "sun_corona.png", - "corona_size": 300, + "corona_size": 1500, "corona_division": 100, - "corona_prob": 0.5 + "corona_prob": 0.5, + "diffuse_texture": "sun_diffuse.png", + "diffuse_size": 300 } }, "mercury": { diff --git a/punyverse/world.py b/punyverse/world.py index ad8ba06..aa0821a 100644 --- a/punyverse/world.py +++ b/punyverse/world.py @@ -151,7 +151,8 @@ def load_world(file): corona_ratio = atmosphere_data.get('corona_ratio', 0.5) corona_id = compile(flare, radius, radius + corona_size, corona_division, corona_ratio, corona) - elif atm_texture is not None: + + if atm_texture is not None: cheap, _, atm_texture = get_best_texture(atm_texture) if not cheap: atmosphere_id = compile(disk, radius, radius + atm_size, 30, atm_texture)