Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the OpenGL CPAN distribution.

Report information
The Basics
Id: 48270
Status: resolved
Priority: 0/
Queue: OpenGL

People
Owner: Nobody in particular
Requestors: wsvries [...] xs4all.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: texture does not work on specific debian machine
Date: Tue, 28 Jul 2009 16:06:54 +0200
To: bug-OpenGL [...] rt.cpan.org
From: Wim de Vries <wsvries [...] xs4all.nl>
Hi, I have a pogl script that works on one Debian machine, but not on another Debian machine. A targa file is loaded and should be displayed as texture, but it is not displayed on one of the machines. (It is possible to write it back to disk though). Both machines are Intel 2 DuoCore. The script works OK on a HP Compaq 6910p: Mesa DRI Intel(R) 965 4.1.3002 It does not work on a self-build box: Mesa DRI Intel(R) 945G 20061017. Both machines have the same OpenGL/POGL/glut etc. libraries installed. Other Opengl scripts (with binary loaded image data) do work fine on the self-build machine. Please see code below. Could it be an error in the diver? Thanks. #!/usr/bin/perl -w use strict; use OpenGL::Image; use OpenGL qw/ :all /; my $image_file = "400x400map.tga"; my $inf = OpenGL::Image::GetEngines(); my %engine = %$inf; print "Using POGL v$OpenGL::BUILD_VERSION\n"; foreach my $name (sort keys %engine) { print "$name:"; my $val = $engine{$name}; my %engine_info = %$val; foreach my $key (sort keys %engine_info) {print "$key:"; print $engine_info{$key}."\n"; } } my @texName; my $tex = new OpenGL::Image(source=>$image_file); my($ifmt,$fmt,$type) = $tex->Get('gl_internalformat','gl_format','gl_type'); my($w,$h) = $tex->Get('width','height'); print "$w,$h\n"; my $size = 2 ** ($tex->GetPowerOf2()); print "size:$size\n"; glutInit(); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(400,400); glutInitWindowPosition(0,0); glutCreateWindow("image"); glutDisplayFunc(\&display); glutReshapeFunc(\&reshape); glutKeyboardFunc(\&keyboard); myInit(); glutMainLoop(); sub myInit { glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel(GL_FLAT); glEnable(GL_DEPTH_TEST); @texName = glGenTextures_p(1);#get a free name my $textureName = $texName[0]; print "tn:".length(@texName)."\n"; glBindTexture(GL_TEXTURE_2D, $texName[0]); #instantiate and use texture object glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D_c(GL_TEXTURE_2D, 0, $ifmt, $w, $h, 0, $fmt, $type, $tex->Ptr()); #specify a two-dimensional texture image } sub display{ glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glBindTexture(GL_TEXTURE_2D, $texName[0]); #instantiate and use texture object glBegin(GL_QUADS); glTexCoord2f(0.0, 0.0); glVertex3f(-1, -1, 0.0); glTexCoord2f(0.0, 1.0); glVertex3f(-1, 1, 0.0); glTexCoord2f(1.0, 1.0); glVertex3f(1, 1, 0.0); glTexCoord2f(1.0, 0.0); glVertex3f(1, -1, 0.0); glEnd(); glFlush(); glDisable(GL_TEXTURE_2D); print "display\n"; } sub reshape {my ($w, $h) = @_; print "reshape\n"; glViewport (0, 0, $w,$h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); } sub keyboard {my ($key, $x, $y) = @_; print "key\n"; } __END__ :endofperl
I would suggest using the perl debugger and running the same script, step-by-step on both machines to localize the problem better. With that info, you may be able to figure things out. I can say that it is possible for a program using OpenGL for graphics can fail or not on machines based on what resolutions are actually supported by the hardware and drivers. OpenGL debugging tip: try calling glGetError() between each call to catch the first sign of trouble. For performance, OpenGL does not check for errors after every call. If you come up with something that looks like a problem in the OpenGL module itself, please reply with the additional info for this trouble ticket. Good luck, Chris On Tue Jul 28 10:06:55 2009, wsvries@xs4all.nl wrote: Show quoted text
> Hi, > I have a pogl script that works on one Debian machine, but not on > another Debian machine. > A targa file is loaded and should be displayed as texture, but it is
not Show quoted text
> displayed on one of the machines. (It is possible to write it back to > disk though). > Both machines are Intel 2 DuoCore. > The script works OK on a HP Compaq 6910p: Mesa DRI Intel(R) 965
4.1.3002 Show quoted text
> It does not work on a self-build box: Mesa DRI Intel(R) 945G 20061017. > Both machines have the same OpenGL/POGL/glut etc. libraries installed. > Other Opengl scripts (with binary loaded image data) do work fine on
the Show quoted text
> self-build machine. > Please see code below. > Could it be an error in the diver? > Thanks. > > #!/usr/bin/perl -w > use strict; > use OpenGL::Image; > use OpenGL qw/ :all /; > my $image_file = "400x400map.tga"; > my $inf = OpenGL::Image::GetEngines(); > my %engine = %$inf; > print "Using POGL v$OpenGL::BUILD_VERSION\n"; > > foreach my $name (sort keys %engine) { > print "$name:"; > my $val = $engine{$name}; > my %engine_info = %$val; > foreach my $key (sort keys %engine_info) > {print "$key:"; > print $engine_info{$key}."\n"; > } > } > > my @texName; > my $tex = new OpenGL::Image(source=>$image_file); > my($ifmt,$fmt,$type) = $tex->Get
('gl_internalformat','gl_format','gl_type'); Show quoted text
> my($w,$h) = $tex->Get('width','height'); > print "$w,$h\n"; > my $size = 2 ** ($tex->GetPowerOf2()); > print "size:$size\n"; > glutInit(); > glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); > glutInitWindowSize(400,400); > glutInitWindowPosition(0,0); > glutCreateWindow("image"); > glutDisplayFunc(\&display); > glutReshapeFunc(\&reshape); > glutKeyboardFunc(\&keyboard); > myInit(); > glutMainLoop(); > > sub myInit > { > glClearColor (0.0, 0.0, 0.0, 0.0); > glShadeModel(GL_FLAT); > glEnable(GL_DEPTH_TEST); > @texName = glGenTextures_p(1);#get a free name > my $textureName = $texName[0]; > print "tn:".length(@texName)."\n"; > glBindTexture(GL_TEXTURE_2D, $texName[0]); #instantiate and use > texture object > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); > glTexImage2D_c(GL_TEXTURE_2D, 0, $ifmt, $w, $h, 0, $fmt, $type, > $tex->Ptr()); #specify a two-dimensional texture image > > } > > sub display{ > glClearColor(0.0, 0.0, 0.0, 0.0); > glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); > glEnable(GL_TEXTURE_2D); > glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); > glBindTexture(GL_TEXTURE_2D, $texName[0]); #instantiate and
use Show quoted text
> texture object > glBegin(GL_QUADS); > glTexCoord2f(0.0, 0.0); glVertex3f(-1, -1, 0.0); > glTexCoord2f(0.0, 1.0); glVertex3f(-1, 1, 0.0); > glTexCoord2f(1.0, 1.0); glVertex3f(1, 1, 0.0); > glTexCoord2f(1.0, 0.0); glVertex3f(1, -1, 0.0); > glEnd(); > glFlush(); > glDisable(GL_TEXTURE_2D); > > print "display\n"; > } > > sub reshape > {my ($w, $h) = @_; > print "reshape\n"; > glViewport (0, 0, $w,$h); > glMatrixMode(GL_PROJECTION); > glLoadIdentity(); > glMatrixMode(GL_MODELVIEW); > } > > sub keyboard > {my ($key, $x, $y) = @_; > print "key\n"; > } > > __END__ > :endofperl
Subject: Re: [rt.cpan.org #48270] texture does not work on specific debian machine
Date: Sun, 02 Aug 2009 16:37:11 +0200
To: bug-OpenGL [...] rt.cpan.org
From: Wim de Vries <wsvries [...] xs4all.nl>
Thanks Chris, I just found out the cause of the problem. The OpenGL, freeglut, etc. are the same version, but after some digging I found out that the Intel drivers support OpenGL 1.4 (965 chip) and 1.3 (945 chip), and that's where the difference between the tex power of 2 requirement shows. The image was not n power of 2. So, that was the problem. So, NOT a bug in the module. Thanks. Reggards, Wim de Vries Chris Marshall via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=48270 > > > I would suggest using the perl debugger and running > the same script, step-by-step on both machines to > localize the problem better. With that info, you > may be able to figure things out. > > I can say that it is possible for a program using > OpenGL for graphics can fail or not on machines > based on what resolutions are actually supported > by the hardware and drivers. > > OpenGL debugging tip: try calling glGetError() > between each call to catch the first sign of trouble. > For performance, OpenGL does not check for errors > after every call. > > If you come up with something that looks like > a problem in the OpenGL module itself, please > reply with the additional info for this trouble > ticket. > > Good luck, > Chris > > On Tue Jul 28 10:06:55 2009, wsvries@xs4all.nl wrote: >
>> Hi, >> I have a pogl script that works on one Debian machine, but not on >> another Debian machine. >> A targa file is loaded and should be displayed as texture, but it is >>
> not >
>> displayed on one of the machines. (It is possible to write it back to >> disk though). >> Both machines are Intel 2 DuoCore. >> The script works OK on a HP Compaq 6910p: Mesa DRI Intel(R) 965 >>
> 4.1.3002 >
>> It does not work on a self-build box: Mesa DRI Intel(R) 945G 20061017. >> Both machines have the same OpenGL/POGL/glut etc. libraries installed. >> Other Opengl scripts (with binary loaded image data) do work fine on >>
> the >
>> self-build machine. >> Please see code below. >> Could it be an error in the diver? >> Thanks. >> >> #!/usr/bin/perl -w >> use strict; >> use OpenGL::Image; >> use OpenGL qw/ :all /; >> my $image_file = "400x400map.tga"; >> my $inf = OpenGL::Image::GetEngines(); >> my %engine = %$inf; >> print "Using POGL v$OpenGL::BUILD_VERSION\n"; >> >> foreach my $name (sort keys %engine) { >> print "$name:"; >> my $val = $engine{$name}; >> my %engine_info = %$val; >> foreach my $key (sort keys %engine_info) >> {print "$key:"; >> print $engine_info{$key}."\n"; >> } >> } >> >> my @texName; >> my $tex = new OpenGL::Image(source=>$image_file); >> my($ifmt,$fmt,$type) = $tex->Get >>
> ('gl_internalformat','gl_format','gl_type'); >
>> my($w,$h) = $tex->Get('width','height'); >> print "$w,$h\n"; >> my $size = 2 ** ($tex->GetPowerOf2()); >> print "size:$size\n"; >> glutInit(); >> glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); >> glutInitWindowSize(400,400); >> glutInitWindowPosition(0,0); >> glutCreateWindow("image"); >> glutDisplayFunc(\&display); >> glutReshapeFunc(\&reshape); >> glutKeyboardFunc(\&keyboard); >> myInit(); >> glutMainLoop(); >> >> sub myInit >> { >> glClearColor (0.0, 0.0, 0.0, 0.0); >> glShadeModel(GL_FLAT); >> glEnable(GL_DEPTH_TEST); >> @texName = glGenTextures_p(1);#get a free name >> my $textureName = $texName[0]; >> print "tn:".length(@texName)."\n"; >> glBindTexture(GL_TEXTURE_2D, $texName[0]); #instantiate and use >> texture object >> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); >> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); >> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); >> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); >> glTexImage2D_c(GL_TEXTURE_2D, 0, $ifmt, $w, $h, 0, $fmt, $type, >> $tex->Ptr()); #specify a two-dimensional texture image >> >> } >> >> sub display{ >> glClearColor(0.0, 0.0, 0.0, 0.0); >> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); >> glEnable(GL_TEXTURE_2D); >> glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); >> glBindTexture(GL_TEXTURE_2D, $texName[0]); #instantiate and >>
> use >
>> texture object >> glBegin(GL_QUADS); >> glTexCoord2f(0.0, 0.0); glVertex3f(-1, -1, 0.0); >> glTexCoord2f(0.0, 1.0); glVertex3f(-1, 1, 0.0); >> glTexCoord2f(1.0, 1.0); glVertex3f(1, 1, 0.0); >> glTexCoord2f(1.0, 0.0); glVertex3f(1, -1, 0.0); >> glEnd(); >> glFlush(); >> glDisable(GL_TEXTURE_2D); >> >> print "display\n"; >> } >> >> sub reshape >> {my ($w, $h) = @_; >> print "reshape\n"; >> glViewport (0, 0, $w,$h); >> glMatrixMode(GL_PROJECTION); >> glLoadIdentity(); >> glMatrixMode(GL_MODELVIEW); >> } >> >> sub keyboard >> {my ($key, $x, $y) = @_; >> print "key\n"; >> } >> >> __END__ >> :endofperl >>
> > > > >