Jump to content

Leadwerks animated textures


nate066
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 11 months later...

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???

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...