Search Unity

Feedback Wanted: Shader Graph

Discussion in 'Graphics Experimental Previews' started by Kink3d, Jan 10, 2018.

Thread Status:
Not open for further replies.
  1. Chadobado

    Chadobado

    Joined:
    Oct 19, 2016
    Posts:
    6
    Thank you both. Really appreciate your help. Spent the days since your posts trying to get this to work and am close. Am pretty much brute-forcing it at this point so if you have any additional thoughts, would really appreciate it.

    I was able to successfully unwrap the UV to world space but can't figure out how to position the verts so they are correctly facing the camera/centered in the viewport -- especially when my object is rotated/translated. I've tried multiplying it by different transformation matrices to achieve a billboard and then center the resulting verts by adding each vert's position to the delta vector between the object's position and my desired position (arbitrarily placed in the center of the camera's viewport).

    Instead of unwrapping to world space, is there a correct approach to unwrap to screen/clip space -- or even to just convert from clip space to world space and back again?

    Thanks in advance!

    --

    As an aside: would love some type of debug node to see the actual values being piped through the graph.
     
  2. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    Yes, I too would find this really nice. I even had a similar suggestion a page or two back in this very thread (here). It's true that it isn't a deal breaker, but it would be a really nice thing to have IMO. I would think it would even benefit all the various upcoming graph-based tools as well seeing as they all use the same graph functionality at their core.
     
  3. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    Hello!

    I'm porting over code to the shader graph and it would be a massive improvement if there would be support for Arrays, as my current soloution is rather unflexible. ;) upload_2018-11-7_17-17-40.png
     
  4. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    238
    The best way to do this is to encode your values into texture. And write the custom editor that would generate this texture and assign it to shader/material.
     
  5. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,216
    Would also be nice to have a node to handle this too though
     
  6. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    I've done that and it's definetly 0.1ms slower than the array approach.

    I now ended up hacking an external hlsl file into the shadergraph where I can code with all the benefits. I did this by having two custom shader nodes. It looks like this:


    Injector:
    Code (CSharp):
    1.     static string AwesomeCodeInjectorFunction(
    2.         [Slot(0, Binding.None)] out DynamicDimensionVector Out)
    3.     {
    4.         return @"
    5.        {
    6.            Out = 0;
    7.        }" + "\n #include \"Assets/MyAwesomeCustomCode.cginc\"";
    8.     }
    Actuall Node:
    Code (CSharp):
    1.     static string ActuallCode(
    2.         [Slot(0, Binding.None)] out Color Out,
    3.         [Slot(1, Binding.None)] DynamicDimensionVector injectorDummy)
    4.     {
    5.  
    6.         Out = Color.black;
    7.         return @"
    8.        {
    9.            Out = AwesomeFunctionFromMyAwesomkeCustomCode() + injectorDummy;
    10.            }
    11.        }";
    12.     }
    So if you now place the injector node first into your graph and then conect it to acutall node, the generated shader file will look like this.

    Code (CSharp):
    1.  
    2. ...
    3. void AwesomeCodeInjectorFunction_float(out float Out)
    4. {
    5.             Out = 0;
    6.  }
    7. #include "Assets/MyAwesomeCustomCode.cginc"
    8.  
    9. void FullGlowburstFunction_float(float injectorDummy)
    10. {
    11.            Out = AwesomeFunctionFromMyAwesomkeCustomCode() + injectorDummy;
    12. }
    13. ...
    As a bounus you can easily shader code between node-based and hand-written shaders.

    Ofc this is hacky, but It works for me until unity comes up with a offical possiblity to use custom includes. :)
     
    sewy and wyatttt like this.
  7. slim_trunks

    slim_trunks

    Joined:
    Dec 31, 2017
    Posts:
    41
    Thank you very much for the input!
    I've also come to the conclusion that blitting is the best option right now.
    Mind you, accessing the Texture data would be Editor only in my case, so I still think it would be feasible to have such a node.

    I didn't know about CustomRenderTexture and it looks really promising but from what I've read I'm afraid I'd have to massively change every generated shader that I want to use it with. In addition to the setup, that's the kind of friction I really don't want.

    My current approach is not finished yet but it goes roughly like this:
    I have a Subgraph in which most of the shader code resides and an output which branches on the different Textures I want to export.
    That way I can connect it to two graphs: One of them with a PBR Master node as a preview under actual conditions and another one which basically just connects to an Unlit Master node and inputs an id which decides the Texture that the Subgraph outputs.
    The latter shader could then be used to automatically blit the different shader generated textures and read them.

    If anyone comes up with a cleaner solution I would be happy to hear it, but right now I'm pretty satisfied with this approach.
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,382
    i might be missed this part of the discussion. is there any node grouping and commenting in shadergraph?
     
    Elecman likes this.
  9. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,216
    I dont think currently, but having this and a collapse function would be fantastic!
     
  10. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,382
    didn't they have that already in VFX graph?
     
  11. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,216
    I must be honest, I havent tried out the VFX and shader graph in a bit now, but last I checked they did not
     
  12. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    2 quick questions:

    - Is Simple Lit master node going to be available in future?

    - Is custom master node template planned?

    (I know we can re-create Simple Lit lighting by using Unlit master node and add our custom lighting, just wondering if we need to.)
     
    Jick87 and GameDevCouple_I like this.
  13. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,216
    I also would like to know this, especially #2!

    A custom master node template would be fantastic!
     
  14. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    578
  15. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,382
    oh that's great
     
  16. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    33
    I have a quick question.

    Maybe I am missing something, but I cannot find a way on LWRP to add GPU instancing proprieties in Shader Graph.
    Am I missing something ?
     
  17. ShortQuestion

    ShortQuestion

    Joined:
    Nov 22, 2016
    Posts:
    2
    Hi, Shader graph looks great! But i was wondering if there is a possibility to make geometry based shaders through the unity shader graph? Like cell shading, wireframes etc?
     
  18. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    GameDevCouple_I likes this.
  19. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,216
  20. liven999

    liven999

    Joined:
    Oct 7, 2015
    Posts:
    18
    Hello, I have some fun with shader graph but I face a problem :
    For the project running on .NET 3.5 all works fine, but on .NET 4.x I noticed a bug.

    When I try to give a decimal value to a vector in the left windows (to see variable in inspector) the shader turn pink with this messages :
    Assertion failed on expression: 'success'
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    and

    Compilation error in graph at line 6 (on ):
    Parse error: syntax error, unexpected ',', expecting TVAL_ID or TVAL_VARREF
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    Note that there is no problem with decimal if I use vector1 node and modify value in the graph (but I can't acces to the variable in inspector) :



    But if I try a decimal in left windows (even if it is not link to anything) :



    Note that I need to modify something (whatever) to see the pink coming (it is not instant pink)

    Side notes :
    In .NET 3.5 the decimals use a dot and in .NET 4.x they use a coma (don't know if it is important)
    My CPU (i7 920) have no AVX fonction (I mention that because it causes me problems with ml-agent)

    Edit : don't pay attention to the alpha not working, I just forgot to activate transparency for de screens
     
  21. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    218
    I confirm - the same issue
     
  22. liven999

    liven999

    Joined:
    Oct 7, 2015
    Posts:
    18
    while waiting for a real solution, I do like this:
    (It's not an ideal solution, but it do the job)

     
  23. pbrito_unity

    pbrito_unity

    Joined:
    Mar 30, 2018
    Posts:
    18

    I changed Windows system Language to en-us (instead of my my native language ),
    now I don't have error in the shader using .Net 4.x.

    Looks like a serialization problem when you add properties to a shader.

    https://stackoverflow.com/questions...ark-as-opposed-to-net-3-5-how-to-fix-it-unity
     
    Last edited: Nov 13, 2018
  24. liven999

    liven999

    Joined:
    Oct 7, 2015
    Posts:
    18
  25. pbrito_unity

    pbrito_unity

    Joined:
    Mar 30, 2018
    Posts:
    18
    I'm using Unity 2019.1.0a8
    the Shader Editor and Project Settings
    Annotation.png Annotation0.png Annotation2.png
    Annotation3.png
     
  26. liven999

    liven999

    Joined:
    Oct 7, 2015
    Posts:
    18
    I tried with v2018.3.0b9 + shader graph/lwrp 4.1.0 => the decimal uses correctly the dot but always result on pink output

    With v2019.1.0a8 + shadergraph/lwrp 5.0.0 => the decimals transform dot onto comma (like with 2018.2 !) and always result on pink output
     
  27. kayb14

    kayb14

    Joined:
    Jun 12, 2016
    Posts:
    9
    My experience with the shadergraph is very bad so far. :'(
    But that might be my fault, since I am not that much into shading myself....
    The graph istself is absolutely amazing, everything is easy so even I can create awesome shaders, that exactely fit my needs.
    But whenever I set a property to anything but the default value, the shader fails and becomes pink.
    Next thing is vertex displacement is absolutely messed up when testing on mobile.
    Wich is so sad, because now I have to move my pants using jobs.
     
  28. ShortQuestion

    ShortQuestion

    Joined:
    Nov 22, 2016
    Posts:
    2
  29. wyatttt

    wyatttt

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    289
    This is in the latest version or should be soon. If it is in the latest package and you look at the generated shader code, there should be CBUFFER_START and CBUFFER_END wrapping your properties by default
     
  30. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    292
    @wyatttt
    i wonder if someone posted this before?? but we need as shader graph users to know which nodes are more expensive to use than other nodes.. especially for mobile devs..

    There are "many ways" to produce an effect using different types of nodes combination.. i can only guess or from some members comments here and there which nodes seems expensive.. or from personal experience..

    we need a top down list starts with most expensive to least expensive nodes in in terms of mathematical complexity of each node.. this way when we think between two nodes, i can refer to this page/list then i can decide which combination to use..

    right now i can't tell if contrast node is more expensive than simple step node..
     
    GameDevCouple_I likes this.
  31. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    218
    Hi,
    It's not working with HD Lit Master node.
    When I try to add smoothness exposed property - shader becomes pink.
    No success also with multiply hack :(
     
  32. TobiasB

    TobiasB

    Joined:
    Jul 4, 2013
    Posts:
    4
    As far as I can see there is no way to get Depth information in the ShaderGraph which to me seems like a very big limitation. Is this something we can expect to see soon?

    There is a lot of FX shaders like intersection and soft particles that are impossible to create without having the Scene Depth.

    If anyone has found a way to get to the _CameraDepthTexture from ShaderGraph please let me know. :)

    Kind regards, Tobias Biehl, Technical Artist @ Playdead
     
  33. skilfuldriver

    skilfuldriver

    Joined:
    May 20, 2015
    Posts:
    19
    Hi Tobias, If you're talking about HDRP then last time I tried it was pretty broken but I was able to get a get it to work somewhat. The depth information is there but the UVs are strange. See this post:

    https://forum.unity.com/threads/feedback-wanted-shader-graph.511960/page-30#post-3798496
     
    P_Jong likes this.
  34. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
    -My blackboard disappeared. I am not sure how I did it but this seems to be buggy. Anyway, how do I get it back?
    Edit: I fixed it by restarting Unity. Still a bug though.

    -Also, can we have Clip Space added to the Transform node, so I can do the equivalent of TransformWViewToHClip() instead of doing a matrix multiplication myself (for a billboard shader). It just looks a bit cleaner.
     
    Last edited: Nov 16, 2018
  35. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    240
    Not sure if it has been asked, but is there a way to export the result of the shader graph?
     
  36. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
    Right click on the output node -> Copy Shader. Then paste it into a text editor.
     
  37. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
    I am trying to convert this billboard shader into a shader graph version:
    Code (CSharp):
    1. Shader "Lights/Reference"{
    2.  
    3.     Properties{
    4.  
    5.         _MainTex ("Light Texture", 2D) = "white" {}
    6.         [HDR]_FrontColor ("Front Color", Color) = (0.5,0.5,0.5,0.5)
    7.     }
    8.  
    9.     HLSLINCLUDE
    10.     #pragma target 4.5
    11.     #pragma glsl_no_auto_normalization
    12.      
    13.     #define _SURFACE_TYPE_TRANSPARENT 1
    14.     #define _BLENDMODE_ADD 1
    15.     #define _ENABLE_FOG_ON_TRANSPARENT 1      
    16.     #define UNITY_MATERIAL_UNLIT // Need to be define before including Material.hlsl
    17.  
    18.     #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
    19.     #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
    20.     #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"    //for Fog
    21.     #include "lightFunctions.cginc"
    22.  
    23.     uniform sampler2D _MainTex;  
    24.     half4 _FrontColor;
    25.  
    26.     struct vertexInput {
    27.  
    28.         float4 center : POSITION; //Mesh center position is stored in the position channel (vertices in Unity).
    29.         float4 corner : TANGENT; //Mesh corner is stored in the tangent channel (tangent in Unity). The scale is stored in the w component.
    30.         float2 uvs : TEXCOORD0; //Texture coordinates (uv in Unity).  
    31.     };
    32.  
    33.     struct vertexOutput{
    34.  
    35.         float4 pos : SV_POSITION;
    36.         float2 uvs : TEXCOORD0;
    37.         half4 color : COLOR;
    38.     };      
    39.  
    40.     vertexOutput vert(vertexInput input){
    41.  
    42.         vertexOutput output;
    43.         float3 positionWS;
    44.  
    45.         //Place the vertex by moving it away from the center.
    46.         //Rotate the billboard towards the camera.
    47.         positionWS = TransformObjectToWorld(input.center.xyz);
    48.         output.pos.xyz = TransformWorldToView(positionWS) + input.corner.xyz;
    49.         output.pos = mul(UNITY_MATRIX_P, float4(output.pos.xyz, 1.0f));
    50.  
    51.         output.uvs = input.uvs;
    52.         output.color = _FrontColor;
    53.  
    54.         return output;
    55.     }
    56.  
    57.     half4 frag(vertexOutput input) : SV_Target{
    58.  
    59.         half4 col = input.color * tex2D(_MainTex, input.uvs);
    60.  
    61.         return col;
    62.     }
    63.  
    64.     ENDHLSL
    65.  
    66.     SubShader{
    67.  
    68.         Tags{ "RenderPipeline" = "HDRenderPipeline" "RenderType" = "Transparent"  "Queue" = "Transparent" "IgnoreProjector" = "True" }
    69.  
    70.         Pass
    71.         {
    72.             Name ""
    73.             Tags{ "LightMode" = "ForwardOnly" }
    74.             Blend SrcAlpha One
    75.             AlphaTest Greater .01
    76.             ColorMask RGB
    77.             Lighting Off
    78.             ZWrite Off
    79.             HLSLPROGRAM
    80.                 #pragma vertex vert
    81.                 #pragma fragment frag
    82.             ENDHLSL
    83.         }
    84.     }
    85. }
    86.  
    The billboards are separate triangles. I store the center position in POSITION and the triangle corners in TANGENT. The vertex shader code works fine. However, for some reason the Shader Graph version distorts the output.

    shadergraph.JPG

    The weird thing is that the code this graph produces is the same as my original:

    Code (CSharp):
    1. VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
    2. {
    3.     VertexDescription description = (VertexDescription)0;
    4.     float3 _Transform_9598AE93_Out = TransformWorldToView(TransformObjectToWorld(IN.ObjectSpacePosition.xyz));
    5.     float3 _Add_ABAE9F65_Out;
    6.     Unity_Add_float3(IN.ObjectSpaceTangent, _Transform_9598AE93_Out, _Add_ABAE9F65_Out);
    7.     float4 _Multiply_A4863254_Out;
    8.     Unity_Multiply_float(UNITY_MATRIX_P, (float4(_Add_ABAE9F65_Out, 1.0)), _Multiply_A4863254_Out);
    9.  
    10.     description.Position = (_Multiply_A4863254_Out.xyz);
    11.     return description;
    12. }
    13.  
    I am not sure if this is a bug or I am doing it wrong.

    Edit:
    I was doing it wrong. Shaders require the position to be fed in Projection space (Clip space), but Shader Graph expects Object space. This is something not necessarily obvious and should be well documented.

    Anyway, the billboard still has to be constructed in View space but after that, it has to be converted back into Object space, using the Inverse View matrix.

    Now it works correctly.

    graph 2.JPG
     
    Last edited: Nov 19, 2018
    larex39 likes this.
  38. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    240
    I mean, as in export it as a texture?
     
  39. slim_trunks

    slim_trunks

    Joined:
    Dec 31, 2017
    Posts:
    41
    I actually had the same question and kind of solved it.
    On the previous page you can see the question and a response to it. If you scroll up on this page, you can find my reply with the solution I went with.

    But it has some flaws as the UV and Object position nodes obviously don't work as expected when blitting.
     
  40. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    240
    Thank you for the info mate.

    I did, however, manage to make it work with the GPU and extract any result texture, and pretty fast without the Blitting part. If anyone is interested for it, I'll post my code and workflow here
     
  41. slim_trunks

    slim_trunks

    Joined:
    Dec 31, 2017
    Posts:
    41
    Awesome! Yes, it would be great if you could write up a thread about it.
     
    VisualTech48 likes this.
  42. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    240
    Ill write it tomorrow and will tag in there.

    Cheers
     
  43. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
    Positives:
    -The interface is intuitive to use (except for adding a float, more on that later).

    -The sub graph system is really handy.

    -Exposing properties is easy (although the blackboard visibility is buggy at the moment).

    Requests:

    -It is not possible to send custom data from the vertex to the fragment shader. This is a serious limitation and a showstopper for my project. In a regular shader I can abuse TEXCOORD1 to send custom data from vert to frag, but in Shader Graph, this is not possible. I use the custom data to do per vertex calculations in the fragment shader (instead of per fragment) thus, significantly improving performance. Please consider adding this feature.

    -Configurable amount of inputs for some nodes, for example the multiply and add node. This way you can quickly multiply for example 4 variables (A*B*C*D) using a single node. Doing this with the current two-input nodes requires an unnecessary amount of complexity.

    -Rename Vector1 to float, or at least make a node name search of "float" return something.

    -Ability to add some text to a node. Similar to a "Note" to the side of a note, but on the node itself instead.

    -Ability to resize number input fields. A float (sorry, Vector1) value of 10000 does not fit and it looks like 1000 instead.

    -For applicable nodes (like Vector3), ability to change node output/input names from RGBA to XYZW. For readability convenience.

    -When selecting a property on the blackboard, highlight the accompanying node and vice versa.

    -Display the default value of an exposed float property on the node.

    -Ability to make a variable global so it can be set from script, but not showing the variable on the inspector.

    -More consistent naming for mesh vertex data. Only Vertex Color makes sense but the others do not:
    Instead of Normal Vector: Vertex Normal.
    Instead of Tangent Vector: Vertex Tangent.
    Instead of Position: Vertex Position.
    etc.

    -The documentation of the Transformation Matrix is inconsistent with the Node drop down names. For example, the drop down does not have "WorldToObject", which according to the documentation does exist.

    -Ability to turn off shadow casting on the graph level.

    -Compatibility/consistency between usage of Fog node in LW and HD pipeline with both transparent and opaque objects.

    -Don't write custom node code as a string because at the very least, that doesn't receive syntax highlighting. The current method received a fair amount of flack already for various reasons on this forum and this blog: https://blogs.unity3d.com/2018/03/27/shader-graph-custom-node-api-using-the-code-function-node/

    -Custom nodes can only be used to do custom math. Anything slightly advanced like writing to a vertex output (like UV1) can't be done (unless I am missing something). Please make it more flexible so there are no limitations compared to writing a regular shader.

    -I noticed in the generated code from the graph that the UV1 vertex output is used to store normalWS data. Isn't this going to interfere if I make a node which uses UV1 for my own custom data?

    -Ability to write to custom UV channels in the vertex shader part, so it can be used in the fragment shader.

    -Some form of tagging or coloring to indicate which nodes run in the vertex shader and which in the fragment shader. Handy for performance awareness.

    -Ability to rename input and output fields on the nodes to something custom. For example instead of "Out", rename it to "speed".

    -It would be interesting to do a speed comparison as the shader graph version generates significantly more code than my own custom shader.

    -It is not clear how to use the fog node. The shader code version (MixFog() for LW and EvaluateAtmosphericScattering() for HD) has an input (2 or 3) and an output (1). However, the node only has two outputs. The type of inputs/outputs are different also between the node and the code version. How am I supposed to use this node?

    -Double clicking a custom node should open the script.

    Bugs:
    -The Tangent Vector node (mesh vertex tangent) outputs a Vector3 instead of a Vector4. I use the mesh channels to store custom data (not for lighting) and I need the tangent.w component. I think this bug stems from the problem that most people view the mesh and shader variables as having a specific function, like the tangent channel is to be used for tangents. But the truth is that to the GPU these are just one's and zero's and it doesn't care what you do with it. This flexibility allows you to create some really cool shaders. Case 1102140.

    -At various stages I got this error in the console when clicking Save Asset:
    undeclared identifier 'ERROR_UNITY_MATRIX_I_VP_IS_NOT_DEFINED'
    When restarting Unity, the error went away sometimes, but not always.

    -When "Inverse View Projection" is selected from the Transformation Matrix, the text is clipped incorrectly from the dropdown box.

    -Output preview below node cannot be collapsed (minimized) when the graph has an error.

    -When adding new nodes to my graph, it generates this error and shows a magenta checkerboard on the node preview. When this happens, the node displays incorrect if the preview is collapsed (minimized).
    Assertion failed on expression: 'success'
    UnityEngine.GUIUtility processEvent(Int32, IntPtr)

    -If a sub graph is changed, both the sub graph Save Asset button and the main graph Save Asset button have to be pressed for the changes to take effect. This is a pretty serious bug in my opinion. It took me a long time trying to figure out why my shader wasn't working. Any Save Asset button press, either in the main graph or one of the sub graphs have to make any changes anywhere take effect.

    -Sub graph outputs always seem to be of type Vector4, even if all nodes inside only deal with Vector1. The SubGraphOutputs node should be able to detect what type is needed. If not, there should be at least the ability to set the output type manually.
     
    Last edited: Nov 23, 2018
    Ericsheng likes this.
  44. 479813005

    479813005

    Joined:
    Mar 18, 2015
    Posts:
    39
    why texture2d don't show tiling and offset properties? but mat serialize have. Snipaste_2018-11-19_16-53-42.png Snipaste_2018-11-19_16-54-17.png
    I need declare an extra vertor4 for set tiling and offset, it's so strange.
    I can't understand.
     
  45. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    292
    i wonder if anyone has posted this request:

    Setting Data Types: for mobile shaders it is recommended to use types like half3 or fixed3 etc in some cases to make shader more efficient.

    right now when i check generated code, all types i see are of "float4".. these floats becomes heavy on mid range or budgets phones gpu.. it limits us from doing fancy effects on mobiles..
     
    Elecman likes this.
  46. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,336
    Does anyone know how to write to both UV0 and UV2 in a custom node, if it is at all possible? It is to send custom data from vert to frag.
     
  47. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,936
    Hi all!

    A friend's studio is doing an awesome metroidvania using the Unity Animation and Vector tools. Some of the problems they are having is that sprites & mesh based sprites (for vertex) aren't able to receive and cast regular Unity shadows. Is this something the shader graph can address since they want to use LWRP for this.

    Problem:

    Unity's svg vector shader and sprite shader is not casting or receiving post process, shadows (cast/receive) AND lighting (ie we need the full opaque treatment) - most modern 2D games are a mix now so it's illogical to limit sprites in any manner. The up coming 2019.1 sprite lighting stuff is insufficient - there is a need to be using cutout and regular lighting & post FX - think 3D backdrops / Guacamelee.

    Thanks for any advice on overcoming Unity's limitations.
     
    GameDevCouple_I and mangax like this.
  48. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    33
    If I select a propriety in a subgraph to not be exposed anymore, it still gets exposed when I use that subgraph node.
    Did anybody else bumped into this issue ?
     
  49. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    292
    Also i would like things like Unlit shaders to receive shadows.
     
  50. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,936
    Unity made a clear mistake in the past assuming 2D was meant to not cast and receive shadows/normals etc and they also are in danger of making a mistake that people will prefer the work in progress 2D lighting for 2019.1. Some will. Some won't. Many will mix 3D with it.

    What a game will be is defined by the game developers, not the engine developers. It may sound belligerent of me but it's no less correct, and I hope feedback is taken on board so we can at least address any issues in the graph as presumably, that's the intention! :)
     
    sand_lantern likes this.
Thread Status:
Not open for further replies.