Skip to main content
GameDev.net gamedev.net
🔒 Locked

Problems animating a texture..

Started by ph33r Jan 10, 2005 at 2:13 AM 3 replies 400+ views
Original Post
ph33r
ph33r
In a simple vertex shader I wrote to animate a texture, every few seconds the texture stops moving then starts again. Here is the vertex shader.
VS_OUTPUT WaterVS( float4 Pos : POSITION, float4 Normal : NORMAL, float2 Tex : TEXCOORD0 )
{
	VS_OUTPUT output = (VS_OUTPUT) 0;
	
	output.Pos = mul( Pos, matWorldViewProj );
 
	output.Tex.x = Tex.x + time;
	output.Tex.y = Tex.y + time;
 	
 	output.Norm = Normal;
	
	return output;
}
Pretty simple. Time is calculated by somethingg like this static float fTime = 0.0f; fTime += fDT; Where fDT is the change in time since last frame.
bit64
bit64
I would say that this is most likely a phenomenon caused by some other process on your machine hogging resources, or even a different portion of your own application.
Don't be afraid to be yourself. Nobody else ever will be.
ph33r
ph33r
Quote:
Original post by bit64
I would say that this is most likely a phenomenon caused by some other process on your machine hogging resources, or even a different portion of your own application.


I don't know about that my game runs at a consistant 80 fps. I think I'm not properly animating the uv's correctly.
bit64
bit64
Hmmm, well I don't see anyting wrong with your shader, perhaps the way you are determining delta time is incorrect. Could you paste that code instead?
Don't be afraid to be yourself. Nobody else ever will be.
ph33r
ph33r
Thank you bit, it was a problem with calculating dt.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.