Author Topic: maxPolysVisible ceiling in software render mode  (Read 6242 times)

Offline stormp

  • byte
  • *
  • Posts: 38
    • View Profile
maxPolysVisible ceiling in software render mode
« on: June 23, 2007, 08:23:20 am »
Hi,

When in software render mode is there a ceiling limit to the number of visible polygons?  I've noticed in some examples maxPolysVisible is set to 10000 even 64000.

I get this error message intermittently:
Code: [Select]
WARNING: You've exceeded the configured triangle limit for the visibility list. Consider adjusting Config.maxPolysVisible!

I've set mine to         
Code: [Select]
Config.maxPolysVisible = 20000;
I'm never seeing any more than 3800 polygons in a scene
Code: [Select]
theWorld.getVisibilityList().getSize();
I really only have about 350 five faced cylinders randomly plotted in the world and a couple of planes. So there isn't really that many polygons to display in a scene.  Why would I be getting this error?

Also, what is a reasonable visible polygone count in a scene in software mode?  (I know this is a vague question, but just looking for some sort of guidelines or references).

Thanks for any help :-)

S.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: maxPolysVisible ceiling in software render mode
« Reply #1 on: June 23, 2007, 10:49:27 am »
I find it very unlikely that this happens. It's a simple check on the arrays size. Do you have a test case that shows this behaviour?
BTW: Software and hardware mode are behaving the same in this regard (until now...), so it's not related to software only.

Offline stormp

  • byte
  • *
  • Posts: 38
    • View Profile
Re: maxPolysVisible ceiling in software render mode
« Reply #2 on: June 23, 2007, 08:42:18 pm »
Do you have a test case that shows this behaviour?
Hi Egon,
Thanks for the quick reply.  I don't always get the message. Just intermittently.  I'll try to find out more about what conditions are that generates the notice message and post an example w/ code.

Any comments about what is a reasonable number of polys in a scene?

Cheers,

S.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: maxPolysVisible ceiling in software render mode
« Reply #3 on: June 24, 2007, 11:53:08 am »
Thanks for the quick reply.  I don't always get the message. Just intermittently.  I'll try to find out more about what conditions are that generates the notice message and post an example w/ code.
Are you by any chance doing multiple calls to renderScene() without calling draw() in between?

Quote
Any comments about what is a reasonable number of polys in a scene?
This highly depends on the scene. Number of polygons in the scene/2+10% should be a reasonable upper bound if the whole scene can be visible. But again: It depends on the scene...

Offline stormp

  • byte
  • *
  • Posts: 38
    • View Profile
Re: maxPolysVisible ceiling in software render mode
« Reply #4 on: June 24, 2007, 05:12:35 pm »
Quote
Are you by any chance doing multiple calls to renderScene() without calling draw() in between?
Nope, but I am calling Draw twice in some situations.  I want a wire frame around my landscape.  Haven't figured out how to wire frame just one object yet.
Could this have anything to do with it?

Thanks.


Code: [Select]
        while(!exit)
        {
            poll();                                 // Poll keybaord.

            frameBuffer.clear(Color.black);         // Clear frame- and z-buffer and make white background.

            //
            // Render the scene. Rotations and movement is done inpendently in the timer thread.
            //
            theWorld.renderScene(frameBuffer);      // Do all the stuff except the scanline conversion


            //
            //  Draw wireframe.
            //
            if(modeLand != 2)
            {
                theWorld.drawWireframe(frameBuffer, Color.gray);        // frame buffer
            }  // if

            theWorld.draw(frameBuffer);             // Do the scanline conversion (into buffer)

            frameBuffer.update();                   // Postprocess the framebuffer (if needed) and copy back- to
                                                    // frontbuffer

            //
            // This is just performance counter code:
            //
            cntFrames++;

            cntPoly += theWorld.getVisibilityList().getSize();

            endTime = System.currentTimeMillis();

            if(endTime-startTime > 1000)
            {
                renderTime = (cntFrames-lastFrames);
                lastFrames = cntFrames;
                startTime  = endTime;
                rendPoly   = cntPoly;
                cntPoly    = 0;
            }  // if
           
            frameBuffer.display(this.getGraphics());  // NOTE: do this instead of below
            myUpdate(this.getGraphics());             // calls  myUpdate()-method, where the rendered frame will
                                                      // be displayed

            Thread.yield();                           // Give other threads the possibility to do something
        }  // while

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: maxPolysVisible ceiling in software render mode
« Reply #5 on: June 24, 2007, 07:52:24 pm »
Could this have anything to do with it?
No, that's fine. Are you actually instantiating the World after setting the Config-value?

Offline stormp

  • byte
  • *
  • Posts: 38
    • View Profile
Re: maxPolysVisible ceiling in software render mode
« Reply #6 on: June 24, 2007, 08:11:27 pm »
Are you actually instantiating the World after setting the Config-value?

No, should i be?  :-[

Code: [Select]
    public void init()
    {
        getAppletContext().showStatus("Initializing...");


        //
        // Setup applet graphics.
        //
        resize(500,350);

        frameBuffer = new FrameBuffer(500, 350, FrameBuffer.SAMPLINGMODE_NORMAL);
       
       
        //
        // Initialize 3D World.
        //
        theWorld     = new World();                     // Genisis the 3D world.
        texManager   = TextureManager.getInstance();    // Easy access to the Texture Manager.
        theCamera    = theWorld.getCamera();            // Easy access to default Camera.
        dumCamera    = new Camera();                    // Dummy camera.

        //
        // Input devices.
        //
        componentOwner = this;
        keyMapper      = new KeyMapper(componentOwner);
       

        //
        // TODO: Load textures here...
        //
        Texture  tex = new Texture(getCodeBase(), "data/grass.jpg");
        texManager.addTexture("grass", tex);

        //
        // Start creating our world.
        //
        Config.tuneForOutdoor();  // Use the default settings for outdoor scenes.
        Config.maxPolysVisible    = 65000;
        Config.farPlane           = 3000;
        Config.fadeoutLight       = false;
        Config.useMultipleThreads = true;
       
        createLand();

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: maxPolysVisible ceiling in software render mode
« Reply #7 on: June 24, 2007, 10:33:52 pm »
Yes.  ;D

Offline stormp

  • byte
  • *
  • Posts: 38
    • View Profile
Re: maxPolysVisible ceiling in software render mode
« Reply #8 on: June 25, 2007, 07:46:41 am »
Yes.  ;D

I suppose that makes sense now.  Thanks Egon