not possible to disable anisotropicDegree

i’ve played around with anisotropic texturing a bit, when i found out that’s impossible to disable it, once activated.

get some texture and save it as tex.jpg (for example http://www.sharecg.com/v/6842/Texture/Sidewalk-Cement-seamless?PSID=dab222b6365c6ebc21291ee2b01b3bfa)

main.py

from direct.showbase.DirectObject import DirectObject
import direct.directbase.DirectStart
from pandac.PandaModules import Texture

class World(DirectObject):
  def __init__(self):
      plane = loader.loadModel('./plane.egg')
      plane.reparentTo(render)
      plane.setScale(100)
      plane.setZ(-5)
      plane.setP(15)
      self.tex = loader.loadTexture('./tex.jpg')
      self.tex.setMinfilter(Texture.FTLinearMipmapLinear)
      plane.setTexture(self.tex)
      self.anisoMode = 0
      
      self.accept('0', self.setAnisomode, [0])
      # according to:
      # http://www.panda3d.org/manual/index.php/Texture_Filter_Types
      # setting 1 should disable anisostrophic filtering
      self.accept('1', self.setAnisomode, [1])
      self.accept('2', self.setAnisomode, [2])
      self.accept('3', self.setAnisomode, [4])
      self.accept('4', self.setAnisomode, [8])
      self.accept('5', self.setAnisomode, [16])
  
  def setAnisomode(self, value):
    self.tex.setAnisotropicDegree(value)

if __name__=='__main__':
   World()
   run()

plane.egg

<CoordinateSystem> { Z-up }

<Comment> { "Egg laid by Chicken for Blender vR44" }

<Material> Material.001 {
  <Scalar> diffr {0.800000011921}
  <Scalar> diffg {0.800000011921}
  <Scalar> diffb {0.800000011921}
  <Scalar> specr {0.25}
  <Scalar> specg {0.25}
  <Scalar> specb {0.25}
  <Scalar> shininess {12.5}
}
<Texture> Material.001 {
  "./tex.jpg"
  <Scalar> uv-name { UVTex }
  <Scalar> envtype { modulate }
}

<Group> Plane {
  <VertexPool> Plane {
    <Vertex> 0 {
      1.0 0.999999940395 0.0
      <UV> UVTex { -49.499985 -49.500008 }
    }
    <Vertex> 1 {
      -0.999999642372 1.00000035763 0.0
      <UV> UVTex { 50.500008 -49.500008 }
    }
    <Vertex> 2 {
      -1.00000011921 -0.999999821186 0.0
      <UV> UVTex { 50.500008 50.500008 }
    }
    <Vertex> 3 {
      1.0 -1.0 0.0
      <UV> UVTex { -49.500008 50.500008 }
    }
  }
  <Polygon> {
    <TRef> { Material.001 }
    <MRef> { Material.001 }
    <Normal> { 0.000000 -0.000000 1.000000 }
    <VertexRef> { 0 1 2 3 <Ref> { Plane } }
  }
}

is there any chance that this will be fixed? (can anybody else confirm the problem) i am running ubuntu 9.04.

Confirmed–I observe the reported behavior when running your sample code. I’ll take a look into it.

David

Fix committed. Thanks for the very helpful sample application!

David

Thanks as well :slight_smile: