![]() ![]() However, if I use the color found at the current UV of a solid white object (Meaning the color is exactly the same, (1,1,1)), the results become inconsistent. ![]() For example, if I hard code a color of (1,1,1) and a seed of any value into the input of the Random Color node, results are stable. Even if I'm using the exact same values the variables are. If I replace the input values (Seed and Color) with static values (Rather than variables) the problem goes away. It seems as if the GPU isn't consistent with the values for each frame for some reason.Īnyone have any ideas as to what might be happening here? Or how I might be able to create this effect with a better approach? Any help is appreciated! I'm using Unity 2020.3.35, and Shadergraph 10.9.0. None of these values change after the effect is activated, so I don't understand why certain colors flash as if certain values are changing. I know it's a bit of a mess, but essentially what's happening here is it gets an input color and then combines each RGB value with the seed to get a new random value for each RGB out using the Random Range node. The background color (White) is flashing here as well which is way too intense to allow in my game. Still flashing, and the flashing is occurring on different colors than last time. If I activate the effect and randomize the seed, once it looked like this:Ĭolors randomize as expected, but for some reason some of them flash. This can be a big problem, as sometimes large areas of a specific color can rapidly flash with bright contrasting colors, and I don't want to do that. When changing the seed, the colors that flash aren't consistent, and neither are the colors they flash to. For some reason, when the effect is active, certain colors will flash between two different colors, rather than staying constant. Currently, it works exactly as expected, with one exception. It uses a float and the RGB values of each pixel as a seed for a few different Random Range nodes so that matching colors get turned into the same new color. This is to mimic the look of the color palette getting glitched like can happen in old videogames. Now each Unreal Guy has a predictable colour.For the game I'm working on I've created a shader that can randomize the colors of texture. Add as many colours as you like to the array using the Add Pin option. The item in the array is chosen with a Random Integer node. Here I’ve created an array using Make Array from the first colour, then I used a Get (copy) node and plugged it into the dynamic material instance (not shown). We could probably mess with the values and make sure only a certain range is called, but if we wanted a choice of exact colours instead, we could set those up in advance and add them to an array like so: The downside is that we’re not completely in charge of a colour choice. The easiest option is to let three random float nodes make up the colour like this, creating an effect as seen in the screenshot above: There are various ways to create a random colour and use that on Unreal Guy. Feel free to promote the vector to a variable and override it. Note how I grabbed Element Index 0 in the first node, which was Unreal Guy’s first material zone. The second node then sets a Vector (purple in my case) on the material parameter called Bod圜olour. With that reference I’m creating a new Dynamic Material Instance, which will be a the same material instance that’s assigned to him, but with the difference of being adjustable (dynamic rather than static). Here I’m grabbing a reference to his mesh from the viewportl. The construction script of your character sounds like a good place for this, but the principle will also work in Event Begin Play. If you want to make him look a little different without creating a brand new material, we can override the default value for his Body material like this: He’s made up of two material zones, a rather complex one for his body and another one for his UE4 Logo. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |