pyopengl-users Mailing List for PyOpenGL (Page 42)
Brought to you by:
mcfletch
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(81) |
Oct
(41) |
Nov
(55) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(34) |
Feb
(3) |
Mar
(16) |
Apr
(5) |
May
(10) |
Jun
(13) |
Jul
(24) |
Aug
(14) |
Sep
(14) |
Oct
(9) |
Nov
(10) |
Dec
(16) |
2003 |
Jan
(25) |
Feb
(59) |
Mar
(9) |
Apr
(21) |
May
(54) |
Jun
(4) |
Jul
(16) |
Aug
(19) |
Sep
(19) |
Oct
(15) |
Nov
(13) |
Dec
(22) |
2004 |
Jan
(19) |
Feb
(8) |
Mar
(20) |
Apr
(16) |
May
(13) |
Jun
(18) |
Jul
(18) |
Aug
(14) |
Sep
(24) |
Oct
(47) |
Nov
(20) |
Dec
(10) |
2005 |
Jan
(23) |
Feb
(31) |
Mar
(11) |
Apr
(29) |
May
(18) |
Jun
(7) |
Jul
(11) |
Aug
(12) |
Sep
(8) |
Oct
(4) |
Nov
(11) |
Dec
(7) |
2006 |
Jan
(7) |
Feb
(8) |
Mar
(15) |
Apr
(3) |
May
(8) |
Jun
(25) |
Jul
(19) |
Aug
(3) |
Sep
(17) |
Oct
(27) |
Nov
(24) |
Dec
(9) |
2007 |
Jan
(6) |
Feb
(43) |
Mar
(33) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(8) |
Sep
(11) |
Oct
(22) |
Nov
(15) |
Dec
(18) |
2008 |
Jan
(14) |
Feb
(6) |
Mar
(6) |
Apr
(37) |
May
(13) |
Jun
(17) |
Jul
(22) |
Aug
(16) |
Sep
(14) |
Oct
(16) |
Nov
(29) |
Dec
(13) |
2009 |
Jan
(7) |
Feb
(25) |
Mar
(38) |
Apr
(57) |
May
(12) |
Jun
(32) |
Jul
(32) |
Aug
(35) |
Sep
(10) |
Oct
(28) |
Nov
(16) |
Dec
(49) |
2010 |
Jan
(57) |
Feb
(37) |
Mar
(22) |
Apr
(15) |
May
(45) |
Jun
(25) |
Jul
(32) |
Aug
(7) |
Sep
(13) |
Oct
(2) |
Nov
(11) |
Dec
(28) |
2011 |
Jan
(35) |
Feb
(39) |
Mar
|
Apr
(25) |
May
(32) |
Jun
(17) |
Jul
(29) |
Aug
(10) |
Sep
(26) |
Oct
(9) |
Nov
(28) |
Dec
(4) |
2012 |
Jan
(24) |
Feb
(47) |
Mar
(4) |
Apr
(8) |
May
(9) |
Jun
(6) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(28) |
Nov
(2) |
Dec
(2) |
2013 |
Jan
(11) |
Feb
(3) |
Mar
(4) |
Apr
(38) |
May
(15) |
Jun
(11) |
Jul
(15) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(3) |
Dec
(14) |
2014 |
Jan
(24) |
Feb
(31) |
Mar
(28) |
Apr
(16) |
May
(7) |
Jun
(6) |
Jul
(1) |
Aug
(10) |
Sep
(10) |
Oct
(2) |
Nov
|
Dec
|
2015 |
Jan
(6) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(19) |
Dec
|
2016 |
Jan
(6) |
Feb
(1) |
Mar
(7) |
Apr
|
May
(6) |
Jun
|
Jul
(3) |
Aug
(7) |
Sep
|
Oct
(2) |
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2018 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: David M. <dvm...@gm...> - 2010-01-13 20:49:51
|
Thanks, I will definitely check that out. I appreciate your help, and I'll let you know if I have any other questions after I dig a little deeper into fonttools. Dave On Wed, Jan 13, 2010 at 1:37 PM, Mike C. Fletcher <mcf...@vr...>wrote: > David Morris wrote: > > I would like to be able to export a string of 3D extruded text as an > > OBJ or similar 3D file format, and I can't find any examples on the > > internet. > > > > I have played around with the solid_font.py demo in the > > OpenGLContext/tests/ folder, which uses FontTools to display the text, > > but I don't know how to get that mesh data back out. > It's not really set up to make it easy to get out. Each glyph that's > created has contour and outline arrays, which are extracted by > ttfquery.glyph.Glyph, but the advances and the like are all done at the > Font level (OpenGLContext.scenegraph.text._fonttools and > OpenGLContext.scenegraph.text.fonttools), without those you'd just have > characters showing up piled on top of each other. That said, there's > only maybe 1000 lines of code in all three modules, so if you want to > extract the pieces you need you could likely do it in a few hours. The > obscure stuff is all over in ttfquery, the stuff in OpenGLContext just > takes the contours for each glyph and figures out how to render them > based on a VRML97 font description. > > Good luck, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > -- Dave Morris http://dave.showviz.net/ http://3dcamphouston.com/ |
From: Mike C. F. <mcf...@vr...> - 2010-01-13 19:37:17
|
David Morris wrote: > I would like to be able to export a string of 3D extruded text as an > OBJ or similar 3D file format, and I can't find any examples on the > internet. > > I have played around with the solid_font.py demo in the > OpenGLContext/tests/ folder, which uses FontTools to display the text, > but I don't know how to get that mesh data back out. It's not really set up to make it easy to get out. Each glyph that's created has contour and outline arrays, which are extracted by ttfquery.glyph.Glyph, but the advances and the like are all done at the Font level (OpenGLContext.scenegraph.text._fonttools and OpenGLContext.scenegraph.text.fonttools), without those you'd just have characters showing up piled on top of each other. That said, there's only maybe 1000 lines of code in all three modules, so if you want to extract the pieces you need you could likely do it in a few hours. The obscure stuff is all over in ttfquery, the stuff in OpenGLContext just takes the contours for each glyph and figures out how to render them based on a VRML97 font description. Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2010-01-13 19:07:14
|
David L. Page wrote: > Mike-- > > Thanks. Yes, it is the installer that gave the warning. > > I tried downloading the zip files according to your last suggestion. > > It worked for PyOpenGL-3.0.1b2.zip but not for > PyOpenGL-accelerate-3.0.1b2.zip. Here's the output for th accelerate > attempt. > > f:\PyOpenGL-accelerate-3.0.1b2> python setup.py install > running install > running build > running build_py > running build_ext > building 'OpenGL_accelerate.wrapper' extension > Unable to import Numeric, skipping Numeric extension building > error: Unable to find vcvarsall.bat Hmm, you *should* be able to use the PyOpenGL-accelerate .exe installer, it was built with Python 2.6 (since that's the only thing that can build a binary extension for itself). PyOpenGL is cross-version, so it doesn't necessarily get built with the current version (which I think was the problem here). The source install of PyOpenGL-accelerate requires a C compiler, which is a large download for Win32 systems. HTH, Mike > > On Sun, Jan 10, 2010 at 11:38 PM, Mike C. Fletcher > <mcf...@vr... <mailto:mcf...@vr...>> wrote: > > David L. Page wrote: > > > > I am attempting to install PyOpenGL-3.0.1b2 on a Win7 system with > > Python 2.6 installed. I receive an error that msvcr71.dll was not > > found upon start of the PyOpenGL install exe. > > > > I have found online suggestions to download msvcr71.dll from various > > sites and then to copy that dll into the win system directory. For > > obvious reasons, I am unsatisfied with this solution and haven't > > attempted it. > > > > Does any else have a work around? > Hmm, that's a pain. If I'm reading correctly, there's no VC 2003 > (7.1) > redistributable download on microsoft.com <http://microsoft.com>. > So there's no official way > to redistribute it? That doesn't seem very helpful :( . > Something has > installed it to the Windows folder on my Vista machine, but I've > got the > MS Free compiler on there, which likely included it. I seem to recall > that Python 2.5 included msvcrt71.dll but that there were problems > with > redistributions of it (or something like that)... hmm, it's not > installed in the Python25 folder, so it could be that's what did the > system-level install. > > What's really weird is that PyOpenGL without the accelerator module is > pure Python... that is, it's not even compiled, it just uses ctypes to > access the dlls. Maybe in compiling one of the dlls we bundle as data > (maybe GLE?) I produced a dependency on vc7's redistributable. If you > move OpenGL/DLLS/gle32.dll and OpenGL/DLLS/glut32.dll do you still get > the message? > > Hmm, reading again, you're saying the *installer* is failing... hrmph. > Probably built the pure-python installer with Python 2.5 and it linked > to the Python 2.5 runtime... why would an installer require an > external > run-time? Sigh. Work-around would be to run the source installation > (i.e. download, unpack, run "python setup.py install") or even use > "easy_install <thezipfile>" if you want. > > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > > > > -- > David L. Page > Knoxville, Tennessee > dav...@ie... <mailto:dav...@ie...> > 865.607.8192 > -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Cata <cat...@gm...> - 2010-01-13 14:45:53
|
Hi I wanna create a radara effect with pyopengl . Something like http://www.aefreemart.com/uploaded_images/radarScreen-719485.jpg I thinking to use 2 line and blend effect ... Do you have some ideas ? Regards ! |
From: Ian M. <geo...@gm...> - 2010-01-13 05:00:59
|
Hi, Set 2D View: #if your screen is 800x600, rect = [0,0,800,600] glViewport(*rect) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(rect[0],rect[0]+rect[2],rect[1],rect[1]+rect[3]) glMatrixMode(GL_MODELVIEW) glLoadIdentity() Draw textured fullscreen quad. Make sure you bind to your texture too! param = glGetFloatv(GL_VIEWPORT) glBegin(GL_QUADS) glTexCoord2f(0,0);glVertex2f(param[0], param[1] ) glTexCoord2f(1,0);glVertex2f(param[0]+param[2],param[1] ) glTexCoord2f(1,1);glVertex2f(param[0]+param[2],param[1]+param[3]) glTexCoord2f(0,1);glVertex2f(param[0], param[1]+param[3]) glEnd() Ian |
From: Ian M. <geo...@gm...> - 2010-01-12 20:35:04
|
Best plan is to use a 2D view and then draw a quad going from (0,0) to (screen_x, screen_y). I have some code somewhere. |
From: Frédéric <fre...@gb...> - 2010-01-12 08:36:16
|
Le mardi 12 janvier 2010 08:08, Frédéric a écrit : > In fact, I have a problem with my textures. I think I mis-understood the > mapping between the textures coordinates and the space coordinates... My problem is: how do I fill the window with my texture, when neither the window nor the texture is a square? -- Frédéric http://www.gbiloba.org |
From: Frédéric <fre...@gb...> - 2010-01-12 08:08:13
|
Le vendredi 8 janvier 2010 16:10, Frédéric a écrit : > My question was more about the ratio; as you can see in the code, I > compute the mapping of the texture from the image size. But then, if I > want to load a new image with a different ratio, how do I expand/shrink > the previous one? In fact, I have a problem with my textures. I think I mis-understood the mapping between the textures coordinates and the space coordinates... Is there a simple tutorial explaining it? Thanks, -- Frédéric http://www.gbiloba.org |
From: David L. P. <pa...@gm...> - 2010-01-12 02:03:28
|
Mike-- Thanks. Yes, it is the installer that gave the warning. I tried downloading the zip files according to your last suggestion. It worked for PyOpenGL-3.0.1b2.zip but not for PyOpenGL-accelerate-3.0.1b2.zip. Here's the output for th accelerate attempt. f:\PyOpenGL-accelerate-3.0.1b2> python setup.py install running install running build running build_py running build_ext building 'OpenGL_accelerate.wrapper' extension Unable to import Numeric, skipping Numeric extension building error: Unable to find vcvarsall.bat --Dave On Sun, Jan 10, 2010 at 11:38 PM, Mike C. Fletcher <mcf...@vr...>wrote: > David L. Page wrote: > > > > I am attempting to install PyOpenGL-3.0.1b2 on a Win7 system with > > Python 2.6 installed. I receive an error that msvcr71.dll was not > > found upon start of the PyOpenGL install exe. > > > > I have found online suggestions to download msvcr71.dll from various > > sites and then to copy that dll into the win system directory. For > > obvious reasons, I am unsatisfied with this solution and haven't > > attempted it. > > > > Does any else have a work around? > Hmm, that's a pain. If I'm reading correctly, there's no VC 2003 (7.1) > redistributable download on microsoft.com. So there's no official way > to redistribute it? That doesn't seem very helpful :( . Something has > installed it to the Windows folder on my Vista machine, but I've got the > MS Free compiler on there, which likely included it. I seem to recall > that Python 2.5 included msvcrt71.dll but that there were problems with > redistributions of it (or something like that)... hmm, it's not > installed in the Python25 folder, so it could be that's what did the > system-level install. > > What's really weird is that PyOpenGL without the accelerator module is > pure Python... that is, it's not even compiled, it just uses ctypes to > access the dlls. Maybe in compiling one of the dlls we bundle as data > (maybe GLE?) I produced a dependency on vc7's redistributable. If you > move OpenGL/DLLS/gle32.dll and OpenGL/DLLS/glut32.dll do you still get > the message? > > Hmm, reading again, you're saying the *installer* is failing... hrmph. > Probably built the pure-python installer with Python 2.5 and it linked > to the Python 2.5 runtime... why would an installer require an external > run-time? Sigh. Work-around would be to run the source installation > (i.e. download, unpack, run "python setup.py install") or even use > "easy_install <thezipfile>" if you want. > > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > -- David L. Page Knoxville, Tennessee dav...@ie... 865.607.8192 |
From: David M. <dvm...@gm...> - 2010-01-11 23:29:08
|
I would like to be able to do it programmatically without having to go into Blender. Dave On Mon, Jan 11, 2010 at 5:13 PM, Ian Mallett <geo...@gm...> wrote: > Blender can make 3D fonts, and has a .obj exporter. > -- Dave Morris http://dave.showviz.net/ http://3dcamphouston.com/ |
From: Ian M. <geo...@gm...> - 2010-01-11 23:13:40
|
Blender can make 3D fonts, and has a .obj exporter. |
From: Frédéric <fre...@gb...> - 2010-01-11 14:24:39
|
Le vendredi 8 janvier 2010 15:12, Frédéric a écrit : > > It appears that the CPU is not used by my process. I'm not sure, but it > > seems to be a kernel-space usage (orange in the Gkrellm default > > theme)... > > It is 80% system usage, 20% process usage... Someone on another ml suggested me to use strace to see where the system spend all its time. But the results don't show anything usefull. During a 10s run, I get: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 91.73 0.267082 1 385350 sched_yield 2.73 0.007951 9 882 2 ioctl 1.42 0.004130 0 13364 futex 1.18 0.003442 2 2046 1744 open 1.07 0.003113 10 307 mmap2 0.72 0.002089 7 311 close 0.58 0.001693 13 129 munmap 0.42 0.001216 2 723 539 stat64 0.08 0.000227 0 1404 189 read 0.04 0.000109 4 25 brk 0.02 0.000061 6 10 getdents64 0.01 0.000028 0 298 write 0.01 0.000023 0 337 fstat64 0.00 0.000000 0 1 execve 0.00 0.000000 0 9 chdir 0.00 0.000000 0 3 time 0.00 0.000000 0 1 lseek 0.00 0.000000 0 75 49 access 0.00 0.000000 0 2 pipe 0.00 0.000000 0 964 gettimeofday 0.00 0.000000 0 5 2 readlink 0.00 0.000000 0 1 fstatfs 0.00 0.000000 0 17 uname 0.00 0.000000 0 9 mprotect 0.00 0.000000 0 11 _llseek 0.00 0.000000 0 5 readv 0.00 0.000000 0 15 writev 0.00 0.000000 0 363 poll 0.00 0.000000 0 69 rt_sigaction 0.00 0.000000 0 1 rt_sigprocmask 0.00 0.000000 0 11 getcwd 0.00 0.000000 0 1 getrlimit 0.00 0.000000 0 54 3 lstat64 0.00 0.000000 0 7 geteuid32 0.00 0.000000 0 31 fcntl64 0.00 0.000000 0 1 set_thread_area 0.00 0.000000 0 1 set_tid_address 0.00 0.000000 0 5 socket 0.00 0.000000 0 5 2 connect 0.00 0.000000 0 2 shutdown 0.00 0.000000 0 3 shmat ------ ----------- ----------- --------- --------- ---------------- 100.00 0.291164 406858 2530 total As you can see, systems calls used less than 3% of the CPU! So, what are these system calls I can see in Gkrellm? The same person also suggested me to have a look at OpenGL lib support. Here is what I get with glxinfo: name of display: :0.0 display: :0 screen: 0 direct rendering: Yes server glx vendor string: NVIDIA Corporation server glx version string: 1.4 client glx vendor string: NVIDIA Corporation client glx version string: 1.4 GLX version: 1.3 OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce FX 5200/PCI/SSE2 OpenGL version string: 2.0.2 NVIDIA 87.76 I think all is fine (as other applications, like GoogleEarth or Phun works smoothly). Could it be a hardware limitation? I can imagine this on the above one (P4, GeForce FX 5200), but I have similar results on my Q6600 + GeForce 8400 GS... Could someone make a test and tell me if he has the same behaviour? Thanks, -- Frédéric http://www.gbiloba.org |
From: David M. <dvm...@gm...> - 2010-01-11 07:33:31
|
I would like to be able to export a string of 3D extruded text as an OBJ or similar 3D file format, and I can't find any examples on the internet. I have played around with the solid_font.py demo in the OpenGLContext/tests/ folder, which uses FontTools to display the text, but I don't know how to get that mesh data back out. Any ideas would be greatly appreciated, thanks, -- Dave Morris |
From: Frédéric <fre...@gb...> - 2010-01-11 06:26:57
|
On vendredi 11 décembre 2009, Silverstein wrote: > > Thanks for your comment. I understand your idea about the FFT. However > > in my case profiling tells that drawing is the bottleneck, not > > processing. To give you a more precise idea, here is the result > > of cProfile on my application: > > http://imgur.com/deMyT.png > > Can you say a bit about what tool you are using to do the profiling and > where I can get it? It looks very useful. I second this demand, for my textures problem... -- Frédéric http://www.gbiloba.org |
From: Mike C. F. <mcf...@vr...> - 2010-01-11 04:39:12
|
David L. Page wrote: > > I am attempting to install PyOpenGL-3.0.1b2 on a Win7 system with > Python 2.6 installed. I receive an error that msvcr71.dll was not > found upon start of the PyOpenGL install exe. > > I have found online suggestions to download msvcr71.dll from various > sites and then to copy that dll into the win system directory. For > obvious reasons, I am unsatisfied with this solution and haven't > attempted it. > > Does any else have a work around? Hmm, that's a pain. If I'm reading correctly, there's no VC 2003 (7.1) redistributable download on microsoft.com. So there's no official way to redistribute it? That doesn't seem very helpful :( . Something has installed it to the Windows folder on my Vista machine, but I've got the MS Free compiler on there, which likely included it. I seem to recall that Python 2.5 included msvcrt71.dll but that there were problems with redistributions of it (or something like that)... hmm, it's not installed in the Python25 folder, so it could be that's what did the system-level install. What's really weird is that PyOpenGL without the accelerator module is pure Python... that is, it's not even compiled, it just uses ctypes to access the dlls. Maybe in compiling one of the dlls we bundle as data (maybe GLE?) I produced a dependency on vc7's redistributable. If you move OpenGL/DLLS/gle32.dll and OpenGL/DLLS/glut32.dll do you still get the message? Hmm, reading again, you're saying the *installer* is failing... hrmph. Probably built the pure-python installer with Python 2.5 and it linked to the Python 2.5 runtime... why would an installer require an external run-time? Sigh. Work-around would be to run the source installation (i.e. download, unpack, run "python setup.py install") or even use "easy_install <thezipfile>" if you want. Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: David L. P. <pa...@gm...> - 2010-01-11 03:15:19
|
I am attempting to install PyOpenGL-3.0.1b2 on a Win7 system with Python 2.6 installed. I receive an error that msvcr71.dll was not found upon start of the PyOpenGL install exe. I have found online suggestions to download msvcr71.dll from various sites and then to copy that dll into the win system directory. For obvious reasons, I am unsatisfied with this solution and haven't attempted it. Does any else have a work around? --Dave -- David L. Page dav...@ie... |
From: Frédéric <fre...@gb...> - 2010-01-08 16:10:46
|
On vendredi 08 janvier 2010, Gijs wrote: > > Ok, I will first try glCopyTexImage2D. From where should I call it? > > Should it be in a GL-specific context? What if the image ratio change? > > How do I handle this? Can I resize the texture? > > Well, depends on your implementation where you'd want to put the > glCopyTex command, but probably somewhere after or before the drawing > function. My goal is to make a slideshow program. So, new images are loaded according to the timeline... But I presume that I can't use opengl functions outside initializeGL(), resizeGL() or paintGL() methods, in my callback binded to that timeline? > If you want to draw a texture that has dimensions of 512x512 > on a 640x480 screen, OpenGL just resizes the texture accordingly. The > final image might look a bit crushed or stretched, depending on the > resolution that you draw at and the original resolution of your > texture, so you might need something like mipmapping to fix this. But > try it without mipmapping first. My question was more about the ratio; as you can see in the code, I compute the mapping of the texture from the image size. But then, if I want to load a new image with a different ratio, how do I expand/shrink the previous one? -- Frédéric http://www.gbiloba.org |
From: Gijs <in...@bs...> - 2010-01-08 15:51:07
|
On 1/8/10 16:12 , Frédéric wrote: > Le vendredi 8 janvier 2010 15:04, Frédéric a écrit : > > >> It appears that the CPU is not used by my process. I'm not sure, but it >> seems to be a kernel-space usage (orange in the Gkrellm default theme)... >> > It is 80% system usage, 20% process usage... > > Resizing the windows shows a strange thing: > > height=351 -> 5% CPU > height=357 -> 100% CPU > > Why such a big step? > > No idea :) I'd call that a bug but without having extra information about what's happening, I don't know for sure. Maybe Google has an answer. |
From: Gijs <in...@bs...> - 2010-01-08 15:49:07
|
On 1/8/10 16:04 , Frédéric wrote: > Le vendredi 8 janvier 2010 14:29, Gijs a écrit : > >> I haven't done any QT programming, so I could be wrong, but your code >> shouldn't even require a couple of %'s of your CPU. The work that your >> script does is hardly CPU-intensive and if your timer really updates >> your frame every 1/50th of a second, then the CPU hardly does anything. >> If on the other hand somehow OpenGL does updates without any sleeptime >> inbetween, then it would explain the CPU usage. So I would check the >> timer function or at least check how often your draw function is called. > > It appears that the CPU is not used by my process. I'm not sure, but it > seems to be a kernel-space usage (orange in the Gkrellm default theme)... > >> Some optimizations might be to move the glBlendFunc out of the drawing >> function to the init function. If you don't change the blending function >> somewhere else, then setting it once is enough since it is a global >> setting (not something that you need to set everytime you call >> glEnable(GL_BLEND)). You can also move glLoadIdentity to the init >> function if you don't call glRotate/glTranslate/glScale commands in >> other parts of your code. Also, though I'm not completely sure on this, >> you should be able to clear your screen without having to disable/enable >> dither and blending every time. Put the enable calls in the init section >> and see what happens. > > Thanks for the tips. > >> There are many ways to change a texture though I'm not sure your video >> card would support all of them. Shaders, PBOs, and FBOs are the usual >> way to do this but check and see if your FX5200 supports those. >> Otherwise you'd need to use the standard OpenGL calls like >> glCopyTexImage2D. > > Ok, I will first try glCopyTexImage2D. From where should I call it? Should > it be in a GL-specific context? What if the image ratio change? How do I > handle this? Can I resize the texture? > Well, depends on your implementation where you'd want to put the glCopyTex command, but probably somewhere after or before the drawing function. If you want to draw a texture that has dimensions of 512x512 on a 640x480 screen, OpenGL just resizes the texture accordingly. The final image might look a bit crushed or stretched, depending on the resolution that you draw at and the original resolution of your texture, so you might need something like mipmapping to fix this. But try it without mipmapping first. |
From: Frédéric <fre...@gb...> - 2010-01-08 15:12:58
|
Le vendredi 8 janvier 2010 15:04, Frédéric a écrit : > It appears that the CPU is not used by my process. I'm not sure, but it > seems to be a kernel-space usage (orange in the Gkrellm default theme)... It is 80% system usage, 20% process usage... Resizing the windows shows a strange thing: height=351 -> 5% CPU height=357 -> 100% CPU Why such a big step? -- Frédéric http://www.gbiloba.org |
From: Frédéric <fre...@gb...> - 2010-01-08 15:04:52
|
Le vendredi 8 janvier 2010 14:29, Gijs a écrit : > I haven't done any QT programming, so I could be wrong, but your code > shouldn't even require a couple of %'s of your CPU. The work that your > script does is hardly CPU-intensive and if your timer really updates > your frame every 1/50th of a second, then the CPU hardly does anything. > If on the other hand somehow OpenGL does updates without any sleeptime > inbetween, then it would explain the CPU usage. So I would check the > timer function or at least check how often your draw function is called. It appears that the CPU is not used by my process. I'm not sure, but it seems to be a kernel-space usage (orange in the Gkrellm default theme)... > Some optimizations might be to move the glBlendFunc out of the drawing > function to the init function. If you don't change the blending function > somewhere else, then setting it once is enough since it is a global > setting (not something that you need to set everytime you call > glEnable(GL_BLEND)). You can also move glLoadIdentity to the init > function if you don't call glRotate/glTranslate/glScale commands in > other parts of your code. Also, though I'm not completely sure on this, > you should be able to clear your screen without having to disable/enable > dither and blending every time. Put the enable calls in the init section > and see what happens. Thanks for the tips. > There are many ways to change a texture though I'm not sure your video > card would support all of them. Shaders, PBOs, and FBOs are the usual > way to do this but check and see if your FX5200 supports those. > Otherwise you'd need to use the standard OpenGL calls like > glCopyTexImage2D. Ok, I will first try glCopyTexImage2D. From where should I call it? Should it be in a GL-specific context? What if the image ratio change? How do I handle this? Can I resize the texture? -- Frédéric http://www.gbiloba.org |
From: Gijs <in...@bs...> - 2010-01-08 14:29:54
|
On 1/8/10 14:30 , Frédéric wrote: > Le vendredi 8 janvier 2010 12:55, Frédéric a écrit : > > >> I'm still trying to made crossfade between 2 images, using opengl >> textures, but it does not work fine. Here is my code : >> > Ok, I found my mistake: the first texture is at z index 0, so I changed: > > glOrtho(0., 1., 1., 0., 0., 10.) > > to: > > glOrtho(0., 1., 1., 0., -10., 10.) > > and it now works. > > Is there a way to optimize this code? On my old computer (P4 / GeForce FX > 5200), it takes 100% of the CPU with only a 640x480 windows. If I resize it > to 320x200, it does not take more than 5%... > > My next step will be to update the textures as the pictures change; what is > the best way to do this? > > Hello Frédéric, I haven't done any QT programming, so I could be wrong, but your code shouldn't even require a couple of %'s of your CPU. The work that your script does is hardly CPU-intensive and if your timer really updates your frame every 1/50th of a second, then the CPU hardly does anything. If on the other hand somehow OpenGL does updates without any sleeptime inbetween, then it would explain the CPU usage. So I would check the timer function or at least check how often your draw function is called. Some optimizations might be to move the glBlendFunc out of the drawing function to the init function. If you don't change the blending function somewhere else, then setting it once is enough since it is a global setting (not something that you need to set everytime you call glEnable(GL_BLEND)). You can also move glLoadIdentity to the init function if you don't call glRotate/glTranslate/glScale commands in other parts of your code. Also, though I'm not completely sure on this, you should be able to clear your screen without having to disable/enable dither and blending every time. Put the enable calls in the init section and see what happens. There are many ways to change a texture though I'm not sure your video card would support all of them. Shaders, PBOs, and FBOs are the usual way to do this but check and see if your FX5200 supports those. Otherwise you'd need to use the standard OpenGL calls like glCopyTexImage2D. Regards, Gijs// |
From: Frédéric <fre...@gb...> - 2010-01-08 14:06:39
|
Le vendredi 8 janvier 2010 12:55, Frédéric a écrit : > I'm still trying to made crossfade between 2 images, using opengl > textures, but it does not work fine. Here is my code : Ok, I found my mistake: the first texture is at z index 0, so I changed: glOrtho(0., 1., 1., 0., 0., 10.) to: glOrtho(0., 1., 1., 0., -10., 10.) and it now works. Is there a way to optimize this code? On my old computer (P4 / GeForce FX 5200), it takes 100% of the CPU with only a 640x480 windows. If I resize it to 320x200, it does not take more than 5%... My next step will be to update the textures as the pictures change; what is the best way to do this? -- Frédéric http://www.gbiloba.org |
From: Frédéric <fre...@gb...> - 2010-01-08 13:01:28
|
Hi, I'm still trying to made crossfade between 2 images, using opengl textures, but it does not work fine. Here is my code : http://www.pycasso.org/browser/trunk/proto/crossFadeOpenGL.py I only see the second texture. Where is my mistake? Thanks, -- Frédéric http://www.gbiloba.org |
From: Gijs <in...@bs...> - 2010-01-05 09:45:32
|
On 5-1-2010 9:57, Jef Mangelschots wrote: > PIL 1.1.6 supposedly has a module name ImageGL to convert image files > to OpenGL textures. > This somehow does not work for me for lack of the _imaginggl module. > This is supposedly part of imToolkit according to the comment but > google never heard of it. > > How can I convert image files (e.g. JPG) to PyOpenGL textures ? > can I do it with PIL (if so, how) or do I need something else ? > > Jef Hello Jef, I am using the following function to load PNG files into OpenGL using PIL: def initPixelData(filename, tex_type = GL_TEXTURE_RECTANGLE_ARB): img = Image.open(filename) pixels = array(img.getdata(), 'B') w, h = img.size pixels = pixels[::-1].ravel() # -> pixels.reverse() # this probably does not always work, but at least it works for RGB and RGBA exec("mode = GL_"+img.mode) # Create texture / set texture parameters / put the data into the texture / disable texture and return texid = int(glGenTextures(1)) glActiveTexture(GL_TEXTURE0) glEnable(tex_type) glBindTexture(tex_type, texid) glTexParameterf(tex_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glTexParameterf(tex_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexImage2D(tex_type, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels) glBindTexture(tex_type, 0) return texid, w, h You might have to alter it a bit, depending on the type of your images, but it should give you a general idea how to do it. Regards, Gijs |