Texturing a large surface (183661)

Hi

I need to texture a large surface that is about 1000 feet long, but upon which I cannot use repeated tiling because the texture, though continuous, never quite repeats itself.

It seems that I can either to make one large texture (which would need to be a 4096 texture and even that will not produce the desired detail close up) or to divide it up into many textures.

If I use the second approach, I can only think of two ways to do it in a modelling program. The first is to simple break the mesh up into smaller pieces, and texture them separately, which is something I want to avoid; the second is to use multi/subobject material (ie multiple material ids… I don’t even know if that is supported).

Looking forward for some help. I’m hoping there are more options than this!

2 Answers

2

You could use the same approach that a terrain is normally using. It has several tiled textures that blend by a splat map. Another way is to have a base texture and place decals on it to break it up. Like you mention yourself increasing the texture size is not the best option on its own since even with a 4k texture each pixel would have to cover 3 inches. Sub-object materials should be supported up to a point. The performance would be the same as having individual materials though.

Hi & thanks Decals won't work for this. If multiple material IDs work on the same surface, then it might be the way. Would I need a splat map, even if the textures join up perfectly? /Jason

–

Here is a custom shader I wrote to allow up to three textures to be placed on a surface.

to use it just draw a smaller image as a “map” to assign where you want your textures placed.
when you draw your “map” texture simply use colors red white and blue to represent where the actual textures are placed!

to make a new custom shader, in the project tab in the inspector select create/shader.
then open it and stick this code in it:

i hope this helps!!!

Shader "todds/3Textures" {
	Properties {
	   // _Color ("Overall Color", Color) = (1,0.5,0.5,1)
		_t1 ("texture in white", 2D) = "white" {}
		_tint1 ("Tint1", Color) = (1.0, 0.6, 0.6, 1.0)
		
		_t2 ("texture in red", 2D) = "white" {}
		_tint2 ("Tint2", Color) = (1.0, 0.6, 0.6, 1.0)
		_rc ("low cutoff", Range(1,80)) = 0.0 
		_t3 ("texture in blue", 2D) = "white" {}
		_tint3 ("Tint3", Color) = (1.0, 0.6, 0.6, 1.0)
		_rb ("low cutoff", Range(1,80)) = 0.0 
		_t4 ("texture map", 2D) = "white" {}
		
		
	}
	SubShader {
		//Tags { "RenderType"="Opaque" }
		LOD 200
		
		CGPROGRAM
		#pragma surface surf Lambert
        float _rc;
        float _rb;
		sampler2D _t1;
		sampler2D _t2;
		sampler2D _t3;
        sampler2D _t4;
        
        fixed4 _tint1;
        fixed4 _tint2;
        fixed4 _tint3;
        
		struct Input {
			
			float2 uv_t1;
			float2 uv_t2;
			float2 uv_t3;
			float2 uv_t4;
			
		};
      

		void surf (Input IN, inout SurfaceOutput o) {
		    
		    float f;
		    
			half4 pix = tex2D (_t1, IN.uv_t1)*_tint1;
			half4 map = tex2D (_t4, IN.uv_t4);
			f=map.r;
			
			f=f*_rc;
			if(f>1){f=1;}
			pix=pix*f;
			f=1-f;
			pix=pix+tex2D (_t2, IN.uv_t2)*f*_tint2;
			
			f=map.b;
			f=f*_rb;
			if(f>1){f=1;}
			
			pix=pix*f;
			f=1-f;
			pix=pix+tex2D (_t3, IN.uv_t3)*f*_tint3;
		    
			o.Albedo = pix.rgb;
			
		}
		ENDCG
	} 
	FallBack "Diffuse"
}