Vrchat How to Add a Rainbow Cycling Glow

Search Unity

Unity ID

A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate in the Unity community.

  1. I want to mimic the effect shown through a shader. I have been playing around with this but I don't understand shaders enough to fully replicate the effect. Could someone walk me through this? Thanks. Rainbow_Hatchback.gif
  2. Well, the shader you linked is kind of over complicated for the effect you want, but it'll get the job done if you want to start with it. However I suggest you read up on shaders s but before you try to dive into this.

    https://unity3d.com/learn/tutorials/topics/graphics/gentle-introduction-shaders

  3. Alright that helped me understand how the I/O of shaders works for the component, but I still don't really understand how animated shaders like these work. Is there a way I can have the shader take a picture and repeatedly move it as above? I feel like if that were possible it'd be a good place to start.
  4. Did you go through all 5 parts of that tutorial, or just the first page?

    Here's the same tutorial, with easier to see links to the other 4 pages that Unity didn't host.
    http://www.alanzucconi.com/2015/06/10/a-gentle-introduction-to-shaders-in-unity3d/

    vain430 and olie304 like this.
  5. Thank you! I now see what everything means. I am posting the modified version in case there is anyone else trying to accomplish this :p

    Attached Files:

  6. Anyone able to help change the shader to just use three colors of your choosing?
  7. @corbinyo did you try Google?
    https://answers.unity.com/questions/1108472/3-color-linear-gradient-shader.html

    This is pretty close to what is needed and there are plenty of similar examples out there. You could perhaps extract the useful parts to your own shader?

  8. @Olmi My Main issue is that i am really new to shaders and cant translate the movement part to this shader, I did see it and i did try to combine them! Do you have any ideas as to how I could use this shader (3 color) and make it move like the rainbow shader?
  9. Hi everyone. I am resurrecting this thread rather than creating a new one as it's the only one that got me going down the correct path.

    I am using @olie304 's shader that they attached here but am experiencing a couple of issues.

    First off, it seems to 'fill in the holes' on a transparent png sprite. Say for example, a donut would look like a solid circle instead of having a hole in the middle. Any ideas how I can fix that?

    Also, I would like to have a gradient color picker for the shader using Unity's gradient editor. Is this possible somehow?

    Sorry if these are silly questions but I am certainly not a shader expert and would be very grateful for some guidance. Thanks!

  10. I would really like to know how to move this as well. It appears to be a different method than shifting the hue value. Anyone know?
  11. The 3 color shader is lerping from the start to the mid color then the mid color to the end color over a 0.0 to 1.0 range, in this case sampled from the texcoords. If you want it to move, add
                            _Time.y                      
    . However the current code means input values over >1.0 just end up being the end color. You could use
                            frac()                      
    to loop between 0.0 and 1.0, but that means it'll just be snapping between the end color and the start color. So you'd need to modify the code to lerp between the first and mid color from 0.0 to 0.33, mid color to end color between 0.33 and 0.67, and end color to start color over 0.67 to 1.0.
    1. fixed4 ThreeColorGradientLoop(fixed4 start, fixed4 mid, fixed4 end, float t)
    2.     t = frac(t) * 3.0 ; // loop between 0.0 and 1.0 and rescale to a 0.0 to 3.0 range
    3.     color = lerp(color, mid, saturate(t) ) ; // t 0.0 to 0.33
    4.     color = lerp(color, end, saturate(t + 1 ) ) ; // t 0.33 to 0.67
    5.     color = lerp(color, start, saturate(t + 2 ) ) ; // t 0.67 to 1.0
    Well, the shader doesn't use a texture at all, so it doesn't matter what texture the sprite is using because the shader totally ignores it. I'll repeat my original suggestion to the op and say "try reading some tutorials". That should give you an idea of how to add a texture to a shader, sample it, and use its color and/or alpha value.There's kind of two ways to go about gradients in a shader.

    The easiest method is to make 1 pixel tall textures that are some arbitrary width that you paint using some external application and just use that. There are some Unity assets that put gradients in the material inspector that behind the scenes are generating those textures in c# for the user.

    The other way is something like the 3 color example linked to above. Pass in some number of colors and lerp between them. Unity's Shader Graph has a Gradient node that passes an array of colors and alphas with a "time" value per index. It then calculates the fractional value between each key and the previous key and lerps between them. This also requires custom c# to fill in that array from the C# gradient, but is a little less work than generating texture assets. It does make for a much more complicated shader, but it's fundamentally not too different than the example code I posted above.

  12. Thank you very much @bgolus ! What a fantastic and insightful response. I will dig further into this based on your advice and report back soon.
  13. Can you upload complete shader because I am not sure where should I put and call that function you mentioned?
  14. Hi! I want to use that same shader on 2d sprites. I try to configure, But it doesn't work.
    How that make possible?

Vrchat How to Add a Rainbow Cycling Glow

Source: https://forum.unity.com/threads/solved-gradient-rainbow-shader.449080/

0 Response to "Vrchat How to Add a Rainbow Cycling Glow"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel