mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 13:11:57 -04:00
Filtered cloud texture to remove noise.
This commit is contained in:
parent
c0f4807d88
commit
f15af40729
|
@ -143,7 +143,7 @@ class Applet(pyglet.window.Window):
|
|||
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST)
|
||||
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST)
|
||||
|
||||
glAlphaFunc(GL_GEQUAL, 0.9)
|
||||
glAlphaFunc(GL_GEQUAL, 0.2)
|
||||
glDepthFunc(GL_LEQUAL)
|
||||
glEnable(GL_DEPTH_TEST)
|
||||
glShadeModel(GL_SMOOTH)
|
||||
|
@ -338,12 +338,14 @@ class Applet(pyglet.window.Window):
|
|||
if self.cloud and hasattr(entity, 'cloudmap') and entity.cloudmap:
|
||||
glPushMatrix()
|
||||
glEnable(GL_BLEND)
|
||||
glEnable(GL_ALPHA_TEST)
|
||||
glTranslatef(*entity.location)
|
||||
pitch, yaw, roll = entity.rotation
|
||||
glRotatef(pitch, 1, 0, 0)
|
||||
glRotatef(yaw, 0, 1, 0)
|
||||
glRotatef(roll, 0, 0, 1)
|
||||
glCallList(entity.cloudmap)
|
||||
glDisable(GL_ALPHA_TEST)
|
||||
glDisable(GL_BLEND)
|
||||
glPopMatrix()
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ def load_clouds(file):
|
|||
|
||||
glBindTexture(GL_TEXTURE_2D, id)
|
||||
|
||||
filter = GL_NEAREST if badcard else GL_LINEAR
|
||||
filter = GL_LINEAR
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, str(pixels))
|
||||
|
|
Loading…
Reference in a new issue