How to scale ground texture material without scaling splat texture

Software: Away3D 4.x

Avatar
plokk, Newbie
Posted: 19 July 2012 06:56 PM   Total Posts: 5

Hello,

I have a following problem.

I am trying to achieve an elevation mesh with splat texture map but instead of a diffuce map as a base texture I want to have a tiled bitmap texture so that where splat texture is not drawn a tiled base bitmap texture is shown.

Everything works perfectly, but I haven’t figured out how to scale the base texture without scaling splat textures since all textures are applied to the same elevation mesh, .geometry.scaleUV will scale all of them.

var terrainMethod:TerrainDiffuseMethod = new TerrainDiffuseMethod([new BitmapTexture(new Beach().bitmapData), new BitmapTexture(new Grass().bitmapData), new BitmapTexture(new Rock().bitmapData)], new BitmapTexture(new Blend().bitmapData), [1101010]);
// Splat textures are repeated 10 times but this won't affect groundTexture

// Texture I wan't to repeat   
var groundTexture:BitmapTexture = new BitmapTexture(new GroundDiffuse().bitmapData);       
   
var 
terrainMaterial:TextureMaterial = new TextureMaterial(groundTexture);  
terrainMaterial.repeat true// Not repeating because scaleUV can't be used     
terrainMaterial.diffuseMethod terrainMethod;   
   
this._plane = new Elevation(terrainMaterial, new HeightMap().bitmapData25040250303040); 

As you can see from the attached screenshot, the splat texture tiles perfectly, but the base texture (red/white squares) is not tiled.

 

   

Avatar
plokk, Newbie
Posted: 19 July 2012 08:59 PM   Total Posts: 5   [ # 1 ]

Just figured out that I am able to achieve desired outcome by tiling the texture in bitmapdata. However, I would really like to know if this is possible by using Away3D methods.

   

Richard Olsson, Administrator
Posted: 20 July 2012 10:57 AM   Total Posts: 1192   [ # 2 ]

Correct me if I’m wrong, but can’t you achieve exactly what you’re after using the third argument to the TerrainDiffuseMethod constructor, which is an array of tile values for each of the textures involved (including the base texture)?

   

Avatar
plokk, Newbie
Posted: 21 July 2012 07:29 AM   Total Posts: 5   [ # 3 ]
Richard Olsson - 20 July 2012 10:57 AM

Correct me if I’m wrong, but can’t you achieve exactly what you’re after using the third argument to the TerrainDiffuseMethod constructor, which is an array of tile values for each of the textures involved (including the base texture)?

You achieve only tiling for splat textures you assign with .diffuseMethod. This is because the base texture is not included in TerrainDiffuseMethod. I think base texture is designed to not to tile because that is how it is used in normal occasions.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X