Author: ArcRiley
Date: 2007-07-03 21:08:03 -0400 (Tue, 03 Jul 2007)
New Revision: 333
Added:
trunk/pysoy/tests/l.png
trunk/pysoy/tests/la.png
trunk/pysoy/tests/rgba.png
Modified:
trunk/pysoy/src/textures/Texture.pxi
trunk/pysoy/tests/tex_pyramid.py
Log:
alpha blending..
Modified: trunk/pysoy/src/textures/Texture.pxi
===================================================================
--- trunk/pysoy/src/textures/Texture.pxi 2007-07-04 01:05:49 UTC (rev
332)
+++ trunk/pysoy/src/textures/Texture.pxi 2007-07-04 01:08:03 UTC (rev
333)
@@ -118,6 +118,11 @@
gl.glEnable(gl.GL_TEXTURE_3D)
else :
return
+ if self._chans & 1 :
+ gl.glDisable(gl.GL_BLEND)
+ else :
+ gl.glEnable(gl.GL_BLEND)
+ gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)
if self._textureID == 0 :
gl.glGenTextures(1, &self._textureID)
gl.glBindTexture(self._textureTarget, self._textureID)
Added: trunk/pysoy/tests/l.png
===================================================================
(Binary files differ)
Property changes on: trunk/pysoy/tests/l.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/pysoy/tests/la.png
===================================================================
(Binary files differ)
Property changes on: trunk/pysoy/tests/la.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/pysoy/tests/rgba.png
===================================================================
(Binary files differ)
Property changes on: trunk/pysoy/tests/rgba.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/pysoy/tests/tex_pyramid.py
===================================================================
--- trunk/pysoy/tests/tex_pyramid.py 2007-07-04 01:05:49 UTC (rev 332)
+++ trunk/pysoy/tests/tex_pyramid.py 2007-07-04 01:08:03 UTC (rev 333)
@@ -10,6 +10,9 @@
img = Image.open('arc.png')
face = soy.textures.Image(img)
+img = Image.open('rgba.png')
+luma = soy.textures.Image(img)
+
scr = soy.Screen()
win = soy.Window(scr, 'Simulation Test')
@@ -19,8 +22,8 @@
ca1 = soy.widgets.Canvas(win, size=(300,220), position=(10,10), texture=lava)
pro = soy.widgets.Projector(win, size=(280, 200), position=(20,20), camera=cam)
-ca2 = soy.widgets.Canvas(win, size=(64,96), position=(100,100), texture=face)
-pyr = soy.bodies.Pyramid(sce, face)
+ca2 = soy.widgets.Canvas(win, size=(64,96), position=(25,25), texture=face)
+pyr = soy.bodies.Pyramid(sce, luma)
pyr.rotation = (1.0, 1.0, 0.0)
if __name__ == '__main__' :
_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn