Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

How to maintain a nice revolving skydome?

Recommended Posts

The sky texture is a polar distorted map with planar mapping.
When I multiply the uv a constant factor or time factor, the texture just goes crazy. How do I make it spin more decently? It just spinning like crazy, you have to get nausea for this
Thanks
Jack

float4 SkyDomePS(float2 tex0    : TEXCOORD0) : COLOR
{
   float2 rotator = float2(0.0, 0.0);
float2 panner0 = float2(0.0, 0.0);
float2 panner = float2(0.0, 0.0);
float2 star = float2(0.0, 0.0);
float4 horizonColor = float4(0.0, 0.0, 0.0, 0.0);
float  t = 0.0;

//rotator = skyRotation * localTime * tex0;
rotator = tex0 + localTime;

//rotator.y = rotator.y + skyRotation;


float4 sample0 = tex2D(skyTexSampler, rotator);

Share this post


Link to post
Share on other sites
Advertisement
1 hour ago, lucky6969b said:

When I multiply the uv a constant factor or time factor, the texture just goes crazy. How do I make it spin more decently?

Why not just slow it down by multiplying with a small value?

rotator = (skyRotation * localTime * tex0) * 0.01f; //Should slow it down by a hundredth

I assume localTime here is time since the last frame, delta time?

Of course you don't need to hard code it, you could use some kind of input or base it on the games frame rate.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!