Jump to content

Recommended Posts

Posted

This can be easily done with a shader. Declare a uniform in the fragment shader like this:

uniform float currenttime;

 

Then use that to modify your texture coordinates:

texcoords.y += currenttime/100.0;

  • Upvote 1

 

 

  • 1 month later...
Posted

Sorry I'm trying to get this working and I'm a shader noob which is a bad combo....

 

 


//Uniforms
uniform sampler2D texture0;//diffuse map
uniform float currenttime;

//Inputs
varying vec2 ex_texcoords0;
varying vec2 ex_texcoords1;
varying vec4 ex_color;
varying float ex_selectionstate;

void main(void)
{

vec2 texcoords = ex_texcoords0;

texcoords.y += currenttime/100.0;

vec4 outcolor = ex_color;

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

//Blend with selection color if selected
gl_FragColor = outcolor;
}

 

Obviously it's not working, am I on the right track? Any clues on how to get it working? Any help would be appreciated!

 

Cheers!

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0

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