Can I control a blending mode in material inspector? [Shadergraph]

화면 캡처 2023-07-23 215504

In AmplifyShader I can control a Blending mode in material inspector with enum property, Can I do the samething in Shadergraph??

I did lots of experiement for hours but I failed ; ( Please Help me

+1 i want to know how to do this too, i have tried as well

1 Like

Oh I found how to do this, Super simple. There is shader graph template for vfx. If made by this template It can control cull mode, zwrite, blending mode etc … in outside of shader.

1 Like

Can you tell me where you found the template for vfx?

1 Like

Kinda late, but I believe this is what you are searching for?
yOpHvMO5DZ
hu5usuNkY2

setting ENUM (enumeration)
we mean giving a material direct blending operations
[Source]
[Destination]

operations

render target Integer, range 0 through 7 The render target index.
state Off Disables blending.
factor One The value of this input is one. Use this to use the value of the source or the destination color.
Zero The value of this input is zero. Use this to remove either the source or the destination values.
SrcColor The GPU multiplies the value of this input by the source color value.
SrcAlpha The GPU multiplies the value of this input by the source alpha value.
SrcAlphaSaturate The GPU multiplies the value of this input by the minimum value of source alpha and (1 - destination alpha)
DstColor The GPU multiplies the value of this input by the frame buffer source color value.
DstAlpha The GPU multiplies the value of this input by the frame buffer source alpha value.
OneMinusSrcColor The GPU multiplies the value of this input by (1 - source color).
OneMinusSrcAlpha The GPU multiplies the value of this input by (1 - source alpha).
OneMinusDstColor The GPU multiplies the value of this input by (1 - destination color).
OneMinusDstAlpha The GPU multiplies the value of this input by (1 - destination alpha).

i never got that working using nodes
https://docs.unity3d.com/Packages/com.unity.shadergraph@12.0/manual/Keywords.html
there is something about setting the ->ENUM within shadergraph to access the actual blending operations

(better example for what it looks like on a material)
image

  • SrcBlend (‘Source’)
  • DstBlend (‘Destination’)

^ Direct blending operations

aha got it, though I’m not sure how to do so with the shader graph
but if we went to debug mode we can see the shader properties on each material


image
it’s type is float, so if I made a float property in the shader graph and changed the reference to alpha clip for example, it can activate/deactivate the alpha clipping by changing this float value
Unity_RW4QzNJlnm
however this works for most of the properties except the _SrcBlend and _DstBlend but I’m not sure why, do you have any idea?

and it seems like enum properties doesn’t have the override property declaration
image

you are stuck where I am as well; i tried to find _reference nomenclature, something about
Entries vs Reference —I couldn’t figure that out and gave up

I gave it up as well, at least for now
but may I ask why you need it?

I had wanted to give a shaderGraph material odd blending opportunity

dont recall exactly some matcap, fresnel +custom vertex streaming with dissolve remap and and the ability to combine in something that felt ‘shadowy’

maybe it was something like RGB * 2.0f (DstColor) (OneMinusSrcAlpha)

hmm
do you have any example of what you imagine?

it was so long ago. im sorry w/e project I had is long gone/purged

ah that’s a bummer
I actually found a way to do that recently when using custom GUI for the shader you can expose all those hidden properties like this

here is the script


but that will expose every thing, you can later customize it and make the srcblend and srcalpha work by enums for example, but that will take some effort I guess

sorry for late reply too*