Jump to content

Recommended Posts

Posted

Yes add to uniforms

 

uniform float currenttime;

 

Then change

 

 //Modulate blend with diffuse map
outcolor *= texture(texture0,ex_texcoords0);

 

to something like :

 

 //Modulate blend with diffuse map
outcolor *= texture(texture0,ex_texcoords0+currenttime/1000);

 

texture will then scroll slowly in U and V if not clamped.

  • Upvote 2

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Posted

Its an engine uniform. So it always updated by the engine. No need to set it.

Is there a way to use a folder with a image sequence inside to animate the the texture on the model. It would be a lot more powerful then just moving the uv's.

Posted

Yeah you can do that in lua, no need to make any special shader.

 

Just load textures 1-20 or whatever number of frames you have in a table in script:start

Then change texture every frame using something like this in update()

 

i=i+Time:GetSpeed()

if i>20 then i=1 end

material:SetTexture(tableoftextures[math.floor(i)])

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Posted

Yeah you can do that in lua, no need to make any special shader.

 

Just load textures 1-20 or whatever number of frames you have in a table in script:start

Then change texture every frame using something like this in update()

 

i=i+Time:GetSpeed()

if i>20 then i=1 end

material:SetTexture(tableoftextures[math.floor(i)])

Thanks Shadmar, I haven't been able to test it out yet but i will post what i do with it.

  • 11 months later...
Posted

I'm here because I was searching for information on moving a texture. Actually, my intent was the idea of creating a conveyor belt. But, then I wondered how to implement the motion. I suppose you could set up physics in such a way as to cause the player to slide across the surface at the same speed as the texture... Do any of you have experience with this implementation idea?

 

UPDATE: As an alternative, I could create the belt as a animated model. But, then I have to figure out how to implement the interaction between things and the belt motion???

Posted

I figured it would something like that and sounds like it would be just playing around to get the force and direction correct. Then, I'd just have to figure out if can/should just animate the texture in the FBX.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...