Jump to content


Dannyx

Making textures change randomly

Recommended Posts

Good day folks. I was wondering if there's a way to make the texture on an object/surface change randomly. More specifically, I'm modelling a TV and I want to make the screen area look like one of those old TVs trying to tune in a channel and occasionally going through static or other channels before finally settling on one. Is there a way to do such thing ? I tried using video as texture and it works, so I'd like it to jump around between several videos I want to display - that's the idea....maybe go through some static every now and then, which I've achieved in the past by using the "noise". Cheers and thanks.

Share this post


Link to post
Share on other sites

To be honest the fastest and best way of doing this is to make the video loop you need in after FX or similar, then just use it as your image sequence texture for the TV. Trying to do this natively in Cinema is going to be quite a long and protracted process, and you will be constantly waiting for test renders whereas if you did it in post all that would be instant. So, possible natively, but I wouldn't recommend it.

 

But if that doesn't put you off, then you can do it in Cinema by loading your 3 video clips into a layer shader, with a load of noises on top, and keyframe the levels of the lowest layers to swap the videos, and also animate the noises on top to get the static.

 

There are ways to randomly automate that, using Xpresso, but I am not the best person to tell you how to do this.

 

CBR

Share this post


Link to post
Share on other sites
  • Topic Author
  • Doesn't C4D accept MP4s as textures ? I saw a tutorial where it worked, but all I get is a black texture and 0 frames...AVIs work just fine :|

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • That's basically what I wanted, though it's still not done native in C4D I reckon. Still, I'm having trouble getting MP4s to work...

    Share this post


    Link to post
    Share on other sites

    Just noticed you're on R15 - you might need to install Quicktime to get mp4 to load.

     

    IIRC, I did the jumping logo in XPresso using a random node, and if the random number was > (say) 0.7, it would trigger a monoflop whose state (0 - 1 output) was driving the logo mat offset. Then I overlaid the C4D movie on the TV lines from the YouTube tutorial.

     

    Then I used the resulting mp4 as the TV screen mat.

     

    Can't find the original scene file, but here's a file that switches mats randomly

     

    randomColorSwitch.c4d

     

    edit : I found the file I used to make that retro TV screen - file is a bit large because of the the noise mp4

    https://www.dropbox.com/s/8gxmd90wy7d1jtc/noisetv.zip?dl=1

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • I don't have quicktime installed ATM indeed, so I'll give it a go. That's most likely it....strange - I thought it was because of the codecs or something, despite having K-lite installed, which was all the more annoying since I'm able to play back all the formats on the planet on the PC but not load MP4s in C4D :))

    Share this post


    Link to post
    Share on other sites

    If it was me, I'd use Xpresso to switch between textures.

    I am using R18 so any example I make will not work in R15. But if you are not in a hurry I'll see if I can re-install R11 and make an example for you.

     

    Regards Bishka

     

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Not really in a hurry but not entirely dependent on this one effect either. I could just keyframe an occasional texture change...at least I think it can be done - I saw the little keyframe dot near the texture file entry (you hold CTRL and click on it to add it to the timeline), so I'm guessing it would be possible to do it the hard way. It's only a few seconds (around 10, if not less), so no need to complicate things too much. The rig is fairly slow for this kind of work, so rendering might be an issue as well....

    Share this post


    Link to post
    Share on other sites

    As a VJ I can tell you MP4 is potentially a very crappy format for random access, aka scrubbing through your timeline. Mostly because any still is based on a lot of previous frames. That is why a picture sequence like JPEG or PNG is recommended. Many tools will just convert that for you.

     

    But yeah, you can keyframe it, and even better, put it in a layer shader, and you can fade between multiple texture.

     

    Why don't you do this in post? Like render the screen, with a matte and a camera track, and later you can replace the screen with whatever you want in after effects, super simple. That is how everyone is making their phone commercials ;)

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • MP4 is what most of my files are in so it's mostly a convenience thing...yeah, they can be converted no doubt, but I reckon that would fill a folder with an image for each individual frame which would be very large...is this true ?

     

    I was thinking of doing it in post indeed, but I'm not sure how I'd go about telling my editor to replace just that one portion of the screen, since the scene is "moving", so the screens of the TVs will always be in a different place....powerful editors can probably do tracking and stuff, but I don't think I'm up to the challenge of learning a new editor just for 20 seconds of intro :))

     

    Had a look at Xpresso to at least get an idea of what it does - it can get extremely complicated, but I got the general idea: a parameter changes others. How would this apply to textures though ? I saw the guy using it for sizes and stuff...

    Share this post


    Link to post
    Share on other sites

    Many free Batch Converters to convert a whole folder of MP4's to whatever codec you need. 

    Is a 2 gigabyte folder filled with PNG files still large in 2018? That shouldn't be an issue with todays HD prices.

     

    The integration with AE (After Effects)  and C4D is very good for this. You just place a grid to the place where the screen is and give it an External Compositing tag.  And you can save out an AE file, and this will generate a composition with your camera and a  solid in 3D. And you can render separate passes for the reflection and overlay them. Plus side is it renders replacing the screen visuals is super fast because you don't need to re-render from cinema. But, if you don't know After effects, this route may be too much. And this works best for flat screens.

     

    Xpresso is extremely powerful, and specific for what YOU need it for. So, what you want to do with it? The weakness, for me, is that when I start layering stuff, the Xpresso doesnt let me control those parameters, like a noise in a layershader.

     

     

     

     

     

    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

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×