Complete noob trying to import L3DT map into Torque X 3D
by John Getty · in Torque X 3D · 01/27/2010 (2:04 pm) · 10 replies
Hey,
So I'm pretty much just learning Torque X 3D and have gotten the hang of L3DT (just finished my first good map) and I want to import it into Torque X. I looked for posts on here regarding that and they were all pre L3DT 2.8 posts when we couldn't really export into Torque 3D so they probably weren't relevant. Is there anyone who could maybe explain to me what I need to do to get my terrain files from L3DT to Torque X? Thanks =)
So I'm pretty much just learning Torque X 3D and have gotten the hang of L3DT (just finished my first good map) and I want to import it into Torque X. I looked for posts on here regarding that and they were all pre L3DT 2.8 posts when we couldn't really export into Torque 3D so they probably weren't relevant. Is there anyone who could maybe explain to me what I need to do to get my terrain files from L3DT to Torque X? Thanks =)
About the author
#2
01/27/2010 (3:25 pm)
Wow, that sounds extremely annoying lol. Seems like something as useful as L3DT should have better integration... Fail on their part and Torque's part. I will give some of these fixes a try and keep an eye out for that video you make (which will be EXTREMELY helpful if you do. Probably to many ppl). Thank you very much for the response.
#3
www.youtube.com/watch?v=HsuoBEx5S4U
let me know what you think..
P-
01/27/2010 (5:05 pm)
Now This is "Turn and Burn" solution for L3DT 2.8 Standard Raw terrain..www.youtube.com/watch?v=HsuoBEx5S4U
let me know what you think..
P-
#4
01/27/2010 (5:09 pm)
part 2 quickly behind....
#5
This is "Turn and Burn" solution for L3DT 2.8 Standard Raw terrain..
I am totaly new as well...all of this is brand new...
But I hope this helps...
www.youtube.com/watch?v=oRgti6tkV5o
P-
this is the solution-
xTerrain OnRegister
XTerrain.cs
Use THis!!!----------------------
// if a material wasn't set on the terrain, get one from the terrain data
if (_material == null)
{
_createdMaterial = true;
//_material = _terrainData.CreateMaterial();
// Generate a SimpleMaterial instead, doesn't suffer from InvalidOperationException
_material = new SimpleMaterial();
((SimpleMaterial)_material).TextureFilename = this._terrainData.UniqueTextureFilename;
}
01/27/2010 (6:06 pm)
Part IIThis is "Turn and Burn" solution for L3DT 2.8 Standard Raw terrain..
I am totaly new as well...all of this is brand new...
But I hope this helps...
www.youtube.com/watch?v=oRgti6tkV5o
P-
this is the solution-
xTerrain OnRegister
XTerrain.cs
Use THis!!!----------------------
// if a material wasn't set on the terrain, get one from the terrain data
if (_material == null)
{
_createdMaterial = true;
//_material = _terrainData.CreateMaterial();
// Generate a SimpleMaterial instead, doesn't suffer from InvalidOperationException
_material = new SimpleMaterial();
((SimpleMaterial)_material).TextureFilename = this._terrainData.UniqueTextureFilename;
}
#6
Base Code for scene level xml
still needs rigid manger , etc..
<Terrain type="GarageGames.Torque.T3D.XTerrain" name="Terrain">
<Position>
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</Position>
<HorizontalScale>2</HorizontalScale>
<VerticalScale>0.4</VerticalScale>
<Scale>
<X>2</X>
<Y>2</Y>
<Z>0.4</Z>
</Scale>
<Repeat>true</Repeat>
<RepeatX>true</RepeatX>
<RepeatY>true</RepeatY>
<Data type="GarageGames.Torque.T3D.RAWTerrainData">
<TerrainFilename>data/terrains/terra.raw</TerrainFilename>
<LightMapFilename>data/terrains\terra_LM.jpg</LightMapFilename>
<TexturePathSubstitution>data/terrains</TexturePathSubstitution>
<UniqueTextureFilename>data/terrains\terra_TX.jpg</UniqueTextureFilename>
<DetailMaterial>
</DetailMaterial>
</Data>
<ViewError>2</ViewError>
<LODError>0.5</LODError>
<LevelZeroError>0</LevelZeroError>
</Terrain>
01/27/2010 (6:36 pm)
I forgot - Check Edge Wrapping!! in L3DT That was why the terrain was not tiling correctly..Base Code for scene level xml
still needs rigid manger , etc..
<Terrain type="GarageGames.Torque.T3D.XTerrain" name="Terrain">
<Position>
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</Position>
<HorizontalScale>2</HorizontalScale>
<VerticalScale>0.4</VerticalScale>
<Scale>
<X>2</X>
<Y>2</Y>
<Z>0.4</Z>
</Scale>
<Repeat>true</Repeat>
<RepeatX>true</RepeatX>
<RepeatY>true</RepeatY>
<Data type="GarageGames.Torque.T3D.RAWTerrainData">
<TerrainFilename>data/terrains/terra.raw</TerrainFilename>
<LightMapFilename>data/terrains\terra_LM.jpg</LightMapFilename>
<TexturePathSubstitution>data/terrains</TexturePathSubstitution>
<UniqueTextureFilename>data/terrains\terra_TX.jpg</UniqueTextureFilename>
<DetailMaterial>
</DetailMaterial>
</Data>
<ViewError>2</ViewError>
<LODError>0.5</LODError>
<LevelZeroError>0</LevelZeroError>
</Terrain>
#7
material== NULL (not null)??
my bad...
but that's it for me and terrain for a while...
P-
01/27/2010 (6:53 pm)
I am re-uploading both vids in hd..some parts got chopped..some important parts..500 mbs...gonna take a bit more time..material== NULL (not null)??
my bad...
but that's it for me and terrain for a while...
P-
#8
01/28/2010 (1:18 am)
I have an easier time with making what I want and exporting the heightmap into a file, and then doing the Attribute maps and exporting all of the layers into another folder and using the Import terrain height-map tool that is under the file directory when you have T3D open, and then assign materials on the Fly that way, honestly the L3DT tool is nice, but I feel my way is much less problemmatic, and I also add a 2.0 Gaussian Blur Filter to each one in Photoshop and that take out the hard looking cut from one texture to another that you get.
#9
01/29/2010 (4:50 pm)
We've shown how to do it: www.torquepowered.com/community/forums/viewthread/93769
#10
01/29/2010 (8:04 pm)
Wow. Ok I will take a look at your youtube videos and henry's post this weekend, see what happens. Thanks for the in depth comments though. I really really appreciate it.
Torque Owner Patrick Force
1). In John's book...the RAW terrain sample, also a tutorial on this web site...creates a terrain in a .cs function and then called after begin run..in the game .cs, OUTSIDE of tx3d builder..so in XNA, you can see the terrain when you run/compile..and even though it registerd as a torque object..no terrain is visable in Tx3d builder..
So after about 6 hours of trial an error..I got it to work
in the scene level editor..
There are Fundemental bugs in the terrain system, that have either not been adressed, updated..
Some issuses with the Unique Texture Name...Clip Maps..
TX3D ONLY uses (.ter) terrain version 3!!!
..this format is old..almost 5-10 years!!
T3D is at much higher version 7 or 8
It makes using, say any terain from sticks in twigs..
OR TORQUE 3D UNCOMPATABLE, without somehow converting down?
forcing you to actualy use T3D to export hieghtmaps..but textures?? good luck..(as far as I know)
Until then..nobody should go through what I went through.
Hours and hours of going through the forums..
I will create a video tutorial of how I got my L3DT terrain into TX3D BUILDER
(this may not be the right way, only way, etc)
Maby end of the day..
here are some of the fixes, that I found and had to make in the source.
clip map effect.cs
---------------------------------------
public override void CleanupEffect()
{
GFXDevice.Instance.Device.Indices = null;
for (int i = 0; i < _textures.Length; i++)
{
GFXDevice.Instance.Device.Vertices[i].SetSource(null, 0, 0);
GFXDevice.Instance.Device.Textures[i] = null;
}
_ClearParameters();
base.CleanupEffect();
}
----------------------------------------------------
xterrain.cs
Resource<Texture> tmpTex = ResourceManager.Instance.LoadTexture(_uniqueTextureFilename);
imageWidth = (tmpTex.Instance as Texture2D).Width;
----------------------------------------------------------
XTerrain.cs
// if a material wasn't set on the terrain, get one from the terrain data
if (_material == null)
{
_createdMaterial = true;
//_material = _terrainData.CreateMaterial();
// Generate a SimpleMaterial instead, doesn't suffer from InvalidOperationException
_material = new SimpleMaterial();
((SimpleMaterial)_material).TextureFilename = this._terrainData.UniqueTextureFilename;
}
patrick
(still seething)