Search Unity

Question How to expose the two sided property in shader graph

Discussion in 'Shader Graph' started by Deleted User, Jan 10, 2021.

  1. Deleted User

    Deleted User

    Guest

    How can I expose the property of two sided in shader graph?
     
    LordCafe and Indiana-Jonas like this.
  2. Indiana-Jonas

    Indiana-Jonas

    Joined:
    Jul 24, 2015
    Posts:
    12
    I'm trying to figure this out too
     
    LordCafe, JamesArndt and Deleted User like this.
  3. Mctuggernuts25

    Mctuggernuts25

    Joined:
    May 26, 2020
    Posts:
    8
    Did you guys figure it out? Dont really want to duplicate the shader just for that
     
    LordCafe likes this.
  4. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    In new version, I guess 2021.2+ you can enable "Allow Material Override" to expose these options, including cull mode, but in old versions I think there is no easy way or not possible at all. The only thing you can do is branch checking side, but it is not the same as cull mode. It might be possible to hack shader graph in some way, but it would require at least custom editor I guess.
     
    trybdyk and (deleted member) like this.
  5. LordCafe

    LordCafe

    Joined:
    Aug 26, 2015
    Posts:
    35
    Still no way to expose, double side, transparency or opaque, metalic or specular... i think old versions of shader graphs were better at least i could expose thoose parameter and din't need to cretea the same material with one parameter diferent from the rest...
     
  6. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    Why are you sowing disinformation? There is even LTS version with support for that. Also name what old version of SG supported exposing render face in inspector.
     
    DriesVrBase and LordCafe like this.
  7. LordCafe

    LordCafe

    Joined:
    Aug 26, 2015
    Posts:
    35
    Allow material to override only work for parameters that's are inside of the shader graph double side it's on the shader config so this property does not work for that.

    You can't expose by shader graph i'm not saying it's impossible to expose by code... don't remember which shader graph had this options but indeed had it.

    But whaterever it's a lil headache to create by code but it's not such complicated thing it's bad we have to do this even after all those years... it's like the minMaxAABB unity error which still on the engine for almost 8 years...

    Cheers.
     
  8. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    I am not sure I follow. This is shader graph I just made, isn't that exactly what you need?
    upload_2022-4-14_15-56-46.png
    Obviously I don't follow every single SG version, but I don't remember anything like that in older versions.
     
  9. FungusMonkey

    FungusMonkey

    Joined:
    Jun 30, 2016
    Posts:
    41
    SG.png
    Exactly the solution. They just changed the options. It used to have a two-sided checkbox. Now just as you show, select both.
     
    Last edited: Aug 13, 2022
    trybdyk and AstraGamesStudios like this.
  10. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    451
    Is it possible to set culling from the material property block?
    I would like to have the same mesh rendered twice one with cull front and the second with cull back. One of them also has an offset property that I set using MaterialPropertyBlock.
    I have tried to set _TransparentCullMode, _CullModeForward, _OpaqueCullMode and _CullMode but it did not set cull mode.
     
    Last edited: Feb 2, 2023
  11. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    You would need to check the source. Assuming you are on URP it looks like there is _Cull property.
    However one note, if you use material property block and you are on scriptable rendering pipeline then it breaks batcher, you need different instances of materials to make batcher work (unless it's instancing).
     
  12. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    451
    It is HDRP and I do not care that much about batching those are custom meshes and usually there are no two identical meshes on the scene. And there is only a handful of game objects.
     
  13. amino1020

    amino1020

    Joined:
    Apr 28, 2021
    Posts:
    1
    any updates? :(
     
  14. adreNAEline

    adreNAEline

    Joined:
    Jan 13, 2022
    Posts:
    2
    Does the old way have an option for back face only?
     
    manuelTeamComplex likes this.