entity texture tiling

Posted By: darkinferno

entity texture tiling - 10/01/09 18:06

well am not sure if this is where this should go but heres what i want to achieve:



normally when an entity is scaled, its skin gets stretched but what i want to do is have the skin repeat/tile, is there away to accomplish this with/without a shader? doesnt matter either way

-thanks in advance-
Posted By: XD1v0

Re: entity texture tiling - 10/03/09 12:46

darkinferno you can scale UV texture coordinate for each vertex in model (ent_getvertex,ent_setvertex)
Posted By: Ganderoleg

Re: entity texture tiling - 10/03/09 14:23

If your using MED then only way to make textures tile (in their original size) after resizing (scaling faces or changing vertex position) is to go to Skin Editor and resize the skin mapping (by scaling faces or changing vertex position).

Sorry- you meant ingame re-scaling of textures blush ...don't know about that.


Posted By: darkinferno

Re: entity texture tiling - 10/03/09 14:46

Originally Posted By: XD1v0
darkinferno you can scale UV texture coordinate for each vertex in model (ent_getvertex,ent_setvertex)
i read up on it but didnt see any information about UV coordinates so am not entirely sure, any tips?
Posted By: Ralph

Re: entity texture tiling - 10/04/09 13:56

Edit:
I dont read that you doesnt want to use a shader...
But i made a texture tiled function a while ago..search at my name and you will find it. wink
You can try a pixel-shader like this:
Code:
MATERIAL* tiled_texture ={
	effect="
	float4 vecSkill1;
        sampler2D smpSource = sampler_state { texture = <entSkin1>; };
        float4 myShader( float2 Tex : TEXCOORD0 ) : COLOR0 
	{
                Tex.x = Tex.x * vecSkill1[0];
                Tex.y = Tex.y * vecSkill1[1];
                return tex2D(smpSource,Tex.xy);
        }

	technique postFX 
	{ 
		pass p1 
		{ 
			PixelShader = compile ps_2_0 myShader(); 
		} 
	}
	";
}
//And this should be in the entity function
function entity_func(){
	my.material = tiled_texture;
	while(1){
		tiled_texture.skill1 = floatv(my.scale_x+my.scale_z);
		tiled_texture.skill2 = floatv(my.scale_y+my.scale_z);
		wait(1);
	}
}


(This is not tested, but it should work)
Greetings Ralph
© 2024 lite-C Forums