How to animate the UV correctly?

Started by
8 comments, last by lucky6969b 6 years, 9 months ago

How to animate the UV of textured vertexes so that the texture seems like sweeping across horizontally and slowly?

The target are general skies, If I want to have day-and-night effect, do I download a seamlessly perfect day-and-night sky texture?

which the ends touch and wrap around the other?

Advertisement

pass in a float with your constant buffer, or two, then add that to the uv coordinates

like uOffset and vOffset for example

Then you can either enable wrapping in your sampler, or just manually make sure the offset stays normalized (between 0.0 and 1.0, if it goes over 1.0, then have it wrap back around to 0.0, and if it goes below 0.0, have it wrap back around to 1.0)

I'm not aware of any kind of day-and-night skybox and I don't see one on google, but another option you have is interpolating between a day skybox with moving u and/or v offsets like @iedoc mentioned above and a night skybox. This way the clouds/sun are moving realistically and you still get a nice transition between times of day. You could even interpolate between dusk/dawn skyboxes as well in the transition. 

I'm not sure a day-and-night skybox would be a good idea since half the skybox would have to be bright and the other half would be dark. I think it would be hard to make that transition look good with one skybox. 

https://blenderartists.org/forum/showthread.php?24038-Free-high-res-skymaps-(Massive-07-update!)

If I take one of those, I can make an animated sky only for one of the planes of the skybox,

Can I map a single texture to top, left, right, front and back planes all at once,

BTW, if I take the one above, that is spherical maps, I only get static skydomes,

Is it possible to simulate the day-and-night effect with a single spherical map?

Thanks

Jack

1 hour ago, lucky6969b said:

Is it possible to simulate the day-and-night effect with a single spherical map?

You would need to capture your own sky maps. Setup your camera and then take a shot every hour.This will give you a 24 frame movie. Blend frames to get a smoother result.

The obvious side effect is the size of 24 HD images. How you get around that is up to you.

 

A other way is to make your own sky material, like Unreal does. It will generate a fake looking sky, yet will be very fast.

How about using a damn longish texture...

then map 0,0 -> 0.1,0  for left plane, 0.1,0 -> 0.2,0 for front, 0.2,0 -> 0.3,0 for right -> 0.3,0 -> 0.4,0 for back

and swifting the UV then wrap to 0,0 again....

Thanks

Jack

You can also try to use a texture matrix. Changing values in the location row/column will make the image move.

52 minutes ago, lucky6969b said:

How about using a damn longish texture...

The loading time on a texture of this size would be a nightmare.

If you used level streaming to fake moving from level to level, then kept the huge texture loaded it could work. That way the player would only have to load it once.

The other problem is that depending on the players ram and graphics card a texture like that could fail to load.

 

You have the same problem with textures as the old systems. They invented tiling back then to do this kind of thing, now you are trying to do the same at a much larger scale.

Something to consider.

1) If I don't like generating the sky using POV/fractals artifically because of personal preferences.

2) If I move the uvs with the skydome, I just get a revolving sky.

3) If I omit part of the uvs, and showing them later, the texture on the skydome won't be continuous

4) Is it possible to patch the textures at runtime?

5) Is it very resource hungry for mapping avis to spherical mesh?

 

Update:

I've successfully mapped an avi to the skydome, but the resolution allowed is ridiculously low...

like 384x180 (or 384x240) but my avi is out of aspect ratio

Thanks

Jack

This topic is closed to new replies.

Advertisement