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.
Discussion in 'Graphics Experimental Previews' started by Kink3d, Jan 10, 2018.
How can we use ShaderGraph with a custom SRP?
You will write the connections for it.
Small bug (apologies if it’s been brought up before, this thread is huge): in the Shader Graph editor, when editing a vector parameter, you can Tab forward through the fields, but you can’t Shift-Tab backward through them.
Ive added 45 Bite-Size Procedural Graph Examples to the Shader Graph Example Library! None of these use Texture Assets and have various properties exposed to tweak and modify.
(Most of these are animated; but the forums don't allow us to upload videos directly. )
Link to a tweet that has a video of the Graphs in action! https://twitter.com/andytouch/status/974504975014404097
@Andy-Touch that is amazing! These will be super helpful for all kinds of effects, thank you!!!
is there a way to use the shadergraph tool to make custom ui shaders ?
Is it possible to reference the unity built-in shader utilities via shadergraph? (include cginc namespaces)
My specific use-case is based on Joyce "MinionsArt"'s lightmap-based render texture painting shaders (https://pastebin.com/LxDYqWBh & https://pastebin.com/rMx1PVXi).
These shaders include
in order to use the line (49)
o.uv1 = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;// lightmap uvs
My current thought would be creating CustomNodes that basically "trick" the ShaderGraph shader into using the aforementioned includes. However, that seems a rather convoluted solution for trying to use built-in unity utilities. °O
o.uv1 = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;// lightmap uvs
Why the shader graph is not working with the HD Rendering Pipeline yet?
Probably because the HD RP is still in a preview state and very complex.
Did anyone have any luck changing graph shader variables via script so far?
The usual Material.SetFloat(...) approach doesn't seem to be working for me. Additionally, checking for any property name with Material.HasProperty(...) returns true regardless of what is looked for and whether or not the shader actually HAS that property.
I am not sure if it is still the case, but the first problem I noticed with the shader graph was that property names for textures etc. are not that easily determined. They show up in the inspector the way you name them, but in reality they have their own obscure names underneath, making modifications from scripts a bit harder, as well as the fact that textures are not preserved when you switch from the standard shader, for example, to your fresh shader graph.
I think because of the new HD RP has been used HLSL language for shader programming but all other visual shader editors has been used CG Program or surface shader
Yepp. Just tried it using the "obscure" designation. ('Vector1_A8323E03' instead of 'loadAmount')
This way it works, but of course, this extra abstraction step is a nuisance at best and a hindrance at worst. (Though I'm almost certain this will be changed once ShaderGraph is out of beta)
Really enjoying messing around with the shader graph, well done on a slick addition to the toolset.
Are there any plans to extend the editor to allow for authoring v.2 Post Processing stack custom effects?
Is there a way to combine the 'Flipbook' and 'Tiling and Offset' nodes to create a spritesheet animation moving along the UVs?
Nevermind. Found it. I had to find the correct sequence of UV nodes to basically get the flipbooked texture scrolling along.
While I'm at it I might as well ask if there are any plans to provide more nodes with more output options.
F.e. the Vector nodes would profit from both combined and "pre-split" outputs. Using the "Split" node to separate a vector's dimensions seems counter-intuitive. Especially since there is a "mental cast" from X and Y to R and G.
Any clues as to why my final master node is not rendering? (using unity 2018.1.0b11, HDR pipeline 1.1.1 and shader graph 1.1.1).
I get the same problem.
i don't think shader graph are compatible with HDRP yet
I'm having an issue. Shadows are not being casted over objects that are using shaders created by the Shader Graph, anyone else experiencing this issue?
Could you implement volumetric simulations, for example if shader graph would be plugged in volume rendering in some contained box, it would render smoke, fluids, etc
I noticed this if you have a texture property in the shader, that isn’t filled in the material itself.
I created a new shader graph, created a new texture property, linked it to the texture sampler node, then linked the sampler note RGB to the albedo of the master node, I saved it and then assigned the sahder to a new material, changed the texture of the material but the shadows are still not being casted in the game object using this material.
Im using Lightweight pipeline with Unity 2018.0b12 with SRP 208f8b5 (las commit)
How can I get world space light direction in the shader graph for lightweigth render pipeline? I want to do a dot product of light direction and vertex normal. Amplify has specific "Vertex Normal" and "World Space Light Dir" nodes, but I can't find the node in the shader graph?
Is there a list of all usable nodes for this tool? I'm curious when i should consider migrating to official tools as I am using Shader Forge currently and am pushing it pretty hard to have custom blinn phone lighting for improved performance without lights.
Will it be easy to have built in single point lighting without shadows for a 2d game with these new tools? (view reflection node, view direction node, dot product, etc.)
Edit: Just noticed Pavelkouril has the exact same question I do! Good to see i'm not alone here. I'm sure you guys understand how having nice out of the box tools for performant out of the box directional lighting would be huge considering the massive mobile use of the Unity engine.
This should get you started on a list of usable nodes:
Currently, there isn't a built-in node for World Space Light Direction. You could set up a Vector 3 Property and set a specific light's direction via script to it.
There is a 'Normal Vector' node that can be used in the dot product.
Shader Graph doesn't support HDRP yet. In development!
Imported ShaderGraph to new 2018.1.0b12 from Package manager and when i try to make a shader its pink. Is it just me or everyone?
You probably don't have the Lightweight Render Pipeline installed. You can do that from the package manager as well and then setup the pipeline asset, as well as creating a new project and select the Lightweight Pipeline as a template. That will come with everything setup for you, including shader graph and Post Processing V2.
Really thanks GrimReaper.
Seriously, the workflow for writing Custom Node for Shader Graph is a pain in the ass
Agreed. Clunky and counterproductive.
Do you really think that people will be writing complex nodes in a C# string? It will be like "I need to write HLSL code in a separate file with autocompletion and highlighting, then copy-paste it into my C#-string".
Whoah, can't believe you come up with something like that. It's like rotten cherry on top of a good cake.
To quote part of a reply from Matt Dean in the comments to that blog post:
This, seeing a lot of narrow mindedness in the comments to that blog post. People seem to read it as "you can only do this via strings now". Its not. Chill everyone.
Put your arrogance where you got it. The File.Read isn't better in any way. Now they have 2 options: one, when you don't need to create new HLSL file, but which is bad by design, and second, which requires you to have 2 separate files for a one custom node.
All 2 ways are bad and counterproductive. Instead of robust and flexible system we have some sort of hack. People in comments mentioned Xenko's approach to the problem.
Anyway, even if we have an alternative, the first system was made without anything good in mind.
Excuse me but did you actually read what I said? Did I say anywhere that "File.Read is better"? Did i even mention File.Read?
Please take your irritation elsewhere, and refrain from calling members "arrogant" when they are simply mentioning that once again members are moaning before even getting proper hands on with the finished system.
In fact, please dont lash out at other members of the community especially when something wasnt even directed at you. Its not fair, not cool, and definately not professional.
Let’s keep things civil. This thread is providing feedback on the feature, not arguing.
How do I navigate the graph on my MacBook? There's obviously no middle button.
I'm using a normal mouse on a mac so I cant completely replicate your circumstances, but holding the option key whilst left-click dragging works for me.
Is it possible to add custom GUI element to the shader graph? I am mostly interested in adding the "Apply to systems" button that's on the new standard surface particle shader.
The current workflow for making custom node required a lot of boilerplate code.
A better approach IMO is writing the shader code in an HLSL file, with metadata in the comments at the top of that file.
It is hacky and prone to error until IDEs catchup, but is easy to implement for Unity, easy for users to manage and share(only 1 file instead of 2), and allow developers to make full use of their IDE features.
Hold alt and click somewhere in the main node-board to pan around.
Few Bugs to report
Sub Graph Bug?
Not sure if this is intentional or a bug but upgrading from lightweight 1.1.1 to 1.1.2 Sub Graphs created in older versions won't open but ones created in 1.1.2 will. Is that intentional because of API changes or just a bug?
It seems that if you use another channel other than UV0 the UVs are scaled down (or textures scaled up? something is scaling.)
Triplanar and the standard UV channel uses the same tiling value
Here you can see when I switched to Triplanar the UVs are fine (Bottom Image)
Users use this thread to talk to Unity staff about shader graph. Don't use it to talk to each other unless it's specific to shader graph. Don't reply to this message.
I there any plans to make nodes with access to scene lighting data, like Luminance?
Is there a way to define array variables in shader graph ? Like this:
Any way to change the UV channel from a blackboard?
Just change the UV in the Sample Texture Node.
just tried shader graph for the first time and wrote a hexagonal grid node (based on world position). Really intuitive to work with.
However there some things I'd like to be able to do which would make previewing easier:
Change camera position and distance/size of the preview meshes in the preview windows, this is useful when working with shaders using world position. It's just a really minor thing and not sure if worth the added complexity.
I also noticed that a property I defined as vector 2 had xyzw components exposed in the inspector, not sure if my mistake or bug