Game Development Community

Texture larger than terrain problems

by Alexis Brown · in Torque Game Engine Advanced · 08/22/2006 (12:08 pm) · 3 replies

I used l3dt to generate a 1024x1024 terrain with a 4096x4096 texture. It all compiles fine but when I load it up in TSE I see the terrain pop into view then it gives me "AtlasTextureQuadRenderer::renderDouble - invalid texcoord!" error and shutsdown.

first try
//// Convert the raw heightfield.
atlasOldGenerateChunkFileFromRaw16("terrain_water_demo/l3dt/1024_terrain3.RAW", 1024, 2.0, 1.0/150, "terrain_water_demo/geometry.chu", 2.0, 4);
importOldAtlasCHU("terrain_water_demo/geometry.chu", "terrain_water_demo/geometry.atlas");

//// Import opacity/alpha map.
//// note: the png file need to contain the 4 alpha maps on separate layers
atlasGenerateTextureTOCFromLargeJPEG( "terrain_water_demo/l3dt/2x_lm.jpg", 2, "terrain_water_demo/opacity.atlas");

//// Load  lightmap and JPEG compress.
atlasGenerateTextureTOCFromLargeJPEG( "terrain_water_demo/l3dt/2x_texture.jpg", 2, "terrain_water_demo/lightmap_png.atlas");

atlasConvertTextureTOC("terrain_water_demo/lightmap_png.atlas", "terrain_water_demo/lightmap.atlas", 0);

//// Finally combine into a blender terrain.
atlasGenerateBlenderTerrain("terrain_water_demo/myterrainA.atlas", "terrain_water_demo/geometry.atlas", "terrain_water_demo/opacity.atlas", "terrain_water_demo/lightmap.atlas");

quit();

second try
// Convert the raw heightfield.
atlasOldGenerateChunkFileFromRaw16("terrain_water_demo/l3dt/1024_terrain3.RAW", 1024, 2.0, 1.0/150, "terrain_water_demo/geometry.chu", 2.0, 4);
importOldAtlasCHU("terrain_water_demo/geometry.chu", "terrain_water_demo/geometry.atlas");

// Import opacity/alpha map.
// note: the png file need to contain the 4 alpha maps on separate layers
atlasGenerateTextureTOCFromTiles(2, "terrain_water_demo/l3dt/2x_lm_x%dy%d.png", "terrain_water_demo/opacity.atlas");

// Load  lightmap and JPEG compress.
//atlasGenerateTextureTOCFromTiles(4, "terrain_water_demo/l3dt/4096_texture_x%dy%d.png", "terrain_water_demo/lightmap_png.atlas");
atlasGenerateTextureTOCFromTiles(2, "terrain_water_demo/l3dt/2x_texture_x%dy%d.png", "terrain_water_demo/lightmap_png.atlas");

atlasConvertTextureTOC("terrain_water_demo/lightmap_png.atlas", "terrain_water_demo/lightmap.atlas", 0);

// Finally combine into a blender terrain.
atlasGenerateBlenderTerrain("terrain_water_demo/myterrainA.atlas", "terrain_water_demo/geometry.atlas", "terrain_water_demo/opacity.atlas", "terrain_water_demo/lightmap.atlas");

quit();

third try
// Convert the raw heightfield.
atlasOldGenerateChunkFileFromRaw16("terrain_water_demo/l3dt/1024_terrain3.RAW", 1024, 2.0, 1.0/150, "terrain_water_demo/geometry.chu", 2.0, 4);
importOldAtlasCHU("terrain_water_demo/geometry.chu", "terrain_water_demo/geometry.atlas");

// Import opacity/alpha map.
// note: the png file need to contain the 4 alpha maps on separate layers
atlasGenerateTextureTOCFromTiles(4, "terrain_water_demo/l3dt/4096_lm_x%dy%d.png", "terrain_water_demo/opacity.atlas");

// Load  lightmap and JPEG compress.
atlasGenerateTextureTOCFromTiles(4, "terrain_water_demo/l3dt/4096_texture_x%dy%d.png", "terrain_water_demo/lightmap_png.atlas");

atlasConvertTextureTOC("terrain_water_demo/lightmap_png.atlas", "terrain_water_demo/lightmap.atlas", 0);

// Finally combine into a blender terrain.
atlasGenerateBlenderTerrain("terrain_water_demo/myterrainA.atlas", "terrain_water_demo/geometry.atlas", "terrain_water_demo/opacity.atlas", "terrain_water_demo/lightmap.atlas");

quit();

#1
08/22/2006 (12:11 pm)
The actual hf is exported as 1025x1025 would that mean I need to 4 x 1025 - 1 texture?
#2
08/22/2006 (2:46 pm)
I couldn't get the atlasGenerateBlenderTerrain to work even when the tex was the same size as the HF. But I did manage the following sequence for a larger texture than the HF:

generateChunkFileFromRaw16
importOldAtlasCHU
atlasGenerateTextureTOCFromLargeJPEG
atlasGenerateUniqueTerrain
#3
08/22/2006 (4:26 pm)
Using atlasGenerateUniqueTerrain seems to work. So did using a 1024x1024 lightmap with the larger texture.