Trouble texturing TerrainFile terrain
by Jacob Gostylo · in Torque Game Engine · 08/20/2006 (1:09 am) · 1 replies
I am using the resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7262
done by Derk Adams to generate a Terrain. I am going the 'load heightmap' way of doing it.
The short of this resource is that you create a TerrainFile, set its mHeightMap to the intensity of the color of each pixel in a loaded image and then mess with the alpha to blend the named textures to get the desired output.
The terrain gets saved and the height part of the terrain looks correct. My problem is that the textures are constantly coming out very distorted and they flicker. I am currently using the grass, sand, and patchy textures from the example. (The example looks fine when running from my exe)
My guess is that something is not getting set up in the TerrainFile correctly before it is saved. In my code (because it was in the resource code) I see that the array mBaseMaterialMap gets all its values set to 0. It is never accessed again. The type is U8 and I don't know what that is supposed to represent in mBaseMaterialMap. This could be part of the problem.
Can anyone tell me what is required to be set up in a TerrainFile object before it is saved so that its texturing information is correct? I have found little documentation or comments to help me on this one.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7262
done by Derk Adams to generate a Terrain. I am going the 'load heightmap' way of doing it.
The short of this resource is that you create a TerrainFile, set its mHeightMap to the intensity of the color of each pixel in a loaded image and then mess with the alpha to blend the named textures to get the desired output.
The terrain gets saved and the height part of the terrain looks correct. My problem is that the textures are constantly coming out very distorted and they flicker. I am currently using the grass, sand, and patchy textures from the example. (The example looks fine when running from my exe)
My guess is that something is not getting set up in the TerrainFile correctly before it is saved. In my code (because it was in the resource code) I see that the array mBaseMaterialMap gets all its values set to 0. It is never accessed again. The type is U8 and I don't know what that is supposed to represent in mBaseMaterialMap. This could be part of the problem.
Can anyone tell me what is required to be set up in a TerrainFile object before it is saved so that its texturing information is correct? I have found little documentation or comments to help me on this one.
About the author
Torque Owner Jacob Gostylo
I still think it is odd because the FPS demo textures just fine on my machine and I am using the same textures that the FPS demo is using.
Edit: I just found out that the texturing is fine on my system when I switch to D3D. It has other rendering problems under that setting though. I guess this is an OpenGL/Radeon bug...? Does anyone know a way to get around this bug or know of a Torque fix for this bug? My video drivers are completely up to date and have been for a week so that should not be an issue.