Is there a way to cycle through different tiles for a scrolling background?

I have a seamless background, but I think it would be cool to cycle randomly through a few variations of the background. Is there a way to set up the material or the quad to randomly pull a background image from an array and make it the “next” image that shows up?

Hi Ryan,

There is. First of all, learn the basics of HLSL/Cg. Then write your own shader. You need two textures which you need to blend into one another or whatever your idea is. And a script which controls certain values in the shader. It sounds more difficult than it is. If you know a bit about maths, it’s relatively easy.

I wrote a solution a couple of months ago in the Q&A section on Udemy. Unfortunately, the links don’t work for us teaching assistents at the moment due to a bug. You could look for the thread yourself. Maybe you can find it.

Here is the link. Maybe it is working for you:

Please feel free to ask our helpful community of students for advice in our official Discord chat.

Hi Nina!

Thanks for the response. I’m searching through the Udemy Q&As but I’m not seeing it. Would you mind telling me which lesson it’s attached to so I can search there?

Thanks!

As aforementioned, links do not work for me on Udemy. I browsed the Q&A section for you and found a thread where I had linked the other thread. I copied and pasted that link here. In the Q&A section, I looked for “multiple backgrounds” because I thought that the original thread had this title or a similar title.

The title of the thread I found is: “[Question] Can we have multiple backgrounds in the scene that scroll, If so how

Hi Nina!

Sorry, I misunderstood how the Q&A search feature worked - I didn’t realize it was searching through all of the lectures’ Q&As.

I’ll give your solution a shot! Thank you!

1 Like

How are you getting on with this? Did my solution work for you?

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.

Privacy & Terms