Showing posts with label Terrain Textures. Show all posts
Showing posts with label Terrain Textures. Show all posts

Monday, September 15, 2008

Dynamic Terrain Textures

I've spent today building a function from the map of the functions that are required to run in order to add a texture to Torque and apply it. After 500 hundred lines I have a function that I believe will work as we want. An attempt to break the function up into multiple functions was derailed due to calls to functions from the C++ source code.
I will attempt to test the function later this week and hopefully will be able to integrate Dynamic Terrain Texturing using a single texture into the Alpha Demo later this week. Once Dynamic Terrain Texturing using a single texture is working modifications will have to be made to apply however many textures are required for a mission using necessary filters (e.g. Apply by Height).

Monday, September 8, 2008

Terrain Texturing

After my initial approach to handling dynamic terrain texturing failed to produce results, as such I have spent today working on a new method.
The new method required that I map the functions run when terrain textures are applied manually. There are two major actions that must be carried out in order for textures to be applied, first the texture must be loaded and then it must be applied. By stepping through the script as the game runs I have determined the functions run, the important lines of script they run, and the expected formats for variables.
Using what I have found I should be able to create a function to run at Mission Start that applies a texture to the terrain. Once this is achieved it should be relatively simple to add fucntionality to apply multiple textures at different locations.

Monday, September 1, 2008

Terrain Texturing

By examining the Torque script that runs when a texture is applied to terrain using the 'Terrain Texture Editor' I have come to understand how it may be possible to apply textures dynamically using scripts at Mission Start.
Unfortunately the method used for storing information in variables is similar to that used in the 'Terraform Editor' which prevented me from using more than one algorithm to modifiy the terrain. This problem is further compounded by the fact that the first line values accepted by variable in question is simply the path to the texture and its identifier. There is a possibility that this information is passed as bitmasked data structured in such a way that binary addition of different data results in a unique number. I will carry out some tests to determine if this is true, if not the only possible work around will be to have a single terrain texture per map and for each map to be a different mission.