Sine and Cosine Nodes | 5-Minute Materials [UE4]

Поділитися
Вставка
  • Опубліковано 27 вер 2024
  • Hey Prismaticult! In today's episode of 5-Minute Materials we're looking at the Sine and Cosine Nodes! These node are essential in creating animated textures and can provide the basis for a TONNE of shader-based effects including fluctuating brightness, crazy patterns, remapping values/gradients, creating vertex displacement animations and MUCH much more.
    I also want to give a shout out to our latest Patron ~Griblet~ (Isaac) who is an amazing 2D artist dipping their feet into the 3D world. (Links to their work SOON)
    ------------------------------
    Discord - / discord
    Patreon - / prismaticadev
    Twitch - / prismaticadev
    Twitter - / prismaticadev
    ------------------------------
    Computer Specs:
    Ryzen 3900x 12-core CPU
    MSI Geforce RTX 2080 Super
    64GB Corsair RAM
    One of those fancy nvme m.2 SSD's
    Programs of choice:
    Unreal Engine 4 - (Game Dev)
    Blender 2.8 - (Animation and Modelling)
    OBS - (Video/screen capture)
    Davinci Resolve - (Video editing)
    Adobe Photoshop - (Graphics and Texturing)
    Quixel Mixer - (Texturing)
    ProTools 11 - (Compositions and mixing)
    OldSchool Runescape - (Chillax time)
    Filmed using:
    Sony A7s2 body
    Sony 24-70mm f/2.8 GM lens
    Yonguo YN360 LED's for colour
    Yongnuo YN760 chip LED w/ Godox softbox for key
    My lovely cats names are Boycat, Girlcat and Ladycat :)

КОМЕНТАРІ • 72

  • @timboslice5351
    @timboslice5351 7 місяців тому +5

    Your "that is fucking terrifying" reaction just made my midday. Thank you for the great videos, Charlie!

  • @JayCreationsDev
    @JayCreationsDev 3 роки тому +26

    we live for 5 minute materials

  • @bersK00
    @bersK00 3 роки тому +20

    It's pretty funny how you can see youtube's compression+bitrate fall apart when something starts changing colors quickly around the 4 min mark :D Love this series btw!

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +2

      Hahahahaha I cannot unsee this. It might even be my export settings - I tend to export at a bitrate of 35,000kbp/s since UA-cam will inevitably compress it but I'll double check the exported file :P
      Glad you're enjoying! Excited to keep it going :)

  • @TerraTFT
    @TerraTFT Рік тому +6

    I think the most useful part about these tutorials is that you provide your thought process with these tools. Even moreso because you end up going in directions that I wouldn't personally think of, so I always end up learning a lot more than I came here for.

  • @michaelpease2103
    @michaelpease2103 8 місяців тому +4

    This will be incredibly useful in conjunction with a white/blue color and a rocky normal map to make ice. It will look slightly transparent at the edges but not where the ice is thicker.
    Thanks dude!

  • @Fokkusu
    @Fokkusu 3 роки тому +8

    Really cool nodes, I didnt know about cosine and I was just using sine without realizing the potential it has, like yeah a little bit your video definitely expanded the horizon quite a bit, thanks ^^

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +1

      I didn't think of using Cos until I was struggling with getting a sine to start at 0 but maintain 0-1. I forget what the actual case was but then I thought of Cos!

    • @Fokkusu
      @Fokkusu 3 роки тому +2

      @@PrismaticaDev I imagine the moment you used cos you laughed, I have a lot of those moments where I overcomplicate stuff to find out later than the solution is really simple

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +1

      @@Fokkusu Literally hahahah. I was about to remap the entire output of the thing to a curve LUT until I realised I could get it to start from 0 with Cos...

    • @Fokkusu
      @Fokkusu 3 роки тому

      @@PrismaticaDev xD, thats wild, Im glad you found out BEFORE doing that

  • @Daniel-be6cj
    @Daniel-be6cj 2 роки тому

    You're bit about how materials don't like negative numbers was the "A-ha!" moment that helped me get my material working, great stuff and to the point!

  • @LarsBryrup
    @LarsBryrup 3 роки тому +4

    Just happened over this by chance, saw it and a few minutes later had updated some materials in my game to use this to create a pulsing glow. Amazing series - I gotta watch 'em all!

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому

      Fantastic my dude! Really glad it helped out :)

  • @Greenrobotvp
    @Greenrobotvp 11 місяців тому

    Dude! the way you visualize the negative 1 and 1 and why you do that is so valuable, I could never wrap my head around why I have to do that but this helps so much!

  • @snookofficial7211
    @snookofficial7211 Рік тому +1

    These video are great help. I was really confused using the sine node as it just seemed to be a bit a random, now I understand why, you need to divide by 2 and add 0.5 to bring it above 0. Great explanation. Thanks

  • @joshuaisraelalbao1877
    @joshuaisraelalbao1877 3 роки тому +5

    Wonderful content, as usual!

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +1

      Thanks Joshua! Very happy that you're enjoying it :)

  • @UnderfundedScientist
    @UnderfundedScientist 3 роки тому

    I'm going to have to watch this entire series

  • @sturgisDhouston
    @sturgisDhouston 3 роки тому +2

    Would be interesting to play with this node and the one you used for water, I have a feeling it could easily make a wave on the shores vibe really easily

  • @lokij6058
    @lokij6058 3 роки тому +1

    Great video mate

  • @xinlingluo2017
    @xinlingluo2017 2 роки тому

    Your tutorials are great, I'm bad at math but can understand what you're saying🤯

  • @chopov11
    @chopov11 10 місяців тому

    Lovely video ol chap😄

  • @snookofficial7211
    @snookofficial7211 Рік тому +1

    Just to add to this topic, as I've been playing around with sine and cosine.. I needed a digital pulse, i.e. on and off. In this case, the Sine wave, once normalised is more suitable. To get the pulse you need to send it into the y input of a step node with the x value set to 0.5, this means when the signal goes above 0.5 it puts out a 1, below 0.5 it puts out a 0. Because the sine wave once normalised starts at 0.5, the pulse will start exactly at the right position of the wavelength. I had to visualise this myself in photoshop to get my head around it as cosine was giving me weird results, now I know why. By using the cosine with the step node it would put out a 1 for 1 quatre of it's wavelength, then drop to 0 for the next two quarters, then return to 1.

    • @PrismaticaDev
      @PrismaticaDev  Рік тому +1

      You could also use Ceil right after the sine without remapping to get a 50/50 on and off. Step is great for getting any other ratio, though, and is a lot more descriptive

    • @snookofficial7211
      @snookofficial7211 Рік тому

      @@PrismaticaDev thanks I'll keep that in mind next time I need the effect

  • @akiAlex
    @akiAlex Рік тому

    Thank you!

  • @YourSandbox
    @YourSandbox 3 роки тому +6

    Mathew will be jealous. Great stuff, sir !

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +2

      To-may-toes To-mah-toes haha. I love Mat's videos so much!

  • @SirDobbers
    @SirDobbers 3 роки тому +1

    You are the Sebastian Lague of Unreal

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому

      Haha still a long way to go to compare to titans like that, but I appreciate it nonetheless! Don't forget to share with a friend :)

  • @kalex07
    @kalex07 2 роки тому

    I would imagine this would be a good way of creating a lava texture or fire.

  • @Muhammad_Abdullah_Sultan
    @Muhammad_Abdullah_Sultan 3 роки тому

    Bro can you guide about making sine wave through materials? Of which wave length and frequency we can change on run time.

  • @Elmarath
    @Elmarath 3 роки тому +2

    how adding texture to the time node works man :D that's kind a abstract...

    • @Elmarath
      @Elmarath 3 роки тому

      are "1" values in future :o

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому

      @@Elmarath Hahaha it's very weird to wrap your head around, but can be extremely useful!

  • @TyLovePie
    @TyLovePie 2 роки тому

    Looks like a lava material

  • @johninglis2622
    @johninglis2622 3 роки тому +2

    Could you use this for larva?

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому

      Sure could! The only limit is your imagination

  • @mrmensje1
    @mrmensje1 3 роки тому +1

    Hi! I've got a question on sine wavess, Let's say you want to alter the curvature of a sine wave (0 to 1 ramps up fast, but 1 to 0 fades out slowly, keeping the timing of waves intact) is this possible? As a fix for now I've just created a gradient textur with that exact falloff between values but I'm hoping there is a math way instead :)
    Thanks so much for this awesome video :D

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +1

      A gradient texture is a really good solution, although you might be able to do it cheaper by overlapping 2 sine waves, with 1 of them offset. You would probably want to visualise it with an online graph viewer to get it perfect :)

  • @alucodev
    @alucodev 2 роки тому

    Is there any way of converting all of these math function nodes into a single 'Math Expression' node? In normal the Blueprint Editor I can select "Add Math Expression" but for some reason this isn't an option in the Materials Editor. No idea why.

  • @mexico4027
    @mexico4027 3 роки тому +1

    Make a tutorial about how to make water, a lake, a ocean, etc.

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому

      That will be something I'll definitely do when the UE4 water system becomes a bit more fleshed out! Cheers :)

    • @mexico4027
      @mexico4027 3 роки тому +1

      @@PrismaticaDev jajaja or cell shaded materials xd hello from mexico

  • @cr3ap3r1
    @cr3ap3r1 Рік тому

    I was wondering if there is a difference between dividing by 2 and adding .5 to remap from (-1/1) to (0/1) than just using the remap material node?

    • @cr3ap3r1
      @cr3ap3r1 Рік тому

      I'll answer my own question. Using the Remap node you need to know firsthand what the minimum and maximum input range will be whereas using the math will remap the value regardless of the input range. The math is more akin to the ConstantBiasScale node. In this case, since we know the minimum input will be -1 and the maximum will be 1 we can use the Remap node in place of the math. It is just a matter of preference.

  • @omba97
    @omba97 9 місяців тому

    Is there a way that sine goes from 0 to 1 and instead of goes from 1 to 0 start again in 0 ??

    • @PrismaticaDev
      @PrismaticaDev  9 місяців тому

      You can Add an offset before going in to the Sine node to make it start from a different point, and you can remap it after the Sine node to turn it from -1 -> 1 to 0 -> 1.

    • @PrismaticaDev
      @PrismaticaDev  9 місяців тому

      Although you might also be asking for the Frac node, which removes anything left of the decimal place

  • @kevinhh57
    @kevinhh57 8 місяців тому

    Cant make this in unreal 5 tho color wont change

    • @PrismaticaDev
      @PrismaticaDev  8 місяців тому

      Could you post a screenshot of your material graph? Something likely isn't plugged in. You might also have Live Preview turned off in your material editor - does it work once it's in the world?

  • @hotnaka9016
    @hotnaka9016 2 роки тому

    why do you not show the entire material nodes?

    • @PrismaticaDev
      @PrismaticaDev  2 роки тому +1

      I show all of the nodes necessary to learn about the Sine function - everything else isn't relevant to the video

    • @hotnaka9016
      @hotnaka9016 Рік тому

      @@PrismaticaDev Thanks for the reply! Is there a way to make the sine node period expression into a parameter?

  • @GabdaRocur
    @GabdaRocur 6 місяців тому

    I'm pretty sure I'm blind after this video

  • @ThePCxbox
    @ThePCxbox 3 роки тому +2

    Can you cover the DitherTemporalAA node? I saw a video where a guy made an oldschool dithering effect (think gameboy) with it. Thats one thing you can do with it but UE4 says theres all sorts of things that you can accomplish with that node.

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +1

      Definitely! It’s one of my most used nodes since I use a cel shader and translucent materials don’t work very well, so dithering is my go-to for opacity masking :) I’ll definitely look in to other applications like colour as well

  • @Trueomega93
    @Trueomega93 2 роки тому +2

    This tutorial is absolutely fantastic Charlie. You've explained the Sine/Cosine perfectly. As someone who struggles with visualising the math sometimes, this has helped greatly. Thank you!

  • @jerrythomas6649
    @jerrythomas6649 5 місяців тому

    Thank you so much!

  • @LionUnchained
    @LionUnchained 11 місяців тому

    I didn't ever learn complex math but have been learning game dev, and once they started putting math inside colors just made things 10x worse. I appreciate your explanations XD

  • @AvatarNate
    @AvatarNate 10 місяців тому +1

    Great video sir!

  • @tiger5gaming
    @tiger5gaming 2 роки тому

    4:00 lmao

  • @KINGDOMSONSTV
    @KINGDOMSONSTV 3 роки тому +1

    Disco lights now tripping balls ;) wooohoooo. Great vid

    • @PrismaticaDev
      @PrismaticaDev  3 роки тому +2

      Hahaha glad you enjoyed :P I have a bad habit of creating materials that hurt eyeballs.

  • @apaskiewicz
    @apaskiewicz 2 роки тому

    Press 3 and click to make a color input. Unreal Engine is very useless at teaching these things, took me half an hour to figure this out.

  • @Jiyu
    @Jiyu 2 роки тому

    I made a material for a bouncy tutorial arrow with time, sine and world position offset. Ty for your amazing work!

  • @leehammoud
    @leehammoud 2 роки тому

    Please keep bringing these tuts in! There's so much of the Materials nodes yet to be explored :)