• Advertisement
Sign in to follow this  

How to make textures move?

This topic is 3379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have generated some 2D noise (Perlin) textures that I map to a sphere. But is there someway to make these 2D cloud like textures move? I was thinking about generating two different sets of texture coordinates and then use these in the fragment program to lookup in each of the textures but I am a bit unsure on how to work out the details.

Share this post


Link to post
Share on other sites
Advertisement
In my sky dome, I keep the normal texture coords (stored in VBO) I generate when i make the dome, when rendering I just simply also pass a uniform vec2 call offset, which I offset the current texture coordinates by.

so

uniform vec2 offset;
varying vec2 texCoord;

texCoord = glMultiTextureCoord0;
texCoord += offset;

I usualy just calculate my "offset" by incrementing each frame based on time passed.

this should give you a very simple cloud movement, using some things like a sine wave, you could get a more realistic movement than simply rotating around the sphere.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement