I have a GeoMipTerrain that works great when only the Z is scaled, but recently we had to scale our actor to 10 times its original size, and we want to scale up the terrain as well.
The code that works fine looks like this
self.terrain = GeoMipTerrain("myTerrain")
# height map
self.terrain.setHeightfield(Filename("demo_stryker/assets/textures/StrykerHeight_256.png"))
self.terrain.setBlockSize(256)
self.terrain.setFactor(100)
self.terrain.setMinLevel(1)
self.terrain.getRoot().reparentTo(self.parent.mWorld)
self.terrain.getRoot().setSz(10) # z (up) scale
self.terrain.getRoot().setSy(1)
self.terrain.getRoot().setSx(1)
self.terrain.generate()
# alpha map
tex0 = loader.loadTexture("demo_stryker/assets/textures/Combined_Alpha_1.tif")
tex0.setMinfilter(Texture.FTLinearMipmapLinear)
# detail 1
tex1 = loader.loadTexture("demo_stryker/assets/textures/grass_thick_512.tga")
tex1.setMinfilter(Texture.FTLinearMipmapLinear)
# detail 2
tex2 = loader.loadTexture("demo_stryker/assets/textures/gravel_gray_512.tga")
tex2.setMinfilter(Texture.FTLinearMipmapLinear)
#detail 3
tex3 = loader.loadTexture("demo_stryker/assets/textures/patch_grass.tga")
tex3.setMinfilter(Texture.FTLinearMipmapLinear)
#detail 4
tex4 = loader.loadTexture("demo_stryker/assets/textures/sand_512_01.tga")
tex4.setMinfilter(Texture.FTLinearMipmapLinear)
# color map
tex5 = loader.loadTexture("demo_stryker/assets/textures/color_map.tga")
tex5.setMinfilter(Texture.FTLinearMipmapLinear)
# light map
tex6 = loader.loadTexture("demo_stryker/assets/textures/StrykerRange01_LM.tif")
tex6.setMinfilter(Texture.FTLinearMipmapLinear)
#convenient
self.root = self.terrain.getRoot()
#set mutiltextures
self.root.setShaderInput("tex_0", tex0)
self.root.setShaderInput("tex_1", tex1)
self.root.setShaderInput("tex_2", tex2)
self.root.setShaderInput("tex_3", tex3)
self.root.setShaderInput("tex_4", tex4)
self.root.setShaderInput("tex_5", tex5)
self.root.setShaderInput("tex_6", tex6)
self.root.setShaderInput("alight0", self.parent.att_ambientLight.light)
self.root.setShader(loader.loadShader('demo_stryker/assets/shaders/splut3.sha'))
but if I change the scale values like so:
self.terrain.getRoot().setSy(10)
self.terrain.getRoot().setSx(10)
I get this
I cant really tell if the image is just washed out, or if it isn’t getting applied at all. What I do know is it is not texturing the entire geomipterrain, it stops where the original 256x256 colormap would have been.
The stranger part is, the ODE physics reads the new size just fine, and I am able to rumble around out in the middle of nowhere. I use the following line to grab the actual transformed vert information later on
Trimesh = OdeTriMeshData(self.root, False)
I have tried noodling around with getting the texture stages and setting the setTexScale but nothing has worked (I am assuming because I am using the shader for the actual texture stages)
Any insight? Thanks