egg2bam when upgrading from 1.7.2 to 1.8.0

I noticed that the bam files created with egg2bam are twice as big in version 1.8.0 compared to 1.7.2. In 1.7.2 I had to reduce the size of the egg databases because in egg2bam the error ‘Couldn’t allocate memory page of size 131072’ occurred when the databases were moderately big. But now, in 1.8.0, this error occurs again in databases that I had reduced considerably and were accepted in 1.7.2. So, in 1.8.0 I can’t bamify my databases anymore, but they have to be converted to new bam files, because otherwise panda 1.8.0 gives errors. So egg2bam seems to work very different in 1.8.0. Is there a way to get the smaller bam files back ?

Is it actually creating larger bam files, or is it only using more memory while doing it?

What happens if you set “egg-recursion-limit 10000” or so?

David

The filesize in bytes is twice as big. Memory limit appears to be the same.

This is a worrisome report, but I’m unable to reproduce it. My bam files seem to be about the same size between the ones generated by 1.7.2 and the ones generated by 1.8.0.

Can you show me a particular egg file or code sample that demonstrates this 2-to-1 change in file size?

David

Here’s a link to an example: http://www.carnetsoft.com/downloads/AlphaRomeoDarkBlue.zip

Ah, what you are seeing here is the change in the default behavior for two-sided geometry. The short answer: put “egg-emulate-bface 0” in your Config.prc file and re-generate your bam files to return to the 1.7.2 behavior.

The long answer: there are two ways Panda can deal with two-sided geometry. One way, with “egg-emulate-bface 0”, is to create the geometry exactly as described, and set the two-sided flag on it. This was the default behavior in 1.7.2. The other way, with “egg-emulate-bface 1”, is to replicate the geometry, so that each polygon is actually two back-to-back polygons, and not set any special flags on it. This is the default behavior in 1.8.0.

The counter-intuitive thing about these two choices is that the 1.8.0 way of doing this is actually usually faster to render than the 1.7.2 way of doing things. This is because the geometry doesn’t require any special render states, and can be flattened together with other models without any problems. But it does have the downside that it doubles your vertex count, which can be a problem if you have a lot of really complex models that all have the two-sided flag on them.

Of course, it may be that you didn’t intend to put a two-sided flag on this model at all, and it’s only there by accident. In that case, you should probably remove this flag, since it does have an effect on your performance, whichever way Panda uses to address it.

David