   Texture Wrapping points
  Hey guysI have seen in a few games lately (eg. devil may cry 4) that the texture library's are mainly consisting of texture sheets for level geometry. one of the fascinating things I found though was that the texture sheets (textures with around 5 or so elements that could be used in thousands of ways) had their texture elements in a tiled texture without new polygon creationeg: there is an area of the texture sheet that uses some roof tiles, they can crop the rest of the image then wrap the roof tiles like a single image, kind of like a independent textureI know you can change the dimensions of the texture in the sampler, but I was wondering if there is a type of crop function in the sampler (using VS/PS version 3)Thanks heaps!Angus   
  not sure about a crop function, but you can read the bytes from part of a texture and create a new texture from them   ;  There's nothing you could do with sampler states or anything like that...you could do it manually in the shader I suppose using some fmods. I would imagine that the DMC4 guys just explicitly wrap the UV's in the level geometry.   ;  thanks for the quick responsesMJP: whats a shader Fmod, whenever I hear Fmod I think of the sound engine, Google thinks that too. I am cool with manually hard-coding Coords and stuff as it will only be used in once special instancemajek: I have no idea how you would do that. to me tex2D goes something like thistexturesamplertex2d????profit!   ;fmod;  Thanks heaps MJP! fmod does the trickthere was a few troubles implementing it, like the edges of the texture had horrible artifacts, but its easily resolvable by turning off mip lvlsI make all object's in max, but it has that LAME z-up system, which makes UV invert the Y coord sometimes (Wierd Eh) I fixed it by inverting the fmodAlso, for the UV coordinates I did something like this//X-YMul & X-YAdd are globalsfloat XCrop = -fmod(IN.UV.x,FcropX); //fmod is inverted due to 3ds max z-up sysfloat YCrop = -fmod(IN.UV.y,FcropY);float2 Tex = float2(XCrop,YCrop);Tex *= float2(XMul,YMul); //ScaleTex += float2(XAdd,YAdd); //Offsetso I have found its best to set your crop weights first, then set the UV scale and offset later   