threading-model Cull/Draw

I use threading-model /Draw in my config.prc which gives a definite boost in frame rate. I would like to increase this even more by using threading-model Cull/Draw, but I can’t because it crashes with the following error:

Assertion failed: is_indexed() at line 1505 of c:\buildslave\dev_sdk_win_amd64\build\panda3d\panda\src\gobj\geomPrimitice.cxx

I use Windows 7 64 bits, version 1.9.0 of Panda

Does anyone have an idea what could cause this ?

Thanks.

You must be using a pre-release version. You should upgrade to the official 1.9.0 version, where this issue is fixed.

Yes, I run 1.9.0-x64-2014.11.27-503. I just tried the latest release version, and you are right, Cull/Draw now works fine. However, the ground textures now get blurred about 10 meters in front, which was not the case with the prerelease versions. Has something changed in the texture filtering settings that could cause this ?

Could you post screenshots of the difference?

Yes, the following is from version 1.9.0-x64-2014.11.27-503


the next one is from Panda3D-SDK-1.9.0-x64 from april this year.


Its the texture filtering with mipmapping that seems to work out differently in the latest 1.9.0 version compared to Panda3d-1.9.0-x64-2014.11.27-503.
For the road texture that is more blurry from nearby in the latest version I have the following specified in the egg file:

2 {
“textures/roadsurfs/asphalt_road.jpg”
wrap { repeat }
wrapu { repeat }
wrapv { repeat }
minfilter { linear-mipmap-linear }
magfilter { linear }
envtype { modulate }
}

When I change:
minfilter { linear-mipmap-linear } into
minfilter { linear },

then the road texture is much clearer but too noisy when you move through the database.

minfilter { nearest-mipmap-linear } gives better results but not nearly as good as linear-mipmap-linear in
Panda3d-1.9.0-x64-2014.11.27-503

Can this be related to changes in OpenGL and is it possible to get the older behaviour back with a config setting ?

What changed that may be related is that we now explicitly set GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, and GL_TEXTURE_LOD_BIAS. But they are set to what should be the OpenGL defaults.

Might it be that you have a driver setting with a negative mipmap bias, and that Panda is now overriding it?

You could try playing with texture.setLodBias(-1.0) to see if you can get the textures to appear sharper.

Yes, you are right, it’s the negative lod bias. When I use nv inspector to set negative lod bias to -1.5 then the images are similar to the previous version. I can’t find setLodBias as a texture function. Do you know of another way to set the lodbias to a negative value in panda ?

Hmm that must have been an omission. You can create a SamplerState() object and assign that in the setTexture call:

sampler = panda3d.core.SamplerState()
sampler.setMinfilter(...)
sampler.setLodBias(-1.5)

model.setTexture(texture, sampler)