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:
WARNING: You've exceeded the configured triangle limit for the visibility list. Consider adjusting Config.maxPolysVisible!
I've set mine to
Config.maxPolysVisible = 20000;
I'm never seeing any more than 3800 polygons in a scene
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.
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.
Quote from: EgonOlsen on June 23, 2007, 10:49:27 AM
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.
Quote from: stormp on June 23, 2007, 08:42:18 PM
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...
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.
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
Quote from: stormp on June 24, 2007, 05:12:35 PM
Could this have anything to do with it?
No, that's fine. Are you actually instantiating the World after setting the Config-value?
Quote from: EgonOlsen on June 24, 2007, 07:52:24 PMAre you actually instantiating the World after setting the Config-value?
No, should i be? :-[
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();
Yes. ;D