Search Unity

Standard Double Sided Shaders

Discussion in 'Assets and Asset Store' started by username_unity_of_my, Jul 29, 2015.

  1. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279

    Hmmm, I just checked 5.6.1 and ds standard shaders work fine ( Imported from 5.6.0f3 version )
    That line you changed need to be AdditiveLight( IN_LIGHTDIR_FWDADD(i), LIGHT_ATTENUATION(i)); in StandardDSCoreForward.cginc for additional light pass. You can look in built in shaders for 5.6.1f1.
    What error does it display?
    Have you tried creating new project with default settings and importing again?

    I just submitted update to fix shadows for two face cutout shaders.
     
  2. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    494
  3. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    If post processing effect has its own depth pass ( or any other ), it must implement double sidedness also or it will not detect backfaces.
    EDIT: If I remember correctly, I once used SSAOcclusion which did not detect backfaces but SSAObscurance did .
     
    tomekkie2 likes this.
  4. jtrunyon

    jtrunyon

    Joined:
    Sep 1, 2017
    Posts:
    1
    Just upgraded to Unity 5.6.3 p1 and the StandardDoubleSided shader is not working
     
  5. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    I tried it on 5.6.3 and it works fine, also I tried it by downloading from AssetStore and it also works fine, I tried it on Unity 2017.1 and also works fine.
    Can you tell me what are the errors?
    If you used older versions of DS shaders and imported into new unity version it will not work of course. You have to download new version of DS shaders also.

    Is there anybody else that is having problems on 5.6.3?
     
    Last edited: Sep 10, 2017
  6. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    Is this asset works with lightmapping? double sided lightmapping?
     
  7. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    I think double sidedness is irrelevant with baking lighting. You can place two quads opposite of eachother or place two meshes one cull front other cull back - than bake. After you bake you can remove other side meshes.
     
    Last edited: Nov 6, 2017
  8. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    @username_unity_of_my Hi, in Unity 2017.2p1 unity will not build if it finds shaders with errors in them., So your shaders are stopping us from build project. Please have a look asap
     
  9. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    I just tried on 2017.2f3 which is the one latest from download page and it woks fine. I build it for android without any errors.
    I'll download Unity 2017.2p1 to test and get back to you.
     
    Last edited: Nov 23, 2017
  10. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I build for Windows x64 does not work. If I exclude the shader it works 2017.2p1 (Its newer than f3)
     
  11. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    Just to say that standard shaders for Unity 2017.2p1 have changed and I'll release update soon.
     
  12. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    Update is released.
     
  13. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    348
    I have the same problem, I sent you a message. Now all of my materials are pink.
     
    kenshin likes this.
  14. Frigid

    Frigid

    Joined:
    Jan 31, 2014
    Posts:
    3
    I changed the type of light source (from directional to spot\point light) and the shadows were gone.
    Is that the way it should be, or am I doing something wrong?

     
  15. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    That is legacy shader right?
    Mobile, legacy, two face ( surface ) work same as Unity equivalents
    If you want to enable point/spot lights in forward rendering path - add 'fullforwardshadows' pragma directive ( instead of noforwardadd)
    And, of course, expect it to be somewhat more perfomance costly.
     
    Last edited: Jul 22, 2018
  16. Little_Gorilla

    Little_Gorilla

    Joined:
    Oct 11, 2013
    Posts:
    69
    Hey there! I just got this asset and it's awesome that it can light the backside of double-sided planes!

    Ran into a snag with making country flags though, is it possible to have a shader that will mirror the backside face texture?

    Ideally you can provide one texture and it will display the backface mirrored to save on memory.

    Front (Correct)
    upload_2018-9-21_18-55-10.png

    Back (Incorrect)

    upload_2018-9-21_18-55-46.png

    However when I create a mirrored texture it works correctly
    upload_2018-9-21_18-56-16.png

    Forgive me if this is super easy to do in the shader file, I normally use Amplify for shader editing!
    Cheers

    EDIT:
    Just added this to the surfDS function in TwoFaceTextureDiffuse.shader and it works for the time being:
    IN.uv_SecTex.x = 1 - IN.uv_SecTex.x;
     
    Last edited: Sep 22, 2018
  17. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    446
    Hello,
    thanks for your asset, it's a really missing one.

    but i have a problem and i don't understand why..
    yesterday i was using it for the first time in my project and standard shader was working perfectly.
    Today i re open my project and i get this error message:

    Shader error in 'DoubleSided/Standard/Standard DS (Roughness setup)': invalid subscript 'fogCoord' at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(105) (on d3d11)

    Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL LIGHTPROBE_SH FOG_EXP2 _NORMALMAP _METALLICGLOSSMAP
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING

    after that i updated unity to 2018.2.9f1 but the problem is still there.


    Edit:
    Just few minutes after that, i imported another character which also need to use 2sided shader,
    But this time i used specular because i know the first is broken...

    And this is really strange because it works on my screen, but the console says the opposite, so maybe after a restart i will not have it to work normally...

    Code (CSharp):
    1. Shader error in 'DoubleSided/Standard/Standard DS (Specular setup)': invalid subscript 'fogCoord' at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(105) (on d3d11)
    2.  
    3. Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL LIGHTPROBE_SH FOG_EXP2 _NORMALMAP _ALPHATEST_ON
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
    Code (CSharp):
    1. Shader error in 'DoubleSided/Standard/Standard DS': invalid subscript 'fogCoord' at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(105) (on d3d11)
    2.  
    3. Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL LIGHTPROBE_SH FOG_EXP2 _NORMALMAP _ALPHATEST_ON
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
    Code (CSharp):
    1. ArgumentException: Getting control 26's position in a group with only 26 controls when doing Repaint
    2. Aborting
    3. UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:117)
    4. UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:461)
    5. UnityEngine.GUILayoutUtility.GetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:450)
    6. UnityEditor.EditorGUILayout.GetControlRect (Boolean hasLabel, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8803)
    7. UnityEditor.MaterialEditor.PropertiesDefaultGUI (UnityEditor.MaterialProperty[] props) (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1629)
    8. UnityEditor.MaterialEditor.PropertiesGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1582)
    9. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     

    Attached Files:

    Last edited: Sep 25, 2018
  18. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279

    I see that they changed some standard shaders code for 2018.2.
    I submitted update for 2018.2.1 version
     
    Last edited: Sep 25, 2018
    blackant likes this.
  19. kimyoungk

    kimyoungk

    Joined:
    Oct 3, 2018
    Posts:
    1
    Hello, I am having trouble importing your current release Double Side Shader v3.5 to Unity2018.1.9.f2.
    It imports fine with Unity2018.2.11.f1, but I have to use earlier version of Unity (2018.1.9.f2) to make asset bundles.

    Is there a way to get the older version of your Double Side Shader that works with Unity2018.1.9?
    Becasue I need to use "DoubleSided/Other/Standard DS" & "DoubleSided/Other/Standard DS(Specular setup)" but both of them showing error when I imported to Unity2018.1.9
    Thank you

    ErrorLog.png
     
    Last edited: Oct 5, 2018
  20. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279

    If you are using newer version then it wont work because Unity change standard shaders code for version 2018.2.
    Try to import older version. Open Unity v2017.1 and import package again.
     
    Last edited: Oct 7, 2018
  21. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    135
    I'm using 5.6.5 and I'm getting the following error with the standard double sided shader ....

    Shader error in 'DoubleSided/Standard/StandardDoubleSided': invalid subscript '_LightCoord' at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(143) (on d3d11)
     
  22. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    Hi,
    First: I hope you downloaded shaders version with Unity version you are using because standard shaders are different for most Unity versions. Coping shaders from version to version dont work.
    Second: Can you contact me on email please ?
     
  23. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    135
    yes I downloaded with the version I am using - the same error comes out on both PC and my Mac. I will try to find your email.
     
  24. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    76
    Hello,

    I just updated to the latest version, which you say it's compatible with 2018.2.1.
    I have 2018.2.10 and when compiling I'm having the following errors:

    Code (CSharp):
    1. Shader error in 'DoubleSided/Standard/StandardSpecularDoubleSided': 'fogCoord' :  no such field in structure; 'x' :  no such field in structure; 'saturate' : cannot resolve function call unambiguously (check parameter types) at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(125) (on gles)
    2.  
    3. Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL FOG_LINEAR
    4. Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING
    5. (Filename: Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc Line: 125)
    6.  
    7. WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
    8. WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
    9. WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
    10. WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
    11. Compiled shader 'DoubleSided/Standard/StandardDoubleSided' in 20.76s
    12.     gles (total internal programs: 1100, unique: 386)
    13.     gles3 (total internal programs: 1100, unique: 386)
    14. Shader error in 'DoubleSided/Standard/StandardDoubleSided': 'fogCoord' :  no such field in structure; 'x' :  no such field in structure; 'saturate' : cannot resolve function call unambiguously (check parameter types) at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(105) (on gles)
    15.  
    16. Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL FOG_LINEAR
    17. Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING
    18. (Filename: Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc Line: 105)
    19.  
    20. Shader error in 'DoubleSided/Standard/StandardDoubleSided': invalid subscript 'fogCoord' at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(105) (on gles3)
    21.  
    22. Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL FOG_LINEAR
    23. Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING
    24. (Filename: Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc Line: 105)
    25.  
    26. Shader error in 'DoubleSided/Standard/StandardDoubleSided': 'fogCoord' :  no such field in structure; 'x' :  no such field in structure; 'saturate' : cannot resolve function call unambiguously (check parameter types) at Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc(125) (on gles)
    27.  
    28. Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL FOG_LINEAR
    29. Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING
    30. (Filename: Assets/_DoubleSidedShaders/Shaders/DoubleSided/Standard/StandardDSCoreForward.cginc Line: 125)
    I didn't do a clean update, should I?
     
  25. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    Hmmm, I cannot replicate error.
    Everything is in order on me 2018.2.1
    Can you send me email? -
     
  26. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    76
    I can confirm this was caused due to duplicated files when updating it. I cleanly installed the asset and it's not throwing errors now.

    EDIT: No, it's not. I'm sending you an email.

    EDIT 2: After mailing back and forward with @username_unity_of_my we weren't able to find the issue. But I just learned the hard way. Assets can be uploaded for a specific Unity version to download.
    Since we first downloaded the asset in a Unity 2017 version, the last one uploaded didn't download.
    Downloading the asset again in a Unity 2018 version did the trick and it's working correctly now.
     
    Last edited: Dec 12, 2018
  27. Frigid

    Frigid

    Joined:
    Jan 31, 2014
    Posts:
    3
    Is it possible to change aRGB values via editor? I'm trying to make a semi-transparent sprite but the color values are simply ignored.
     
  28. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    658
    Your standard double sided shader works fine until my character nears a unity point light attached to a campfire.
    Note: I am also under a directional light (sun), but the bright effect from the campfire point light does not appear with the unity standard shader, only with the standard double sided shader.



    DS shader.PNG
     
  29. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    You can try one of transparent shader versions if original standard DS version doesn't suit you.
     
    wood333 likes this.
  30. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279

    Do you use and post process effects ?
    In package demo ( with red tent ) there are directional and point light in scene and all the shaders are double sided.
     
  31. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    658
    Thank you for your suggestions. No, I am not using post processing. I may try the other double sided shaders over the weekend. Our current plan is to add more back side mesh and use unity standard shader. We don't have much time here to experiment and figure things out (me and one part timer). We usually pick a certain path quickly, and move on. I tried the double sided shaders because I already owned them.
     
  32. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    658
    The double sided legacy shader bumped diffuse works. The standard shader has more options, but something in your double sided version over-reacts to the point light on my campfire. This point light I use is standard unity. I am in 5.6.6f2. The light is set bright enough to cast shadows at night, even under a unistorm moon. In comparison with the unity standard shader the double sided standard shader reflects the point light in almost an electric effect, as depicted in my original post.

    The double sided legacy shader is a good option for the present. Future items worn by the PC or NPC will be designed with additional mesh, which renders the issue moot.

    As always, thank you for your input and contributions to the Unity community.
     
    Last edited: Jan 14, 2019
  33. Christin2015

    Christin2015

    Joined:
    Dec 1, 2015
    Posts:
    31
    Hi @username_unity_of_my , I have just found your asset in the store and would be interested especially in the shader "mobile bumped specular 1 directional light". Does the current package work in Unity 2018.3? And are there any GPU (iOS and Android) which do not render this shader as expected?
     
  34. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    279
    It works in 2018.3 .
    If you are using IOS - make sure you use OpenglES and not Metal.
    There were issues on Metal.
    Maybe those were fixed by now though..
     
  35. Christin2015

    Christin2015

    Joined:
    Dec 1, 2015
    Posts:
    31
unityunity