Unity - Custom Vertex Stream and Shadergraph/Amplify Shader

Hey, thanks for the answer !

I’ve been trying to mess around with CVS but I can’t manage to have any result outside of your exemple. I can’t seem to link the base (Uv/Split/Combine) with any texture or noise I could make.

To be precise: CVS only works when I remove the UV (TEXCOOR0.xy).Thus making it impossible to blend with anything else I could want to work with.

Is there something I missed ? I’m kinda clueless when it’s about CVS but it feels like this is something very important to have a grasp on.

Yep i think it’s a great add to shuriken. Now, you don’t have to c# script to get some values in your shader !
Can you show your shader (with uv channel for each uv) and your vertex stream please ? It’s a bit hard to say like that :thinking:

1 Like

Ok, so here is what I have:

Pretty basic, i just want to influence the alpha.

Now I want to join a noise with it, a multiply should be enough:

Here is the result:

BOwDvsa5tm

And here is the setting for the particle system

image

It completely ignores any values put on the custom data. But if I remove UV (TXCOORD0.xy)

nLpGMfOYRQ

Well, it works ! Buuuut now it loses its ability to read the texture.

If it isn’t clear enough please tell me ! And thank you for dedicating time for newbies like me <3

2 Likes

Haha no problem, we all scratched our head many times !
So, in your setup, your sending UV in TEXCOORD0.xy so your uv for noise will be uv channel 0.xy in shadergraph. Your custom data is send threw TEXCOORD0.zw|xy which means TEXCOORD0.zw and in TEXCOORD1.xy. So it will be uv channel 0.zw and uv channel 1.xy in shadergraph for your.
For your first pictures you can plug directly the split.r in your alpha output. Alpha is a float so it takes only thé first value of your vector.
I hope it helps, let me know !

Daaaayum, it worked !

I think I kindaaaaaa get how it function, although it will take time before I get to understand the full extents of it. if I ever need to deep diver, you might hear me again on this topic. Thank you very much ! :stuck_out_tongue:

1 Like

don’t know if this is necessary anymore but does this help?
split Blue out of vec4 passed as X (red) that is the custom1.x

also you could assign Alpha as Y (green) and use (custom1.xy) for your two particle graphs

Hi,

I have the same problem than [Asminae]

I’m only trying to make a dissolve from the texture i have in the graph. But animated in the Custom Data.
Like the Dynamic Parametre in Unreal.



Can someone help me because i’m new to Unity Hdrp and Custom data.

Thank you in advance.

0

Click this button and add Custom1.xyzw and Custom2.xyzw.

This way, you’ll be able to transfer data from the “Custom Data” node on your particle system to the shader!

1 Like

Hey Lush,

Much appreciated for your quick respond but I’ve put the Custom1.xyzw and Custom2.xyzw. and it’s not working.

image

As you can see there, TEX0.xy are being used to define the UVs, and TEX0.zw are the first two available channels for you to use!

Try using the other component slots. Copy and paste those curves from the X and Y components to the Z and W components on the Custom Data node.

By the way, I’d suggest you to create a shader with a color lerp from 0 to 1 controlled by one channel of the Vertex TexCoord node, and then switch through them until you find the right one if that doesn’t do the trick. Easy debuging tip!

2 Likes

Hi there!
I’m playing with vertex streams too, because i would like something very specific :

I’m in HDRP with Shader Graph.
I would like to create /use/ the HDR Color Gradient the same way the “color over time” works.
Can i pass the data of custom color HDR gradient to the shader?

Ok, i finally found the right settings!


image

Here is the first use of this ^^ nothing fancy, but i’m happy lol

Smoke_HDR_Gradient

Hi good day, I am struggling with adding my cvs to the shaders I already made. everytime I connect the “uv-split-combine” node my shaders break. thanks in advance for the help.

Hi, hard to help you without some screens of your shader nodes and the particle system cvs :slight_smile:
Which unity/shadergraph version are you using, etc.
The only thing i can speculate right now is that you did not connect the right channels.

for this graph for example, where will I put the cvs nodes for me to animate the opacity in the stream? I am kinda new to the shader graph and I havent fully grasped it yet. All I was doing was trial and error method.

Usually when I animate the opacity or the color overlifetime thing, I use black in the gradient for things to fade in and out.

i don’t really graps what you are trying to do? what is the cvs you want to get in the shader? lifetime?
can you screen the particle system with custom data too? :wink:

wont work exactly as you are expect

  • your passing alpha but it does nothing in the additive blend mode; forget connecting alpha, just use black color to control the fade as you normally do
  • your two textures are multiplied but I suggest you invert the ramp [oneMinus]
  • [subtract] a {value}* from this inverted ramp
  • [clamp] between 0-1 after the subtraction
  • now subtract this form the scrolling trail and clamp that output between 0-1 as well

animate opacity - you mean the custom vertex stream but you haven’t created a UV node to utilize the 3rd vector to pass into the particle system for it to communicate to the shader

  • attach a [split] out of the UV node so that you can access color blue

blue out = will be ‘Z’ in the UV node; i.e. Z & W are available for the cvs and this is the variable that the particle system will stream

  • use the blue as that {value} I mentioned above

now when you expose Custom1.x and make a single custom_data_graph it will drive the strength of {value}, so a positive number will subtract the ramp into 0 and thus create no fade
while lowering the number negative will add to the ramp and cause it to subtract your scrolling trail