3 FPS on demos

Hello!

I am running BacktrackR3 based on ubuntu lts 10.04 lucid x64 with intel hd integrated graphics card and panda3d 1.8 on Intel Pentium Dual-Core B970 (2.3 Ghz) processor, kernel 3.2.6.
Installed Panda via ubuntu lucid deb file.

I believe something is amiss here.
Demo code:

from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
 
class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
 
        # Load the environment model.
        self.environ = self.loader.loadModel("models/environment")
        # Reparent the model to render.
        self.environ.reparentTo(self.render)
        # Apply scale and position transforms on the model.
        self.environ.setScale(0.25, 0.25, 0.25)
        self.environ.setPos(-8, 42, 0)
 
        # Add the spinCameraTask procedure to the task manager.
        self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")
 
        # Load and transform the panda actor.
        self.pandaActor = Actor("models/panda-model",
                                {"walk": "models/panda-walk4"})
        self.pandaActor.setScale(0.005, 0.005, 0.005)
        self.pandaActor.reparentTo(self.render)
        # Loop its animation.
        self.pandaActor.loop("walk")
 
    # Define a procedure to move the camera.
    def spinCameraTask(self, task):
        angleDegrees = task.time * 6.0
        angleRadians = angleDegrees * (pi / 180.0)
        self.camera.setPos(20 * sin(angleRadians), -20.0 * cos(angleRadians), 3)
        self.camera.setHpr(angleDegrees, 0, 0)
        return Task.cont
 
app = MyApp()
app.run()

I would prefer not to dualboot ubuntu 12.04 or whatnot and have more than 3 FPS. How can i achieve this ?

I’m guessing you don’t have the appropriate hardware-specific OpenGL driver installed, so you’re running in software mode. This is a common problem on Linux.

Check to ensure your Intel OpenGL drivers are installed properly.

David

I believe i do have opengl.
This example compiles and runs fine:

#include "GL/freeglut.h"
#include "GL/gl.h"
//gcc opengl.cpp -lglut -lGLEW

/* display function - code from:
     http://fly.cc.fer.hr/~unreal/theredbook/chapter01.html
This is the actual usage of the OpenGL library. 
The following code is the same for any platform */
void renderFunction()
{
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 1.0, 1.0);
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
    glBegin(GL_POLYGON);
        glVertex2f(-0.5, -0.5);
        glVertex2f(-0.5, 0.5);
        glVertex2f(0.5, 0.5);
        glVertex2f(0.5, -0.5);
    glEnd();
    glFlush();
}

/* Main method - main entry point of application
the freeglut library does the window creation work for us, 
regardless of the platform. */
int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE);
    glutInitWindowSize(500,500);
    glutInitWindowPosition(100,100);
    glutCreateWindow("OpenGL - First window demo");
    glutDisplayFunc(renderFunction);
    glutMainLoop();    
    return 0;
}

Looks like i’ll have to try dualbooting after all…

That proves that you have OpenGL, but not that you have hardware-supported OpenGL. This code would compile and run perfectly well on software-implemented OpenGL.

Linux comes with software-implemented OpenGL by default. You usually have to go out of your way to install the right hardware drivers.

David

As a user of Ubuntu myself (11.10 and, to a minor degree, 12.04), I agree with drwr’s point on driver support.

I too have an integrated Intel graphics device (the GMA 3150, I believe), and I’ve had a fair bit of trouble with it since switching to Ubuntu, and not only in Panda - I’ve tried playing a fair few games under Wine (largely older ones, given the relatively low power of my machine), and have managed to get only a fairly small subset working.

I tested the code that you gave on my own machine, and it seems to run well enough; I do think that you might want to consider looking for new drivers, perhaps community-provided.

(Given the problems that I’ve had, I’m hesitant to recommend the drivers that I use, even though they do seem to provide better performance. If you find a good set, perhaps share them here, please!)

[edit]
PS: Out of curiosity: why not upgrade to 11.10, at least? That should, I would imagine, open to you wider support than the older version.

Got it all sorted out ( by dualbooting ), thanks. It was dumb on my part to forget opengl could be software-emulated.

I cant upgrade to 11.10 because that would mean that some tools would probably break from the backtrack repos. I have neither the time nor the motivation to try that though.

[edit]
I believe the bug i was having was due to kernel 3.2.6 not loading the i915 intel driver.