Release 1.1 with higher resolution textures.
After all, it doesn't exactly make sense for saturn's moons and mercury to have more detailed textures than larger objects like the sun or venus. Also used one single texture to do the transparency mask for the glow, instead of having separate textures for each glowy object.
|
@ -1,7 +1,9 @@
|
||||||
# This file contains all the textures that is bigger than the minimum OpenGL texture size
|
# This file contains all the textures that is bigger than the minimum OpenGL texture size
|
||||||
# and hence may need to be resized depending on the machine
|
# and hence may need to be resized depending on the machine
|
||||||
|
|
||||||
|
sun.jpg
|
||||||
mercury.jpg
|
mercury.jpg
|
||||||
|
venus.jpg
|
||||||
earth.jpg
|
earth.jpg
|
||||||
earth_normal.jpg
|
earth_normal.jpg
|
||||||
earth_emission.jpg
|
earth_emission.jpg
|
||||||
|
@ -11,6 +13,8 @@ moon.jpg
|
||||||
mars.jpg
|
mars.jpg
|
||||||
jupiter.jpg
|
jupiter.jpg
|
||||||
saturn.jpg
|
saturn.jpg
|
||||||
|
uranus.jpg
|
||||||
|
neptune.jpg
|
||||||
sky_px.jpg
|
sky_px.jpg
|
||||||
sky_py.jpg
|
sky_py.jpg
|
||||||
sky_pz.jpg
|
sky_pz.jpg
|
||||||
|
|
Before Width: | Height: | Size: 114 B |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.9 KiB |
BIN
punyverse/assets/textures/glow.png
Normal file
After Width: | Height: | Size: 98 B |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 981 KiB |
|
@ -388,8 +388,9 @@ class SphericalBody(Body):
|
||||||
|
|
||||||
if 'atmosphere' in info:
|
if 'atmosphere' in info:
|
||||||
atmosphere_data = info['atmosphere']
|
atmosphere_data = info['atmosphere']
|
||||||
atm_size = world.evaluate(atmosphere_data.get('diffuse_size', None))
|
atm_size = world.evaluate(atmosphere_data.get('glow_size', None))
|
||||||
atm_texture = atmosphere_data.get('diffuse_texture', None)
|
atm_texture = atmosphere_data.get('glow_texture', None)
|
||||||
|
atm_color = atmosphere_data.get('glow_color', None)
|
||||||
cloud_texture = atmosphere_data.get('cloud_texture', None)
|
cloud_texture = atmosphere_data.get('cloud_texture', None)
|
||||||
if cloud_texture is not None:
|
if cloud_texture is not None:
|
||||||
self.cloud_transparency = get_best_texture(cloud_texture, loader=load_alpha_mask)
|
self.cloud_transparency = get_best_texture(cloud_texture, loader=load_alpha_mask)
|
||||||
|
@ -405,8 +406,9 @@ class SphericalBody(Body):
|
||||||
self.clouds.stride, self.clouds.uv_offset)
|
self.clouds.stride, self.clouds.uv_offset)
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0)
|
glBindBuffer(GL_ARRAY_BUFFER, 0)
|
||||||
|
|
||||||
if atm_texture is not None:
|
if atm_texture is not None and atm_color is not None:
|
||||||
self.atm_texture = load_texture_1d(atm_texture, clamp=True)
|
self.atm_texture = load_texture_1d(atm_texture, clamp=True)
|
||||||
|
self.atm_color = atm_color
|
||||||
self.atmosphere = Disk(self.radius, self.radius + atm_size, 30)
|
self.atmosphere = Disk(self.radius, self.radius + atm_size, 30)
|
||||||
self.atmosphere_vao = VAO()
|
self.atmosphere_vao = VAO()
|
||||||
shader = self.world.activate_shader('atmosphere')
|
shader = self.world.activate_shader('atmosphere')
|
||||||
|
@ -513,7 +515,8 @@ class SphericalBody(Body):
|
||||||
shader.uniform_mat4('u_mvpMatrix', self.world.projection_matrix() * matrix)
|
shader.uniform_mat4('u_mvpMatrix', self.world.projection_matrix() * matrix)
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_1D, self.atm_texture)
|
glBindTexture(GL_TEXTURE_1D, self.atm_texture)
|
||||||
shader.uniform_texture('u_texture', 0)
|
shader.uniform_texture('u_transparency', 0)
|
||||||
|
shader.uniform_vec3('u_color', *self.atm_color)
|
||||||
|
|
||||||
with self.atmosphere_vao:
|
with self.atmosphere_vao:
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, self.atmosphere.vertex_count)
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, self.atmosphere.vertex_count)
|
||||||
|
|
|
@ -3,8 +3,10 @@
|
||||||
in float v_u;
|
in float v_u;
|
||||||
|
|
||||||
out vec4 o_fragColor;
|
out vec4 o_fragColor;
|
||||||
uniform sampler1D u_texture;
|
|
||||||
|
uniform vec3 u_color;
|
||||||
|
uniform sampler1D u_transparency;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
o_fragColor = texture(u_texture, v_u);
|
o_fragColor = vec4(u_color, texture(u_transparency, v_u).r);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"distance": "virtual distance to look better, in km",
|
"distance": "virtual distance to look better, in km",
|
||||||
"sma": "semi-major axis used with mass of parent to calculate orbit, in km",
|
"sma": "semi-major axis used with mass of parent to calculate orbit, in km",
|
||||||
"mass": "mass in kg",
|
"mass": "mass in kg",
|
||||||
"texture": "a group of texture to use, tried in that order. a list means a colour",
|
"texture": "a group of texture to use, tried in that order",
|
||||||
"model": "used to load a wavefront object instead of a textured sphere"
|
"model": "used to load a wavefront object instead of a textured sphere"
|
||||||
},
|
},
|
||||||
"au": 10000,
|
"au": 10000,
|
||||||
|
@ -24,8 +24,9 @@
|
||||||
"light_source": true,
|
"light_source": true,
|
||||||
"type": "star",
|
"type": "star",
|
||||||
"atmosphere": {
|
"atmosphere": {
|
||||||
"diffuse_texture": "sun_diffuse.png",
|
"glow_color": [0.92, 0.92, 0.82],
|
||||||
"diffuse_size": 300
|
"glow_texture": "glow.png",
|
||||||
|
"glow_size": 300
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mercury": {
|
"mercury": {
|
||||||
|
@ -61,8 +62,9 @@
|
||||||
"emission_map": ["earth_emission.jpg", "earth_emission_medium.jpg", "earth_emission_small.jpg"],
|
"emission_map": ["earth_emission.jpg", "earth_emission_medium.jpg", "earth_emission_small.jpg"],
|
||||||
"atmosphere": {
|
"atmosphere": {
|
||||||
"cloud_texture": ["cloudmap.jpg", "cloudmap_small.jpg"],
|
"cloud_texture": ["cloudmap.jpg", "cloudmap_small.jpg"],
|
||||||
"diffuse_texture": "atmosphere_earth.png",
|
"glow_color": [0.11, 0.32, 0.43],
|
||||||
"diffuse_size": 30
|
"glow_texture": "glow.png",
|
||||||
|
"glow_size": 30
|
||||||
},
|
},
|
||||||
"orbit_distance": "AU",
|
"orbit_distance": "AU",
|
||||||
"satellites": {
|
"satellites": {
|
||||||
|
|