Wierd Opengl Error

Bug #917997 reported by rockachu2
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyGL3Display
Fix Released
Medium
David Griffin

Bug Description

Traceback (most recent call last):
  File "D:\Desktop\PyGL3Display1.9-alpha\examples\criticalMass.py", line 169, in <module>
    main()
  File "D:\Desktop\PyGL3Display1.9-alpha\examples\criticalMass.py", line 151, in main
    x = Level(10, (400,400))
  File "D:\Desktop\PyGL3Display1.9-alpha\examples\criticalMass.py", line 123, in __init__
    self.ballImg = LoadImage('ball.png')
  File "..\PyGL3Display\pygamesprites.py", line 71, in LoadImage
    return cls.Surfaceify(pygame.image.load(*args, **kwargs))
  File "..\PyGL3Display\pygamesprites.py", line 78, in Surfaceify
    Surface.__init__(ret, pygameSurface.get_size())
  File "..\PyGL3Display\twodimages.py", line 40, in __init__
    manager = SpriteCommon.defaultManager if manager is None else manager
  File "..\PyGL3Display\twodspriteinfrastructure.py", line 80, in __getattr__
    shader=cls.defaultShader)
  File "..\PyGL3Display\twodspriteinfrastructure.py", line 83, in __getattr__
    cls.makeDefaultShader()
  File "..\PyGL3Display\twodspriteinfrastructure.py", line 149, in makeDefaultShader
    cls.defaultShader = SpriteShader(cls.defaultVertexArrays)
  File "..\PyGL3Display\twodspriteinfrastructure.py", line 213, in __init__
    fragmentProgs=[fragmentProg])
  File "..\PyGL3Display\twodshaders.py", line 157, in __init__
    super(TwoDTexturedShader, self).__init__(**kwargs)
  File "..\PyGL3Display\twodshaders.py", line 115, in __init__
    **kwargs)
  File "..\PyGL3Display\sharedinfrastructure.py", line 415, in __init__
    self.setup()
  File "..\PyGL3Display\sharedinfrastructure.py", line 425, in setup
    vertexProg in self.vertexProgs]
  File "..\PyGL3Display\sharedinfrastructure.py", line 522, in getShader
    raise ShaderError(errorMessage)
ShaderError: Shader Error:
Source:

    vec2 applyTransform(in vec2 pos, in vec2 origin, in vec2 offset,
                        in float xScale, in float yScale, in float rotation)
    {
        vec2 offsets = vec2 ((offset.x - origin.x) * xScale,
                             (offset.y - origin.y) * yScale);
        mat2 rotMatrix = mat2 (cos(rotation), sin(rotation),
                              -sin(rotation), cos(rotation));
        offsets = (rotMatrix * offsets);
        vec2 ret = offsets + pos;
        return ret;
    }

Error:
Vertex shader was successfully compiled to run on hardware.

Revision history for this message
rockachu2 (rockachu2) wrote :

All the examples fail to run

am I doing something wrong?

Revision history for this message
David Griffin (habilain) wrote :

Probably not.. can you post OS/Graphics card/Drivers? I just want to know on the likelihood of dodgy drivers (every error like this thus far has been due to dodgy drivers).

In the meantime, I'll see if there's an easy way around it...

Revision history for this message
rockachu2 (rockachu2) wrote :

windows 7 x64
Ati radeon hd 5870 2gb
...
At catalyst 11.11 (not latest, because latest = bluescreen)

Revision history for this message
rockachu2 (rockachu2) wrote :

I suspect it's my pyopengl install.
It always has been.

Revision history for this message
David Griffin (habilain) wrote :

Nope, it's my code. Turns out I'm querying the InfoLog of the shader to determine if it has compiled, which on the drivers I tested returns an empty string if all is well. But it seems it doesn't have to, according to the spec, and I should use glGetShader instead.

Now, I've committed a proper fix to my own branch, but said branch is not ready for merging to trunk at the moment (working on examples, and well, most of them are broken; not just the text example as in the alpha release). So, in the meantime, a quick hacky fix is to open PyGL3Display/sharedinfrastructure.py, go to line 518. It should read: "shaderLog = glGetShaderInfoLog(shader).strip()" . Change this to "shaderLog = None" - this will disable error checking on shaders, but that should be fine as it's more of a development feature than anything else.

Changed in pygl3display:
importance: Undecided → Medium
status: New → Incomplete
status: Incomplete → Fix Committed
assignee: nobody → David Griffin (habilain)
Revision history for this message
David Griffin (habilain) wrote :

And pretty much as soon as I say that I can't release a proper fix, I find the bug in my own branch and get everything ready for the alpha 2 release. Anyhow, alpha 2 should fix this bug.

Download: https://launchpad.net/pygl3display/trunk/1.9-alpha2

Changed in pygl3display:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.