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_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    The thing with the outline is that we need to update it. The truth is that we thought the update to the templates system were coming sooner so we delegated the updates of the outline to a future template, since its taking a lot more time because of the documentation it may be a good idea to add a new output port to the master node so you can customize the line as you want. Not gonna give you any promises but it's something we definitely need to update.
     
  2. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Actually, about the overlay effect, what would solve my problem and be the best solution in my opinion is if you guys changed the "Blend Operations - Overlay" node to behave like it does in Photoshop, it's what i think most people would expect, right now it just has too much contrast compared to a typical overlay effect, here's an example, notice the highlights, i'm trying to work on a lighting system and have been stuck on this for days, i really need to figure out how to overlay colors over texture and have it behave like Photoshop's overlay effect.

    Overlay.jpg
     
  3. ArtC0de

    ArtC0de

    Joined:
    Sep 7, 2015
    Posts:
    14
    Hello,
    I'm really trying to create a glow effect on an object in a dark ambient. In my case I just want a cube to glow with Blue color.
    But I can't understand how I can do so...
    Sorry but I'm new, just bought this asset and started unity 2 weeks ago. I would really appreciate a little help here :)
    Thanks!
     
  4. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    You are hitting all the hard spots :D I went to check the code because it already is supposed to be the same as photoshop and analyzing further we discovered an error in some of them (always the same error) including overlay. We fix this for the next build for sure, sorry for the inconvenience, I'm guessing this was one of the reasons you were having different results :\

    You want the object to emit like or just the glow effect? The glow effect is done in a screen shader that renders on top of everything else. In your case you can use unity post processing stack that you can get for free here: https://www.assetstore.unity3d.com/en/#!/content/83912

    That will generate a customizable glow that you can control on a per object basis by using the Emission channel of your object shader/material. Meaning, in ASE you output a color into the emission port and that color will be used to create the glow that the post processing stack creates.
     
  5. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    That's good to hear! I'll be waiting for the next version :)
     
  6. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Hey Paulo.

    I tried before all settings. With dx11 (but android has nothing to do with it) and all gles types. No success with it. Also in combination with all apis like: vulkan +gles2 + gles3 . It should work if you have ogl2 and api ogl2. The node "Fresnel" in combination with emission seems to be the troublemaker.

    I´ve used another material-shader editor.And it worked fine there. This is why i am confused why it doesn´t work with ASE :-(
    Maybe you or someone else can check it again. My phone is a honor 6. A really powerfull beast. Fresnel in combo with emission is really important in many cases, in my opinion.
     
  7. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Template additions allowing us to do this sound good, but even a new output port to the master node (really need this for custom lighting) would be good. If you were to put in a new output port, what kind of timeframe would we be looking at?
     
  8. hdxpmc

    hdxpmc

    Joined:
    May 1, 2016
    Posts:
    53
    Hello,
    We are creating painting app, and using MegaSplat compiled shader. Currently, we would like to control the channel input RGAB, UV/UV3/UV4 input to MegaSplat compiled shader, and would like to have options to switch between multiple effects (ex: only gradient, or toon, or painting only, ...). So how to put those MegaSplat compiled shader to Amplify Shader Editor as node ?

    Best regards
     
  9. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    93
    @Amplify_Paulo did the missing feature get added? Did you manage to create a sample? I've haven't updated for a while, waiting on this :)

    As it was a few weeks ago, here was the previous comment:

    I'm looking to lower walls and doors when between the camera and the in world focus point (normally the player character).
     
  10. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Can you create me a repo project that's failing? I'm not saying just the shader, the whole project. This is because it doesn't seemed to be the shader since it's generating the correct code and from my tests it only breaks when the settings from the project don't match the shader. Even the shader you shared previously is working fine for me.

    We've talking internally and we aren't sure yet if we are going to add the port, we are going to make some trials to see how complex or easy it is because we suspect it will open a can of worms. If we don't the next alternative would be to add more options to existing system or simply wait for more options to be available in the template system. My best guess in terms of time is weeks :|

    While you can add tags to the compiled shader to open it up in ASE your best bet is to use megasplat nodes they provide to recreate what you need with them.

    We added the missing features back in 1.3.2 dev05 to create cross section effects, there are some caveats tho, some meshes need special treatment for the effect to work correctly. If it's regular walls and doors it should work without extra work but if the mesh has various overlapping geometries it needs to be divided in two sides.

    Here's an example:
    Unity_2017-11-08_11-16-51.png
     

    Attached Files:

  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Still quite stunned by Amplify's work overall. Quick question - what changes if any, will be made once scriptable render pipeline (HD pipe) is released?
     
  12. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    I think the main advantages will be how we can approach some effects. I can't promise anything because we are still studying it and waiting for a more stable API, but I think we'll be able to create more modular stuff. For instance, right now we are limited to how unity renders objects to do everything but why not create separate modules that we create an offer so that we can plug our own rendering solutions like specialized SSS effect, different shadows or ambient occlusion. But it could also be used just change the default pipeline in some way, how about different BRDF functions? Its not that its impossible now, it's really trick to do it seamlessly. This is at least stuff that I hope it will be possible. I guess time will tell.
     
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Finally got my foliage working. The face node is perfect for this, especially for doing hair on the head, but I will need to figure out how to use UV2 for doing the highlights for the fibers. I'd probably have to do a template for a Kajiya-Kay shader model
     
  14. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    93
    Brilliant thank you, I'll have a play.
     
  15. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Hi guys, any chance for a terrain Shader Template?
    I would love to amplify my terrains.
    Thanks!
     
  16. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Hello every one!

    I was wondering if there would be some implementation of a 3D texture node in the future? Also is there a skybox shader creation planned?
     
  17. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Okay,

    i will minimize the content. So you can get a small vers. of it. I guess i can pack it as *.unitypackage, so you / your team can easily open it. I would use this email adress: support@amplify.pt / subject: "Fresnel + emission", foward to: Paulo. Is these correct, so far ?
     
    Amplify_Paulo likes this.
  18. pwTA

    pwTA

    Joined:
    Mar 20, 2014
    Posts:
    5
    Is there something wrong with the Light Attenuation node? It seems it's shadow data is fubar'ed.

    For instance, is you create a custom lit shader with this three-node setup (just like the example in your Light Attenuation node online docs, sans base texture being multiplied in)...
    2017-11-08_181538.png

    You get this:
    2017-11-08_181741.png

    With the one and only main (directional) light shadow settings setup thusly:
    2017-11-08_181848.png

    If you change the shadow type to Hard Shadows, leaving Bias, Normal Bias, and Near Plane the same, it's even more telling...
    2017-11-08_182041.png

    Knowing about zero about how Unity derives and stores shadow data, to me it looks like a shadow buffer somewhere is being under-sampled. I see that, in the compiled code, ASE pulls (for a directional light) atten data from the global illumination system:
    2017-11-08_183206.png

    Thanks!! ...I was constructing a Cook Torrance custom-lit BDRF shader and just wasn't getting good results.
     
    KRGraphics likes this.
  19. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    85
    Is possible make a wireframe shader with amplify shader editor?
     
  20. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    I'm unable able to use a TextureArray with the Triplanar Sampler. Are there any examples where the triplanar code is broken out? I'm pretty sure I could use a TextureArray when adding the textures individually but I don't know what nodes to use to re-create the Triplanar Sampler node. It must be relatively straight forward? I get as far as the world position UVed texture but not sure how to mask it based on the normal.
     
  21. AndreBengtsson

    AndreBengtsson

    Joined:
    May 6, 2016
    Posts:
    14
    Hey again! I realized I was supposed to use the Template Parameter node instead of the Texture Node to utilize the sprite, and then it worked :)
     
    Amplify_Paulo likes this.
  22. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    We do have one planned for the near future.

    Yes that is fine, I'll keep an eye on it.

    Unfortunately you are seeing the correct results :\ Those are the real shadows that unity calculates by default. You can however, change the internal files to use different shadows solutions and filtering. There are even assets on the asset store for that purpose. Of course that comes with a performance cost. There reason it looks worse is because unity takes advantage of the diffuse visibility term falloff to mitigate the more aggressive artifacts. You do this by simply multiplying the ndotl component with the rest of your operation, like this:

    Unity_2017-11-09_11-38-41.png

    In this screenshot the right ball is using unity standard material with a black texture in the occlusion property to remove GI, on the left the shader you see below and as you can see they look pretty much the same besides the lack of specular highlights in the left ball. Notice how the shadows artifacts are even the same (vertical strip in the base of the model).

    With a template yes, not by default. We do have intentions of adding a new option for wireframe, kinda like we do for outline. We'll also be providing a template for wireframe shaders in a near future.

    This is the most simple example:
    Unity_2017-11-09_11-47-15.png

    Notice how the texture object marks the "auto-cast mode" into texture 2d array, and in the triplanar node you have to activate the option to use texture arrays. This will change in the future so that the triplanar node can detect the texture 2d array automatically but for now that's how you do it. You need the lastest version tho since its a new feature.

    Hope that helps.
     
    pwTA likes this.
  23. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    I'm interested too on thi so I've downloaded the "v1.3.7.001 – 7th November 2017 – Stable" but I can't replicate your nodes network.
    Where am I wrong?
     
  24. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I'm running into some issues with the shader functions, when i make a change in the function, for the change to take effect in every shader it's used it has to be disconnected, compiled, re-connected then re-compiled.
     
  25. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    In attachment a simple example ;)

    Uhm, that's strange because the comparison is done on a hash which changes on every save and communicates to every window, still, I'll take a look, there might be something fishy with that. If you have reproducible steps share those, meanwhile I'll go hunting.
     

    Attached Files:

    marcatore likes this.
  26. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I'm about to lose my mind, i've made a shader which snaps my sprites, yet when i duplicate the sprite it no longer snaps the duplicate and the original sprite. What could be going on?


    Snap.png
     
    Last edited: Nov 15, 2017
  27. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I've made a new project and the issue still happens, i'll pm you a link to the project, It's a simple scene with a simple sprite shader that uses a shader function to change the sprite's color, notice that the sprite is blue when you open the scene yet the color is red in the shader function, if you unplug the function in the sprite shader, compile, then plug it back in then re-compile it will show red.
     
  28. Shiyao

    Shiyao

    Joined:
    Nov 27, 2013
    Posts:
    23
    Hi everyone, Can I use Amplify shader to make a customized PBR shader for tree creator? How? Unity Tree shader is very bad. I can not stand of their result. This problem has been bothering me for a long time. Thanks.
     
  29. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    That is most likely due to the batching kicking in. The reason I say this is because you are getting the pivot point using the object to world normal, this is usually fine to get the origin of your object but the problem is that the batching actually merges the meshes together so they when up sharing the same origin. You either do the effect without that dependency, pass the origin individually by script or turn off batching altogether in the shader. Obviously the last one is not desirable but the shader must get that data somehow in you want to use it. Can't you perhaps us the world position instead? (I didn't look at what your were doing, just a suggestion).

    Thx a lot, I'll be working on a few shader function related stuff so I'll take a look at that asap.

    Yes you can. Just keep in mind we don't offer any functions or helpers by default for unity trees (at least, not yet) so you may need to call unity internal functions for the vertex movement and what not. Or, you could roll your own.
     
    Khena_B likes this.
  30. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've just uploaded a new build into our website.

    Here are the release notes.

    Release Notes v1.3.7 dev 02:

    • Fixes:
      • Fixed issue with 'Texture Coordinates' node not generating local variables correctly
      • Fixed issue with Refraction port not correctly working with Tessellation
      • Fixed issue on applying vertex offset in certain Templates
      • Fixed cast and per channel operation issues on remaining blends on 'Blend Ops' node
      • Fixed issue on Soft Light Blend Op on 'Blend Ops' node
      • Fixed issue of Shader Function nodes not propagating data when generating code
      • Fixed focus issues when adding new items on Additional Includes, Pragmas, Sub-Shaders Tags and 'Custom Expression' node tools
    Hope you guys have a great weekend and happy shader creations!
     
    Last edited: Nov 10, 2017
  31. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    [QUOTE="Ahhh I think I get it now, that's because that particular example is purposely set up in a way that gets completely dark when the lights are out. So it's not exactly an issue with the baking stuff. Still, refresh me again to what you want, do you just want that particular sample to have indirect light when there are no lights?

    There's also another thing I did to the light attenuation on purpose that maybe there are reasons against it. I actually set it black when there's no light while unity sets it white. It made sense to me that when there's no light you see nothing but maybe unity uses that to force indirect lighting to shine through? not sure, but I'm willing to change that if I find thats the case.
    [/QUOTE]

    Hooo, that might be the case, im used to see the baked lighting even with lights off (as others unity shaders does) and since i didnt saw the baked light in the toon shaders, i thought that might be a performance issue since there was no visible baking even if i was trying to do it.

    Been able to deactivate light after baking, can be usefull in some cases like indoor places where no main directional light is shining, or to just have full baked static lighting.

    With that in mind, i can work now in my pipeline if i see something ill let you know, thank you so much for the help!

    EDIT: i downloaded todays update, and i think that this one broke even more the usability.

    Indirect lighting is completly ignored now by the toon shader, no matter realtime or baked, a escene that i already had working stoped doing it.

    My escene was a lava dungeon interior, the lava was the only thing "illuminating" the room (along to a directional light looking upwards in order to create lighting in dynamic objects), so i used the emissive value in the lava material and that illuminated the scene with real time emissive, that worked pretty well, but now, that is ignored, it just happened after the last update.

    example

    Here are 3 spheres, on the Left (not visible) a sphere with a custom light toon shader, center a sphere with a emisive, on the right a sphere with standard shader all of them static.
    upload_2017-11-10_20-2-11.png

    After Baking and indirect lighting view, we can see how the indirect lighting is afecting both spheres, also we can see how the sphere with standar amterial is reflecting light meanwhile the one with toon shader dont (that just discovered)

    upload_2017-11-10_20-3-23.png

    Here, the shaded view, we can see that the sphere with the toon shader, is not showing any indirect ligthing (real time used to work, baked never worked)

    upload_2017-11-10_20-2-11.png
     

    Attached Files:

    Last edited: Nov 11, 2017
  32. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I've just tried the new build and didn't notice any difference with the Blend Operations - Overlay, it's still behaving like it did before.
     
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Does anyone know how to create a custom interface for shaders? I would love to do a little more organisation in my shader library. Separate detail mapping and so forth
     
    spaceemotion likes this.
  34. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    Hello,

    This only appears to work with a Spherical Triplanar Sampler. When I change the mode to Cylindrical, the shader gets these errors:

    Code (csharp):
    1.  
    2. Shader error in 'ASE/TriplanarShader': incompatible type for parameter #1 ("tex") at line 51 (on d3d9)
    3.  
    4. Shader error in 'ASE/TriplanarShader': incompatible type for parameter #1 ("topTexMap") at line 63 (on d3d9)
    5.  
    6. Shader error in 'ASE/TriplanarShader': 'TriplanarSamplingCF': cannot implicitly convert from 'Texture2DArray<float4>' to 'sampler2D' at line 63 (on d3d11)
    7.  
    8. Compiling Vertex program with SHADOWS_DEPTH UNITY_PASS_SHADOWCASTER
    9. 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_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME
    10.  
    Also, when connecting a something other than a float node to the Index the shader then gets 4 undefined variable "i" and related errors. For example, try setting the index via a vertex color. The same error crops up.

    Finally, when switching from Cylindrical back to Spherical, the "Use Texture Array" check box is reset (but not going from Spherical to Cylindrical.) Not a huge deal but seems like an easy fix.
     
  35. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Hi Paulo.

    I´ve sended you an email with a test.unitypackage. Email-Subject is: ("Fresnel + emission" error , foward to: Paulo.)
    If you got some time, it would be great if you can take a look inside, to see whats wrong.
     
  36. xxPillsxx

    xxPillsxx

    Joined:
    Oct 10, 2012
    Posts:
    31
    Hi.

    What is the correct way to overlay a texture onto another? The Add node messes up the color, the Lerp node is what I want but without the Alpha (both textures should have 100% opacity, obviously the one on top would not cover the one underneath).
    Edit: After digging up some old threads, I was able to set up this, which works:


    But I have no idea why this works. Can anyone explain this to me?
     
    Last edited: Nov 11, 2017
  37. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Use Lerp and use the alpha, if the one on top is 100% opaque it will cover the one underneath, unless i misunderstood what you mean.

    OverlayTexture.png
     
  38. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    I have a problem with Vertex Position node.
    The wiki says "The Vertex Position node outputs the vertices position in object space. This data is extracted directly from the mesh and contains the vertex position relative to the object origin, this means the position values don't change whatever transform value your gameobject has"

    But, from my POV, it seems that it's working in something like "world position".
    Look at this situation.


    The lower cube has the pivot on Y coords to "-1", the middle one to "0" and the higher one to "+1".
    If I'm not in trouble, the gradient black to white it should be the same in the 3 cubes, considering that the vertices have the same distances from the pivot position. Is it correct or not?

    And if I move the cubes, I have this result


    So, am I wrong with my node setup or there is something that is not working as expected?

    I'm using the v1.3.7.002
     
  39. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Uhm, I'll look into it as soon as possible, meanwhile what's your unity version?

    So the issue that we found in the blend ops were about the way the component based ones were being calculated, we did a bunch of tests and made a bunch of changes to the code and in the end everything was still exactly the same (we were actually comparing with photoshop results) thats because our initial assumption of the error was simply wrong so we reverted most of the changes and compared the results again and everything is correct, what I mean but that is that we actually did the overlay effect on photoshop, saved the result to a texture and created a shader that would compare that texture to the same operation with the blend op node and there were none, the results were completely the same. Sorry for not warning you sooner. Can you send us your shader and perhaps the images you are testing with? I'm suspecting that the issue is not the blend op node but something else, it could be the texture compression of some shader definition that we are missing.

    Yep, I made some dummy mistakes :| sorry about that, I'll fix it for the next version.

    Check your email ;)

    Thats the exact behavior of a lerp node, so just like Khena already said, use it instead, you might be connecting the wrong alpha.

    They are correct, what you are seeing is the byproduct of unity batching doing it's job. Because you are accessing the vertex position directly and because unity is batching your quads together they become just one mesh and share they data together. You need to either turn off batching, use different materials on each one, or use some other data to make it work, for instance in that quad scenario you could use texture coordinates. Of course this isn't always possible. One other solution if batching is really important to use is to save the object position, be it locally or in world space into a unused texture channel via script (for instance, on load, or on compile?) and then use that texture channel. You could also try using instancing. And offset the world position values by their origin.

    I know it's more work you might want to do but things like this are some of the drawbacks of using things like batching :\
     
  40. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I've just found the issue, i was making you a test project to show you how ASE's overlay didn't behave like my Photoshop Overlay shader, then noticed that they looked the same unlike in my project, started disabling stuff and it turns out the result is different because of Amplify Color's LUT on my camera, my overlay effect is on a sprite in the scene so rendered before the LUT, ASE's overlay effect was on a post process effect that was rendered after the LUT, this explain everything, didn't think about that. Moved Amplify Color's effect to be the last component on my cam and everything works fine, sorry about that :rolleyes:
     
    hopeful likes this.
  41. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    By the way let me know if you've been able to recreate the shader function saving issue with the test project that i've sent you.
     
  42. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Hi Paulo. Thank you for taking a look into my files. Now with the new ASE v1.37 everything works fine ! :)
     
  43. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Hi, the latest version is the one im using, 2017.2.03f

    EDIT: ok, actually any kind of baked light doesn't works, only receives direct lighting.
     
    Last edited: Nov 14, 2017
    Amplify_Paulo likes this.
  44. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    Hi again,

    So now the Triplanar Sampler (cylindrical) doesn't get any errors when using 3 texture arrays for the top, middle, and bottom. However, the other two (middle and bottom) only show as white. If you only use one texture array and drag it 3 times to the top, middle, and bottom it shows properly. However, only being able to set one index makes this a Spherical Triplanar shader in disguise.

    There should be 3 tiling, falloff, and (especially) index inputs. One for each texture input. Otherwise the cylindrical sampler is no different from the spherical one. You need independent textures for each top, middle, and bottom. One index property isn't going work.

    The use case I'm trying to get to work is this: 3 texture arrays to the top, middle, bottom inputs of a cylindrical triplanar sampler. Independent control over which texture is shown per each top, middle, and bottom. This works with the spherical sampler.

    I think I could get this to work fine if I had an example triplanar shader using discrete nodes instead of the all-in-one triplanar sampler. I appreciate how easy it is to use, but an example with just nodes would be more powerful in the long run. "Give a man a fish and you'll feed him for a day. Teach a man to fish and you'll feed him for a lifetime" is relevant here. :)
     
  45. NinjaISV

    NinjaISV

    Joined:
    Dec 29, 2014
    Posts:
    124
    Hello,
    So I'm making a shader that fades out to 50% opacity when the camera is too close to the surface. Now I've got the shader working perfectly, except for one thing; it's not being taking into account by Amplify SSAO.

    (Code: This plugs into the opacity on the output node.)


    (Shader with alpha fading correctly, but SSAO not working)


    (Shader without alpha fading correctly, but SSAO is working)


    (SSAO debug with alpha shader)


    (SSAO debug with no alpha shader)


    (Alpha shader node settings)
     
    Last edited: Nov 14, 2017
  46. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Hey there! I saw that ASE will get on the Black Friday sale on the Assetstore. Now I'm really interested in it. One question, though. Will it support SRP's in the future? Thank you.
     
  47. ScoobyNooby

    ScoobyNooby

    Joined:
    Nov 14, 2017
    Posts:
    45
    Hello Amplify.

    Question: is it possible to send values out of a amplify shader to c#?
    I'm 99% sure you cant do that with shaders but I thought its best to be 100% sure.

    The reason I ask this is.. I have these farm objects that grow crops, I currently use render texture to capture how much light these objects are getting so I know how well the crops grow. This is working fine using render texture approach, however the level could end up with many of these farm objects so I'm concerned about performance. I thought if the shader could output how much its affected by light that I could use that value.

    I just had a thought.. could the shader calculate how much light its getting and output that info into a color? in greyscale or something? I could then just get c# scripts to get that color value right?
     
  48. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    No worries, it was a good investigation anyway, we actually learn a few things in the process and we noticed a few missing blend ops so it wasn't lost time ;)

    I'll look into it as soon as possible, I've pile up quite a few issues these past days :C that I need to look into. I'll probably look into yours either today or tomorrow.

    Glad it work out ;) sorry for the inconvenience.

    You are totally right, and truth is since last time you mentioned these issues I already had the intention of separating the indexes, it just didn't came out in time to the new build so I decided post pone it.

    This is normal. The issue is depth writing. Transparent objects do not write to depth because there's no concept of depth when multiple transparent surface are stacked onto each other. You'll need to sacrifice something somewhere. For instance, you could try doing a masked shader instead of a transparent one and have the dither effect create the transparency for you. It wont look as good of course but at least it'll allow depth writing and it will work correctly with ssao. You could also try alpha to coverage. Or finally you could try changing the internals of unity rendering system to create a order independent system for transparent objects.

    At some point yes. We have some ideas on how to take advantage of it but we aren't sure yet so we are prioritizing the current features and the ones we had in your roadmap for a long time. Once the main features get more stable we'll start looking into it.

    You can always read the content of render texture individually so if you are already saving the results into one you can simply fetch the pixels in question using c#.
     
    Kolyasisan likes this.
  49. NinjaISV

    NinjaISV

    Joined:
    Dec 29, 2014
    Posts:
    124
    Ah, I see. Thank you!
     
  50. ScoobyNooby

    ScoobyNooby

    Joined:
    Nov 14, 2017
    Posts:
    45
    so you didn't bother to read my question.lol ok thanks for nothing.