Looking for a visual shader UV Scroll shader tutorial

justinbarrettjustinbarrett Posts: 178Member

I'm trying to get UV scrolling working with the visual shader editor...it should be easy but TBH I'm a bit of an idiot when it comes to shaders in general....

So, can someone tell me how or point me to a tutorial to do this?

I am trying to get a kind of wavy ghost hair effect for an enemy using a hair alpha texture mixed with vertex color(multiplying the alpha) to get a ghostly or underwater effect for the hair.

Comments

  • MegalomaniakMegalomaniak Posts: 2,658Admin

    First ScalaOp after time input is to modulate time(speed control) the second one after the sinewave is to modulate the sinewaves amplitude.

  • SIsilicon28SIsilicon28 Posts: 720Moderator

    @Megalomaniak said:

    First ScalaOp after time input is to modulate time(speed control) the second one after the sinewave is to modulate the sinewaves amplitude.

    That's a great starting point. As it is right now however, it is just moving texture side by side. To make it wavy, you should add an offset to the sine along with TIME. In this case you could add the UV's y component to it, multiplied by a variable number to determine it's frequency.

  • MegalomaniakMegalomaniak Posts: 2,658Admin

    Yes, that's right.

  • justinbarrettjustinbarrett Posts: 178Member
    edited March 14

    thanks guys(I assume you are men :) ) I will plug it all up in a few minutes...just rolled out of bed :)
    EDIT: set it up, just swapped the x,y because I am scrolling in the other coord...but everything is working...thanks.

  • justinbarrettjustinbarrett Posts: 178Member

    double edit: first sorry, I couldn't edit my previos post...don't know why.

    but upon closer inspection(after coffee) I realized that it is not scrolling but stretching or oscillating ...I know it's the sin function/operation but I just want it to scroll...I could use it like this, but would prefer it to simply scroll. Not that I don't appreciate the help.

  • MegalomaniakMegalomaniak Posts: 2,658Admin
    edited March 14

    I think there might be a time limit for how long you can actually edit your posts as a user, might have been 1h.

    @justinbarrett said:
    but upon closer inspection(after coffee) I realized that it is not scrolling but stretching or oscillating ...I know it's the sin function/operation but I just want it to scroll...I could use it like this, but would prefer it to simply scroll. Not that I don't appreciate the help.

    You likely have used a Multiplication ScalarOp instead of an Addition then for the third Scalar Op. Look at my image above again.

    Or do you mean that it's ping-ponging/swaying back and forth? if that is what you mean then yeah, you can just cut the Sinewave ScalarFunc and the following Mult ScalarOp out to remove the sway.

  • justinbarrettjustinbarrett Posts: 178Member

    ok. yes, that is the case so.....I went out of time(node/output) to a scalar(divide/to slow it) and then into the vector compose and that works...thank you very much.

  • AlphinAlphin Posts: 3Member

    simpler version

    it scrolls vertically, but how do you scroll horizontally?
    Connect ScalarOp to x on VectorCompose and disconnect Y input

    You can change the speed by changing the value of the Multiply node (ScalarOp), this scrolls backwards, you can scroll forward by changing the value to negative

  • justinbarrettjustinbarrett Posts: 178Member

    Yes, thank you..I already did all that...it was easy to figure out....
    Still it's good to have reference here on the forum if anyone searches for it.

  • dshultz2dshultz2 Posts: 1Member

    I am having a problem with creating a scroll shader that doesn't seem to be addressed by above. I attached two images to show the problem. Adjusting UV on the texture is not functioning as I expected.

  • SIsilicon28SIsilicon28 Posts: 720Moderator
    edited June 10

    The UV doesn't look right... Have you tried attaching the UV input directly to the texture and see what happens?

    Edit: No wait! I think it might be the texture itself. Have you enabled repeat on the texture?

  • MegalomaniakMegalomaniak Posts: 2,658Admin

    Make sure your texture(in the import settings) is repeatable.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file