nate066 Posted January 29, 2014 Share Posted January 29, 2014 I see there is a animated texture shader in the shaders folder but how do I get it to work? Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 29, 2014 Share Posted January 29, 2014 it should be named skinning shader instead of animated, it's for boned animation. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rick Posted January 29, 2014 Share Posted January 29, 2014 Is there a way to do this for like lava/water in a river/waterfall or something where we move the UV mapping to make the texture look like it's moving? Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 29, 2014 Share Posted January 29, 2014 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. 2 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rick Posted January 29, 2014 Share Posted January 29, 2014 How do we set the value of the currenttime uniform again from the game or is that a special variable that all shaders have access to? Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 29, 2014 Share Posted January 29, 2014 Its an engine uniform. So it always updated by the engine. No need to set it. 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
nate066 Posted January 29, 2014 Author Share Posted January 29, 2014 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. Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 29, 2014 Share Posted January 29, 2014 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)]) Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
nate066 Posted January 30, 2014 Author Share Posted January 30, 2014 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. Quote Link to comment Share on other sites More sharing options...
3Dski7059 Posted January 27, 2015 Share Posted January 27, 2015 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??? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted January 27, 2015 Share Posted January 27, 2015 Wouldn't you juse AddForce if the player was standing anywhere on the belt? Quote Link to comment Share on other sites More sharing options...
3Dski7059 Posted January 31, 2015 Share Posted January 31, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.