Search Unity

[Best Tool Asset Store Award] Amplify Shader Editor - Node-based Shader Creation Tool

Discussion in 'Assets and Asset Store' started by Amplify_Ricardo, Sep 13, 2016.

  1. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    That seems like an unexpected result, could you send us a sample through support@amplify.pt so that we can debug this on our side? Apologies for the inconvenience.
     
  2. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for reporting this, I've passed it along to the developers to see if we can come up with a solution regarding the Render Queue getting overrided.


    We should also be able to come up with a solution for this, thank you for your feedback!


    No problem, glad I could help!

    Since your shader relies on UV position and orientation, your mesh UV's must be set up according to the desired effect, effectively solving the issue you're facing. That would be one possible solution, but in the end it always depends on the type of effect you're building and how you want to set it up, as the possibilities are nearly limitless.
     
    Last edited: Jul 3, 2018
  3. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    685
    Sure thing, I just sent you an email.
     
  4. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you, we'll investigate this situation as soon as possible!
     
  5. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    [/QUOTE]

    okay cool, but forget about my mesh for a moment, just in terms of a unity 3d cube. Some sides have panning going downwards correctly, whereas other sides of the cube have the panning going up. Is there a way to change the shader to maybe not rely on UV position and orientation and instead always force itself panning downwards no matter how the UV is set up?
     
  6. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I believe you could try using the available Vertex and World Position information, as we've suggested in a previous reply, and be sure to check our Position Cutoff sample for a specific example.
     
  7. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Ah no worries, all is solved now, actually it was fairly simple using pro-builder. All i had to do was use the UV editor and reposition the UV of each surface! Was straight forward once i learnt what to do :D

    The windows look proper nice now, but i still have to try it out in VR later tonight, as haven't tried the shader in VR yet, but hopefully there shouldn't be anything wrong!

    thanks for all your help!
     
  8. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    154
    @KillerNads I'm quite interested to see your result. Is it possible to share with us? Thanks in advance
     
  9. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    Thanks for pointing me in the right direction! I have some additional questions:

    1) Looking at what the static switch node does in the code it seems that it calculates everything anyway except for the final node. Doesn't that mean there's barely any optimization / no optimization?

    The else/if statement is placed after most of the calculations.
    Code (CSharp):
    1.             float2 uv_DisintegrateMap = i.uv_texcoord * _DisintegrateMap_ST.xy + _DisintegrateMap_ST.zw;
    2.             float temp_output_254_0 = ( saturate( (0.0 + (tex2D( _DisintegrateMap, uv_DisintegrateMap ).r - _DisintegrateRemapMinMax.x) * (1.0 - 0.0) / (_DisintegrateRemapMinMax.y - _DisintegrateRemapMinMax.x)) ) - (-1.0 + (_DisintegrateAmount - 0.0) * (1.0 - -1.0) / (1.0 - 0.0)) );
    3.             float2 appendResult244 = (float2(saturate( temp_output_254_0 ) , saturate( temp_output_254_0 )));
    4.             float4 tex2DNode235 = tex2D( _DisintegrateColorRamp, appendResult244 );
    5.             #ifdef _DISINTEGRATE
    6.                 float staticSwitch402 = saturate( ( tex2DNode235.a * temp_output_254_0 ) );
    7.             #else
    8.                 float staticSwitch402 = 1.0;
    9.             #endif
    2) How can I know the value of a static switch node somewhere else in the shader than where it was created? Here I would like to know if the keyword is activated or not also somewhere else in the tree.

    2018-07-04_07-06-50.png


    3) How do you change the enum in the material inspector created by a static switch through code? Material.SetSomething()? Material.EnableKeyword doesn't update the material inspector.

    https://i.imgur.com/4O0u7Ls.png
     
    Last edited: Jul 4, 2018
  10. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    No problem, glad we could help!


    1 - The purpose of the Static Switch node is to allow for the generation of a number of shader variants, which are generated internally by Unity depending on the type of Keyword that you're using.
    In Shader Feature, Unity will only generate the used variants and will only include in the build the active one, while in Multi Compile it generates all the variants and includes them all in the build, allowing the shader variant to be changed in runtime.

    The reason this node is efficient is because the shader will compile in a way that only one path ever runs so you don't waste performance calculating operations that are not being used. The catch is that the use of Keywords is limited to 256 in Unity, and about 60 are already being used internally. Also, the compiler is smart enough to know whether a certain code depends or not of an IF statement, so it can strip down the unnecessary parts and also deals with "else if" statements correctly.


    2 - You can set the Static Switch Mode to Fetch in its parameters in order to achieve this.



    You'll then have to select Custom in the Keyword drop-down list, and type in the Keyword's name ( E.g. _DISINTEGRATE ).


    3 - You will need to manually turn on the keyword corresponding to that current option and disable all others.

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. [ExecuteInEditMode]
    4. public class StaticSwitchTest : MonoBehaviour
    5. {
    6.     public int StaticSwitchOption = 0;
    7.     private Material m_mat;
    8.     void Update ()
    9.     {
    10.         if( m_mat == null )
    11.             m_mat = GetComponent<MeshRenderer>().sharedMaterial;
    12.  
    13.         for( int i = 0; i < 3; i++ )
    14.         {
    15.             string id = "_KEYWORD0_KEY" + i;
    16.             if( i == StaticSwitchOption )
    17.             {
    18.                 m_mat.EnableKeyword( id );
    19.             }
    20.             else
    21.             {
    22.                 m_mat.DisableKeyword( id );
    23.             }
    24.         }
    25.     }
    26. }

    The final keyword names will always be the option names appended to the static switch name following the these rules:

    - Keyword starts with a _
    - All characters are set in upper case
    - All invalid characters, like spaces, are removed
    - Static Switch and option name are separated via a _

    Please refer to the screenshot below, where we show the example setup for the described scenario:



    Here you can see that our Static Switch is named Keyword 0, and that we've created three items, Key0 through Key2, from which the final keyword names will be named:

    _KEYWORD0_KEY0
    _KEYWORD0_KEY1
    _KEYWORD0_KEY2

    In any case, you don't need to follow these rules since you can always open the shader in your text editor and look for the following line:

    #pragma multi_compile _KEYWORD0_KEY0 _KEYWORD0_KEY1 _KEYWORD0_KEY2

    This is where we are registering all the keywords.

    Please let me know if this helps and if you have any further questions, thanks!
     
    Last edited: Jul 4, 2018
    Suzuka91 and FeastSC2 like this.
  11. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    how do i set delay in my shader? i wanna set my light flicker different
     
  12. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, you could either manipulate the value through scripting, or you could try to implement the following node network, which has been previously shared by a kind member of our community:

     
  13. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    i know that this could easily be manipulated via scripting, but i would like to settle through shader instead.. i dunnoe whether this is correct, i got the delay in, but the flickering is rather pulsating now
    flicker.png
     
  14. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    121
    Forums are acting up laterly so i can't search but how can we use dx11.1 blend ops in ase ?
     
  15. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    The flickering is pulsating due to the Sin node that you've placed in the node network. I've tweaked the shared sample a bit in order to provide more control to the effect, for your convenience:



    Please let me know if this helps, thanks!


    Hey there! We're going to make those available in the near future, apologies for the inconvenience.
     
  16. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    209
    why do nodes like "world space camera pos" and "World position" seem to contain light data?

    Specifically i can see the clip ranges of point lights in the scene. which is causing a lot of visual issues. how can i prevent this?

    It actually seems to be passively related to the post processing stack v2 at least in making it visible, simple color grading a makes it visible. This here is only the "world position" node being connected to custom lighting.





    I'd also like to calculate light fall off without shadows, meaning light attenuation won't work. The methods i've tried haven't worked so far, but i'm not sure if thats because of this issue or not.
     
    Last edited: Jul 6, 2018
  17. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    great, thanks for your help!
     
  18. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    Thanks for the answer it's much clearer now!

    Now that I've added a few shader feature static switches to my shader the compilation time of that shader has increased drastically: it now takes 5 minutes to compile as opposed to the few seconds of compilation pre-adding those nodes. Is that normal?
     
  19. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! The reason you're seeing this effect is because you are not specifying anything in the shader that would make light attenuate like point lights do, since the Custom Lighting mode expects users to do the lighting calculation through our Light nodes.

    You'll have to use the light attenuation node since that's represents the smooth light attenuation for points lights and the shadow attenuation for direction lights. You can also set the shader to not cast shadows in the general properties or you can use the node World Space Light Pos node to get the type of light to filter out Directional or Point lights, as it returns 0 and 1, respectively.
    You could then use light color ( which also contains intensity information ) to make something with them.

    Here's a simple of example on how you can set it up:



    Please let me know if this helps, I'll be happy to elaborate!


    No problem!


    The issue is likely related to the amount of shader features you have on your shader.

    Unity will have to generate variants between each one of them, which can easily go up into the dozens or hundreds, depending on the complexity of the shader, and if you're using Standard Surface shaders Unity will internally generate vertex/frag code for each variant, which can lead to a huge amount of code being generated.

    A simple solution would be to try and reduce the amount of shader features.

    Please let me know if this helps, thanks!
     
    FeastSC2 likes this.
  20. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    It helps to remove some but that wasn't my original intention, nonetheless thanks for the info.
    Is there any way to know how many variants are generated by the shader?

    - I would like to create a function that can flip textures like Unity's sprite renderer flipX and flipY booleans.
    The UV node has a tiling and offset input but I must do it after having modified the uv's in various ways so I can't really use those inputs. Any ideas how that can be done?
     
  21. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    You can access that information in the inspector with the shader selected, as per the screenshot below:



    Do note that this amount increases exponentially as you add more features, which is the expected behavior.

    Regarding your other question, you can simple apply the One Minus node to the channel you'd like to flip, as long as it stays within the 0 to 1 range. If you'd rather not be concerned with the space you're working on, you may simply multiply the result by -1, as an alternative.

    Please let me know if you have any further questions.
     
    FeastSC2 likes this.
  22. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    513
    Hey guys,

    New build over the website.

    We would like to recommend closing all you ASE windows before importing this new build into your project.

    Unity hot code reload triggered by the package importing may deserialize an incorrect value into the Blend Ops current option ( if you are using them ) since we changed its range of values.

    Here are the release notes.

    Release Notes v1.5.4 dev 04:
    • Fixes:
      • Fixed issue on resetting material's Render Queue setting when compiling the shader in Material mode
      • Fixed issue on Blend Op menu not showing when loading a template based shader
    • Improvements:
      • Re-adding DX11 specific Blend Ops into its respective dropdowns
      • 'Custom Expression' node items are now reorderable
      • 'Custom Expression' node can now register dependencies to other ones
        • Can now better control function register order on final shader
    Hope you all have a great weekend and happy shader creations!
     
    Last edited: Jul 6, 2018
    FeastSC2 likes this.
  23. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    497
    Thanks for the info! I have no issue with doing heightblending on regular mesh, but I am trying to add it to the included Unity Terrain shader sample, has anyone done this? I noticed all the inputs go into a "Summed Blend" node, would the first step be replacing this with something?
     
  24. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    Thanks it all worked (for the UVs too) and removing some of the standard settings in the rendering options created less variants so I got from 960 to 340 variants :)

    I have another question about Projectors with sprites, I used the ASE sample shaders to give it a test run ASESampleShaders/Projectors/ProjectLight and it displays on the parts of the mesh where the sprite is fully transparent and it doesn't display the texture additively where there's the sprite texture.

    https://i.imgur.com/3dGcIv5.gifv

    My goal is to create a shader that could project additively, something like the light going through a forest's canopy and pan it a bit to make it more dynamic. The sprites I want to project on are alpha blended and don't use the opacity mask (only opacity).
    Essentially I want something that works like Unity's spotlight cookies but with the added ability to also pan the texture.
    Any pointers are greatly appreciated!
     
  25. DatoKiknavelidze

    DatoKiknavelidze

    Joined:
    Jul 4, 2018
    Posts:
    5
    Hi guys, currently I'm working on my indie RPG game and bumped to the heavy obstacle. I need to create disolve shader which will allow to see character through obstacles and environment meshes. Any thoughts about it?

    Here is some article about this topic: https://connect.unity.com/p/articles-dissolving-the-world-part-1

    Thanks !!
     
  26. EscalatorSafe

    EscalatorSafe

    Joined:
    Apr 12, 2018
    Posts:
    21
    Hello!
    I have a problem with the dither node when using the lightweight SRP. It appears that the dither calculation does not take into account the vertex offset of the material. When you vertex offset a mesh its dither gets all kinds of messed up.
    On the left the top cube is offset, and the bottom is not. On the right neither cube is offset and just moved to the same position, showing what it should look like. Thanks!
    Dither.PNG
     
  27. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! That's correct, as a first step, you'd have to replace the Summed Blend operations for your own height blending node setup. You should be aware, however, that the blend operation being done with the control values is responsible for allowing the terrain painting to work.


    No problem!

    If you need the projector effect to be more additive, you just need to go to the Blend Mode and set both Src and Dst to One.



    In order to pan the texture, and still using our ProjectLight sample as an example on how to achieve this, you can add a Scale and Offset node in-between the Divide and Texture Sample nodes, and use a property to control it.



    Please let me know if this helps, thanks!


    Hi! There's a topic in our forum where a user shared a shader based on that article, and some considerations were discussed as well. Feel free to check it out and let me know if it helps!


    Hey! Thank you for reporting this, I've managed to replicate it on my side and just passed it to the developer for further investigation, I'll let you know as soon as we have any developments.
     
  28. DatoKiknavelidze

    DatoKiknavelidze

    Joined:
    Jul 4, 2018
    Posts:
    5
    Thank you so much I will go trough it and will share my result, thanks !!
     
  29. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    We've nailed this issue down and it's going to be fixed in the next build.

    Both the Dither and Compute Screen Position nodes will suffer a couple of changes to allow for this effect to work correctly. The Dither node will have a Screen Position toggle parameter, which must be on to expose the new input, and the Compute Screen Position node will have a Normalize toggle parameter, that also must be toggled on.

    As both an example and future reference, the node setup will be as follows:



    This build should become available sometime throughout the week, so stay tuned!


    No problem, looking forward to see what you create!
     
  30. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! As of the latest version, 1.5.4_dev04, the DX11.1 blend ops are now exposed in the Output Node's parameters.

    Thank you for the suggestion, please let us know if you have any further requests!


    We've added a fix on the latest build, 1.5.4_dev04, which prevents ASE from overriding the inspector's Render Queue setting when it's set to any option other than 'From Shader'.

    Thank you for bringing this up to our attention!


    The Texture Sample references now have '(Reference)' appended to them instead of '(Instanced)' as of the latest build, thank you for you feedback!
     
  31. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,995
    upload_2018-7-9_16-26-12.png

    KRGraphics Advanced Eye
    upload_2018-7-9_16-30-25.png

    Alloy Eye
    upload_2018-7-9_16-30-42.png

    Hey, guys. I have a question. Is there a way to get custom lighting models in ASE to respond to the Alloy Point Lights? I am doing some shader tests and unfortunately, there are no highlights from the point lights in the scene working on my eye shader, and I would love to get that working. I've already added some forward rendering options for Reflection and Specular highlights...
     
  32. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    BUG: When using a static switch node and you have 3 enums with its input nodes filled by some node and that you go on the static switch node and that you reduce the amount of enums, the amplify shader window bugs out (menus disappear and some nodes stop displaying).

    Deleting the static switch fixes the issue.

    Below: pictures the buggy window after following those steps.

    upload_2018-7-10_12-26-14.png

    https://i.imgur.com/L3vECCh.png
     
    Last edited: Jul 10, 2018
  33. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    I tried with additive but it doesn't change the issue, wherever there's already a texture it won't display anything. It will only show on the parts of my mesh where the sprite is fully transparent and there's no sprite behind it.

    Even with the culling off, looking at it from behind yields the same visual result. Do you know what might cause this? I want the circle to be displayed on top of the sprite.

    2018-07-10_13-03-53.gif

    Here's a good example of what I'm trying to achieve using Unity's spotlights and cookies: https://i.imgur.com/BXfdnKm.gifv
     
    Last edited: Jul 10, 2018
  34. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey there! I'm afraid that we'll have to investigate this situation to see if it's entirely possible.

    I'll pass this information along to the developer and will get back to you as soon as I have any further information.


    Hello, thank you for taking the time to report this issue!

    We were able to replicate it on our side and will work toward issuing a fix as soon as possible, apologies for any inconvenience caused.


    You'll likely have to tweak the shader's render queue, so that it's written after the sprites, and you'll also have to tweak the depth operations of the projector shader.

    If you could provide us with a simple sample, we might be able to take a look into your setup and provide more insight regarding what could be done to achieve the desired effect.
     
    FeastSC2 likes this.
  35. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    SpriteLit is the one that needs to be projected on (Put it on a new GameObject with a sprite renderer)
    ProjectorLight is the one that projects. (for the material of the Projector component)

    I tried tweaking the render queue and the depth module but to no avail, I might have done it poorly however.
     

    Attached Files:

    Last edited: Jul 11, 2018
  36. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    Hi, I have some questions for VFX shaders.

    first, is it possible to create an additive shader? If so, second part of this question is that would it be possible to make an additive-alpha blend shader? It's important as the same additive effect in a dark room would look completely white in a bright room.

    Secondly, is it possible to get some kind of distortion effect while being completely transparent and unlit? If so how? I failed to get the desired effect. as the billboard would always slightly catch light/environment skybox or something. Thi would be for things like flame heatwaves or explosion shockwave etc.

    On the note of distortion, how does one distort a texture using UV's? This question may be premature as I've only tried for an hour but I can't seem to figure it out.

    Any help would be lovely!

    Thanks,
    MattyWS
     
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,995
    I appreciate it. At most, I would end up having to switch to regular shading... I am using Custom Lighting for my hair and eyes.
     
  38. Crocomodo

    Crocomodo

    Joined:
    Nov 21, 2017
    Posts:
    27
    How do I mask Post Process shader on some parts of the object? I read it somewhere that I have to render another render pass to render mask image and use it in Post Process Shader but I don't know how to do any of that. Can ASE do that or I have to write it by hand?
     
  39. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for providing the shader samples, we'll be sure to take a look into this as soon as possible.


    Hello! Yes, you can create nearly any type of shader, be it a Standard Surface, or a Custom shader through our Shader Templates. You can set the blending options in the Output node's parameters in both the Standard Surface shader type and the Templates.

    Also possible, you can use either our Unlit or Particle Effect templates for this, and we even provide a HeatHaze sample that you can use to learn how to use the particles template and produces exactly that type of effect.

    Regarding distorting a texture through UV's, it will depend on what sort of distortion effect you want to achieve, but you can make use of the Offset and Tiling input ports in the Texture Coordinates node together with a mask or specific calculations. The HeatHaze sample provides an example on how to achieve this as well.

    Please let me know if this helps, I'll be happy to elaborate!


    Hello! In order to achieve this, you'll have to create a new shader that creates the mask and saves it to a render texture, and then use that render texture in the post processing effect.
     
    Crocomodo likes this.
  40. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Unfortunately, upon some further investigation, we've concluded that Unity's projectors do not seem to be prepared to deal with transparency, so we strongly recommend that you look into other options.

    Please let me know if you have any further questions.
     
  41. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    749
    I see this but how can it be that it works with light cookies on sprites then? It seems to be exactly the same idea than a projector, the only twist I want is to make it pan which is not an option for spotlight cookies.

    2018-07-12_00-02-30.gif
     
  42. x4000

    x4000

    Joined:
    Mar 17, 2010
    Posts:
    313
    Hey guys -- it's been a while! You've been super busy, and I love what you've accomplished. I'm having trouble with rotating all the vertices of a mesh around a pivot in whatever axis. I understand that the vertices and the normals both need to be rotated at once.

    I've seen this thread: http://amplify.pt/forum/viewtopic.php?f=23&t=485

    The solution in there -- both the one provided by you guys, and then the updated one provided by the user -- have a distinctive distortion that occurs. It's on the same axis as the rotation, and I have a feeling it's related somehow to the uses of sin and cos and those not evening out properly. I've tried it on a variety of meshes, and with them having centered pivots, etc.

    Basically what I observe (this is in 2018.2) is that at 90 degrees rotated it's pretty stretched, and then at 180 degrees it's maybe a bit less but still stretched, at 270 degrees it's crazy stretched, and then it fades back down to not being stretched at all as it returns to 0.

    I'm guessing that something has changed in some of the underlying shader functions that are being used, either in your libraries or unity's, since that post last December. Any ideas on a fix?

    ---

    Also, on a semi-related note, you guys added an undocumented node called Rotate About Axis. From the sound of things this would do everything I want, but it's never been explained on your wiki or on this thread that I can see (at least not via google). I've tried putting in various inputs, but it doesn't really seem to do anything with rotation; translation works, though.

    Any help is appreciated! Keep up the awesome work.
     
  43. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
  44. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Cookies and Projectors are two distinct features, so it's expected that they'll behave differently.
    After performing several tests on our side we didn't manage to get the projector to properly work with transparency, which led us to consider that we've stumbled upon a limitation of this feature.

    Upon further investigation, we came up with the thread that we've shared which confirmed our suspicions.
    We've also noticed that you've posted in that same thread, in which a Unity engineer stated that making "Projector affect transparent objects properly is probably impossible", so we'll be keeping an eye on it for further developments on Unity's side.


    Hello, thank you for the kind words and for your feedback!

    We're currently doing a pass on our wiki node list, updating and adding information where it's lacking, so you can rest assured that the Rotate About Axis node page will be updated soon!

    This node was actually added sometime after the forum thread that you've shared, and it will simplify the whole process of rotating vectors, with additional flexibility.

    I'm sharing a simple sample that makes use of the Rotate About Axis node, for your convenience.

    RotateAboutAxis.zip

    Please let me know if this helps, I'll be happy to elaborate!


    That does look like an interesting technique, I would assume it will require additional scripting work, and the third reference you've shared seems like a good place to start!
     

    Attached Files:

  45. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    162
    Hey All,

    We are working on a new VR title and currently we are fading the entire screen to black if the player sticks their head inside geometry. Would it be possible to create a screen based shader or even a plane in front of the camera that would only fade the parts overlapping with geometry? If possible, how performance intensive would this be?

    Cheers,
    Colton
     
  46. x4000

    x4000

    Joined:
    Mar 17, 2010
    Posts:
    313
    Fantastic, thank you! That works perfectly, without any distortion. Now that I see the example, the code is very straightforward. I had tried putting in the wrong inputs into the position now, and wasn't splitting things out properly. Thanks for the fast response. :)
     
  47. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    440
    Hey, I'm using the alloy framework, and I really like what I can do with the oriented shaders, but they just stretch the textures on the Y axis. Is it possible to create a shader that would fix the problem as seen in the image below? The blended moss texture on my models match up on the x/z axis, but the walls just stretch the moss. I would love to have a shader which can blend my moss on top of the textures, but will make it match up properly on all axis for any model, no matter where I put them.

    If I could, I would just turn this into tile pieces (floor, wall, ceiling) since this is a tile based dungeon. That would let me snap things together much easier.

    Notice the stretched moss on the vertical walls.

    delete my account page
     
  48. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey! Post processing seems like the best way to go, and you'll likely need some C# Scripting to account for the player's intersection with geometry. You'll also have to have an additional pass to create a mask, and that mask would be given by the back faces of the objects, meaning that if you're seeing the back faces of an object you're clipping through it. Not quite sure how


    Happy to help!

    Don't hesitate to get back in touch if you have any further questions or feedback, thanks!


    Hello! With ASE you can build that type of shaders, but you must set up the specific nodes for the effect you're looking for. You can make use of the World Position Node to replicate what the Alloy's oriented shader does, or even perhaps the Triplanar Node for making use of that specific technique.
     
  49. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    440
    I'm trying to figure it out, but I'll be honest, I haven't wrapped my head around how to manipulate the UV offset properly based on the world position. Just using a Texture Sample for albedo, I'm trying to get the UV to always orient properly on x/y/z based on the world position. However, when I move the cubes around, the textures dont match up. What am I doing wrong?

    If I can understand how to orient the x/y/z properly, then I can probably get the rest from there. At that point, I can begin testing tile pieces.

    Thanks so much for the help.

     
    Last edited: Jul 12, 2018
  50. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    440
    So I actually managed to get this going for my floors, walls, and ceilings by testing the direction of the world normal and using that to decide how the WorldPosition will directly plug into the texture's uv slot (I'm ignoring the UV node for now). Very cool ... made a function and everything :). I can now independently choose the tiling size of my base texture and my overlay texture, and they will properly orient, even across multiple 5x5 floor/wall models. Very happy with where thats going ... it will definitely make level design much easier.

    Quick question: this is working so well, it has me thinking. Is there any way to test against my own custom logic? For example, to have my dungeon floor know if its adjacent to a wall on the north/south/east/west side, or any other data I want to pass in? I would love to set up some dynamic weathering/details based on where in my tile map the dungeon piece is. I would supply all the textures into a shader/material, and it would just do what it needs based on where in the map it is.
     
unityunity