Slow Texturing/Light performance


Finally I got my game done and complete, the computer I'm working on is a PC … its running fast and smooth, just beautiful!

when I tried to run this "working" game on my laptop (which usually makes way much better performance when running Need For Speed Underground 2 and Command and Conquer Zero Hour), the game run very slow :'(((((((!!!

anyway, I looked for the problem and I found that out that if I remove the LightState from the roodNode the game works fine on the laptop … and also if I remove the texture from the walls the game also runs fast on the laptop.

PC specs:

VGA: 256 MB NVidia 6600 NX

RAM: 3 Gb DDR2

CPU: 3.0 GHz CPU (single core)

Laptop specs:

VGA: 256 MB Radeon ATI 1400X

RAM: 1 Gb DDR2

CPU: 2.16 Core Duo 2

So I guess that the wall texturing and lighting are making a conflict:

        TextureState borderWallTexture = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
        Texture t3 = TextureManager.loadTexture(
                  ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, "/wall/cinder-blocks-texture.jpg"),
                  Texture.MinificationFilter.Trilinear, Texture.MagnificationFilter.Bilinear);


        // then i make many boxes (around 50)  and I put the borderWallTexture as their render state

    void initLight(ColorRGBA diffuse, ColorRGBA ambient, ColorRGBA specular){
       DirectionalLight light = new DirectionalLight();

        light.setDirection(new Vector3f(1,-1, -1));

        lightState = display.getRenderer().createLightState();
        lightState.setGlobalAmbient(new ColorRGBA(.2f, .2f, .2f, 1f));


...Is there any better way to do these steps? Did I do something wrong?
is it that my laptop is not capable of running this game? as I said earlier, my laptop usually runs games way much faster than my PC!!

thanks for anyyy help :)

One single line solved the problem … for all those who might fall into the same problem take a look at this line


just write this line before adding the light state to rootNode


Ahmad  :smiley: