[fixed] D3D8 Mip filtering (mip and mipless in same scene)

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
kvakvs
Posts: 30
Joined: Wed Oct 14, 2009 1:50 am
Location: Sweden
Contact:

[fixed] D3D8 Mip filtering (mip and mipless in same scene)

Post by kvakvs »

Im using mix of materials which have MIP levels, and which do not. Had the problem, when in some situations D3DTSS_MAGFILTER and D3DTSS_MINFILTER were not set correctly according to Material.UseMipMaps.

Here is what i found in "irr.video.CD3D8Driver.setBasicRenderStates"
texture stage state is not testing if UseMipMaps in last material changed in current material.

Code: Select all

if (resetAllRenderstates ||
  lastmaterial.TextureLayer[st].BilinearFilter != material.TextureLayer[st].BilinearFilter ||
  lastmaterial.TextureLayer[st].TrilinearFilter != material.TextureLayer[st].TrilinearFilter ||
  lastmaterial.TextureLayer[st].AnisotropicFilter != material.TextureLayer[st].AnisotropicFilter)
Changed this to:

Code: Select all

if (resetAllRenderstates ||
  lastmaterial.TextureLayer[st].BilinearFilter != material.TextureLayer[st].BilinearFilter ||
  lastmaterial.TextureLayer[st].TrilinearFilter != material.TextureLayer[st].TrilinearFilter ||
  lastmaterial.TextureLayer[st].AnisotropicFilter != material.TextureLayer[st].AnisotropicFilter ||
  lastmaterial.UseMipMaps != material.UseMipMaps)
Now works.
Thanks for attention :)

P.S. Same goes for D3D9Driver, also (possibly?) for OpenGL, cannot test OpenGL for now.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, this just belongs to SVN trunk version. It's fixed now (was indeed only d3d, due to different update schemes).
Post Reply