mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 13:11:57 -04:00
Added a diffuse texture on the sun.
This commit is contained in:
parent
b2ec3ef2b3
commit
c7cee9a471
|
@ -86,14 +86,14 @@ def flare(rinner, router, res, prob, tex):
|
||||||
last_y = 0
|
last_y = 0
|
||||||
last_theta = 0
|
last_theta = 0
|
||||||
factor = TWOPI / res
|
factor = TWOPI / res
|
||||||
rdelta = (router - rinner) * 5
|
rdelta = (router - rinner)
|
||||||
glBegin(GL_QUADS)
|
glBegin(GL_QUADS)
|
||||||
for i in xrange(res + 1):
|
for i in xrange(res + 1):
|
||||||
theta = last_theta + factor
|
theta = last_theta + factor
|
||||||
x = cos(theta)
|
x = cos(theta)
|
||||||
y = sin(theta)
|
y = sin(theta)
|
||||||
if random() > prob:
|
if random() > prob:
|
||||||
distance = router + rdelta * random()
|
distance = rinner + rdelta * random()
|
||||||
avg_theta = (last_theta + theta) / 2
|
avg_theta = (last_theta + theta) / 2
|
||||||
x0, y0 = rinner * last_x, rinner * last_y
|
x0, y0 = rinner * last_x, rinner * last_y
|
||||||
x1, y1 = rinner * x, rinner * y
|
x1, y1 = rinner * x, rinner * y
|
||||||
|
|
|
@ -23,9 +23,11 @@
|
||||||
"rotation": 2164320,
|
"rotation": 2164320,
|
||||||
"atmosphere": {
|
"atmosphere": {
|
||||||
"corona_texture": "sun_corona.png",
|
"corona_texture": "sun_corona.png",
|
||||||
"corona_size": 300,
|
"corona_size": 1500,
|
||||||
"corona_division": 100,
|
"corona_division": 100,
|
||||||
"corona_prob": 0.5
|
"corona_prob": 0.5,
|
||||||
|
"diffuse_texture": "sun_diffuse.png",
|
||||||
|
"diffuse_size": 300
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mercury": {
|
"mercury": {
|
||||||
|
|
|
@ -151,7 +151,8 @@ def load_world(file):
|
||||||
corona_ratio = atmosphere_data.get('corona_ratio', 0.5)
|
corona_ratio = atmosphere_data.get('corona_ratio', 0.5)
|
||||||
corona_id = compile(flare, radius, radius + corona_size, corona_division,
|
corona_id = compile(flare, radius, radius + corona_size, corona_division,
|
||||||
corona_ratio, corona)
|
corona_ratio, corona)
|
||||||
elif atm_texture is not None:
|
|
||||||
|
if atm_texture is not None:
|
||||||
cheap, _, atm_texture = get_best_texture(atm_texture)
|
cheap, _, atm_texture = get_best_texture(atm_texture)
|
||||||
if not cheap:
|
if not cheap:
|
||||||
atmosphere_id = compile(disk, radius, radius + atm_size, 30, atm_texture)
|
atmosphere_id = compile(disk, radius, radius + atm_size, 30, atm_texture)
|
||||||
|
|
Loading…
Reference in a new issue