A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by Amplify_Ricardo, Sep 13, 2016.
XD XD XD Just I've updated the original post with the fixed file before read your post.
Eheh no worries!
Your node definitely helps. It allows the rain to run in edit mode and without any extra code on my end, which is fantastic. I'm actually in the process of optimizing my rain shader and incorporating your node into it
Has promised, I've just uploaded a new built into our Download area.
Here are the release notes.
Release Notes v0.2.0 dev 002
Improved duplicate code detection system
Slight improvement on save/update times ( important for Live Mode )
Fixed issue with 'Texture Sample' node incorrectly outputting a float4 when no texture assigned and on Normal mode
Fixed issue on not opening the correct shader from a material inspector if a new one is selected from its dropdown
Fixed issue with 'Length' node incorrectly changing its output type
Community Node additions
The Four Headed Cat
Flipbook UV Animation
Hope everything runs smoothly on your end and happy shader creations!
I was looking at some custom node code that has been posted and think it's an amazing feature to be able to extent the plugin this way, but I also noticed that shader types (float2, float3, etc) are hard-coded.
I wonder if it makes sense, that a node features a "precision" drop-down field (low, medium, high), to allow an ASE user to specify on what precision a certain node should operate, which is useful for mobile devices.
The custom node C# base-class could provide something like a "GetPreferredPrecision" method, that would return "fixed", "half" or "float", which should then be used in the custom node C# code to construct the shader variables with the corresponding precision.
Using low and medium precision is still popular in mobile development to improve performance and decrease battery consumption.
Thought I'd chime in with a feature request.
Would it be possible to get some sort of Reroute nodes? Something similar to what UE currently has:
Spoiler: Reroute Node
Also, is the 10 texture interpolator limit something that can't be bypassed? It's not a huge issue, but I do feel like it may prevent the creation of very complex shaders.
Request, Tabbed windows for the shader editor. This also can be usefull when Material Function are added into ASE
Yes it makes perfect sense. We are already planing on soon adding this, and also choose precision per local variable manually registered through 'Register Local Var' node.
Great request, this will come in handy.
Concerning the interpolator limit there is not much we can do about it. When moving to custom shaders you will have more control on how they are used but there will always be a limit.
Oh so many times yes! This is such a major feature we want to implement since it will open the possibilities to many cool features!
A quick question, is there a way to make mask clip value visible in material inspector?
You raised a pretty good point. Unfortunately it is always written as a constant, but we'll add it as a property on our next update so it can also be accessed it from the material inspector as you requested.
EDIT: Since your request was quick to implement we decided to add it right away so it won't be a road block on your work.
I've just uploaded a new version with it. When updating the shader with this new version you should now see a 'Mask Clip Value' property on your material inspector.
SUBMIT YOUR CONTENT!
Use our submission form to submit your own content. Nodes, Shaders or even Editor extensions, we encourage you to share your creations with the growing ASE community. In addition to this thread and our own Sample Page, we will feature the latest notable samples in the ASE Asset Store page.
Rescuing this from first page, with outline i understand the typical outline of cell-shading and similar.
I vote for this suggestion too. But or I am wrong or it must wait until multipass support.
Spoiler: Outline example
I think it does need multipass, but I'm nearly a total novice.
We released a new build today fixing several issues from people upgrading from our early v0.1.0 dev 001 to the current version and prevent the need of deleting the older version and re-importing all over again.
We apologize for not releasing this earlier.
EDIT: Some files were deleted and others were renamed between versions. Unfortunately Unity package importer doesn't remove deleted files and also doesn't update names on renamed assets when importing a new package.
Is there any skin shader available for this asset?
I'm getting Undefined variable using get set local var and vertex color on frag
Hi Crossway. Kebrus, one of our community members is currently working on skin shader sample.
Keep an eye at this thread and he should post it as soon as he has it done.
Hey rea. I tried to replicate your issue but with no success. The 'Get Value Var' is connected to which nodes/ports?
I mean can we create a deferred SSS skin shader with Amplify Shader?
How can I make a "do not draw" shader that masks/culls pink colored pixels? I would need this for my game's level design to be able to view through the ceiling. I use VoxelImporter and MagicaVoxel, and I don't want to make a separated ceiling that is simply disabled during edit time.
I thought it would be a smarter choice to color the top voxels with pink (255 0 255), and use a don't draw shader to mask/cull those colored pixels of the exported mesh model during edit time.
I guess I would use "Blend Mode Masked" for this!? However, there is no "if" node (yes I'm a noob. this is not how it's done). So I can't check for the color code pink, 255 0 255, and then mask/cull it out. Any idea how to do this?
Actually, there is If node and other logical operators (equal, not equal, greater than, lower than).
Have you downloaded the last release from Amplify web page?
In fact, i think that the logical operators are included on the actual asset store version (beta 2).
I found the problem, i have to set the order index for the register local var lower due the code result are like this
float4 FLOATToFLOAT4320=( RedSplat * 2.0 );
float RedSplat = input.vertexColor.r;
I've been trying doing stuff with custom lighting models and one of things that are important for many effects to work is changing vectors according to normals, tangents, etc. So I decided to create a new node that takes 3 or 4 vectors to create a matrix since those effects usually need a matrix.
This doesn't allow you to create custom lighting models just yet, but it's one step closer
A fully functional SSS skin shader is not possible to do for now at ASE. Kebrus already gave us some feedback about some roadblocks he encountered are we already registered them on our roadmap so we could implement them on a future update.
A simple quick solution is to follow benderete suggestion. We will also make color masking available on a future update.
Yes, I admit order index is not intuitive at first. We will maybe rethink on it and make it also possible to be auto-generated.
EDIT: A fast solution to color masking ( not very robust ):
i see yes to be honest it's kinda tedious to reordering index all the time, if it can be automated that would be great.
also the property index might need to be revamped by using some kind of reorderable list in master node property panel
Yes you are right. I was on Beta 1. It's just weird that I looked for the orange update button today a few hours ago before I imported this extension, but there was only the blue download button.
Check this forum or Amplify website often, because devs launch several updates per week for customers.
Finally i can make the HeightMap Texture Splatting node working
Hmm it seems IMG tag are not working, here's the link incase people wondering how it works
Hi Amplify Team,
I'm trying to use ASE to create a cubemap reflection shader using Blinn Phong for specular highlights, but the specular highlighting doesn't work at all without manual hacks to the generated shader.
The reason for this is the unusual way Unity have implemented Blinn Phong in lighting.cginc. The code there references a variable in UnityLightingCommon.cginc called _SpecColor which doesn't have a default value defined so appears to default to black. The way that Unity has used Blinn Phong for their legacy Specular shader (i.e Normal-Glossy.shader) is to define a property like so:
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
The variable is never used in the CgProgram code and appears to function like a pass-through property to the variable defined in the common cginc file.
So I have created the following shader in ASE to replicate the functionality of the legacy specular shader:
And everything in the generated shader file matches except for _SpecColor, which is not generated by ASE as it is not connected to anything (and cannot be or a variable with the same name will be created in the CgProgram code and cause a compile error). Without that property the specular lighting is not visible (only the GI contribution is).
Any chance you could automatically add a property definition for _SpecColor (but not a variable definition within CgProgram) whenever Blinn Phong is selected as the light model ? An appropriate default value would be (1, 1, 1, 1) to ensure specular is controlled via the specular channel by default (see post by kebrus)
This one for the CustomNode API
- Hide Flag for default input value from property panel for inputPort ParentNode Class, just like the dynamic node class where they doesn't have any default value shown in the property panel ie LerpNode.
Basically another Bool true/false option to define default value are visible or not something like HideinInspector flag
- Warning popup message (with configurable message) when people are connecting a node into an InputPort and the WirePortDataType doesn't match, this can help people to avoid getting shader error when compiling.
Hey! I'm not sure if the guys at Unity made the absence of the term on purpose. The results don't seem correct to me, but I could be wrong.
Anyway, it's seems to be an easy fix. For now here's a temporary fix until Amplify gets a better solution:
1. Search and edit the file "StandardSurface.cs"
2. Ctrl+F to find for the line that says
3. Copy and paste the following code BEFORE the searched line.
@kebrus Thanks !! That works well, I had a peek at the code yesterday to attempt the same thing but didn't appreciate how complex a node based shader editor is
If Amplify are happy to go with something like this then I suggest the index is hard-coded as 0.
Do you mean the results of the specular highlights ? The default specular color for the 'Legacy Shaders/Specular' shader ,i.e Normal-Glossy.shader, is (0.5, 0.5, 0.5, 1) so that could be why you are seeing a difference if using white instead. I also saw a note in the lighting.cginc that highlights can become too bright on some GLES2.0 platforms (iOS) due to precision issues.
Otherwise I got an exact match with the attached ASE shader to the legacy specular. Let me know if you can see any issues with it.
Edit: I should have mentioned that the unity shader code I refer to is 5.4.0 but the build I tested in was 5.4.1p4
I have a couple of other requests/suggestions based on my testing so far:
_SpecColor for Blinn Phong as per kebrus code
EDIT: Unity Legacy Specular defaults to (0.5, 0.5, 0.5, 1) but a more appropriate value would be (1, 1, 1, 1) to ensure specular is controlled via the specular channel by default (see post by kebrus)
Add 'SimpleSpecular' example to show how to implement supported Blinn Phong channels (at least albedo, specular and glossy) along the lines of my attached shader in post above. The normal and opacity channels are optional as they are not required to produce the specular highlights.
Support for master (surface) node optional parameters like noambient and interpolateview (all documented here) for optimisation purposes
EDIT: + support for #pragma targets below 3.0 (i.e 2.0) for mobile optimisation
Thanks and keep up the good work !
@rea can you maybe share some of of that heightmap blending goodness? What is your setup and how does it work.
also what are you using to paint the splatmaps.
cheers and thanks
What I mean is that I tried messing around with the value and the results were weird, it's like they weren't properly tinting the specular reflection, I even put others specular shaders side by side and these seemed off, thats why I think it might be on purpose.
I actually disagree about the default being 0.5 because the amount of specular is controlled by the specular output from the shader which means that by default the highest value should be produced by changing the specular term without ever touching the specColor. By thats just my opinion anyway.
Good point ! I have edited my earlier post to suggest (1, 1, 1, 1) as the default
Ah I see, I actually only use pure white (I always change it from the default) so I never noticed any tint issues. Hopefully once ASE supports custom lighting we can roll our own replacement.
Simple experiment with shader: hatching an image
Spoiler: Shader diagram
Spoiler: Output shader example
Hope you all had an awesome weekend.
Concerning Blinn Phong, for now we will add the additional _SpecColor property but in the future we will discard Unity Blinn Phong implementation and do our own since there are certain aspects we don't quite agree on it.
Eheh didn't expect you guys would be scavenging on this one. This section is still very wip but yes I will surely take your suggestions into account.
We need to really to give a bit more thought on Blinn Phong model on Surface shaders. This will be a bit irrelevant when we will give the ability to build your custom light models.
Changing between Shader Model 2 and 3 is a great and easy addition. Expect this soon on a future update.
It's great to see another awesome shader from you! Really cool effect!
Today we won't be uploading a new build but expect one tomorrow!
Amplify Shader Editor Tutorial - Animated Fire Shader Example [Recorded with BETA 1]
Amplify Shader Editor - Asset Store Page
From the shader of my last post I made a Post-process Camera Effect (sorry for the bad frame rate, but I It's captured with software and the laptop try its best):
I can't wait for Post-process implementation on ASE XD
Another Post-process Camera Effect based on previous shader created with Amplify Shader Editor: Pixelation
On both cases the process have been basically to "convert" the surf program to frag program and write a simple script to make a Graphic.Blit with the shader in the OnRenderImage function.
Here's the simple setup,
For the vertex painting you can use this tool https://github.com/slipster216/VertexPaint
@Amplify_RnD_Rick Yes custom light models will be a better solution, thanks!
I also wanted to ask whether you are considering support for the recent shader_feature pragmas for toggling the specular highlights and glossy reflections of the standard shaders ? My testing indicates that that Unity will not generate the Pass variants to handle these keywords unless the pragma directives are added to the CgProgram code of the surface subshader.
Is there a way to use a texture sample in conjunction with 2 different uv coord? I mean suppose we have these lines of code in a shader:
float4 val1 = tex2D( _TextureSample1, input.uv_TextureSample1);
float4 val2 = tex2D( _TextureSample1, input.uv_TextureSample1 * some_const);
How can I achieve it in the editor? Currently the only way I found was to use another texture sample with same texture.
Hey, you can do that by putting two texture samples and marking the second one as an instance of the first. Check the node property panel.
We've just uploaded a new build into the download area.
Release Notes v0.2.2 dev 001:
Fixed issue with 'Mask Clip Value' not being correctly synced between material and shader
Added colored Debug Mode ... this is an experimental feature where each port and wire are colored according to its data type. Each color/type pair are not final
Hold 'P' key to enable debug mode and release it to disable it
Double hit 'P' key to toggle debug mode on. Double hit 'P' key again to disable it.
Added 'Matrix From Vectors' node
Fixed issue with 'Vertex Binormal World' node
Added 'Shader Model' dropdown on Master Node properties
Community Node additions
The Four Headed Cat
Fixed issues with 'Logical Operator' nodes
We didn't have this registered on our roadmap but will surely add it to our Community Suggestions.
Happy shader creations!
Featured Sample - Dissolve Burn FX
A great example of how to create a dissolve effect, fully animated and customizable. Created by benderete, follow him @fourheadedcat Included in the ASE package.
About this effect, here go the files (attached):
Pixelated.shader --> The shader to pixelate a texture, done with ASE.
PixelatedEffect.shader --> The post processing shader based on the previous shader.
PixelatedEffect.cs --> The script to do the effect (drop it on the camera or with the camera selected go to menu "Component --> Image Effects --> The Four Headed Cat --> Pixelated Effect"
Feel free of use, improve, fix, etc...
Note that I'm new on this, and post processing effect shader and script can have some error or need performance improvements.
@Amplify_RnD_Rick : The nodes [Ext]Add (AddOpNode.cs), [Ext]Subtract (SubtractOpNode.cs), etc, should work or they are WIP about Multi line add/subtract/divide/multiply ops?
Custom node: Constant Tau (2 * PI)
Yes, not very exciting
Custom node: Relay
This node Output its Input without any modification. Only for best diagram organization (similar to Relay from Shader Forge or similar to Renode from UE4 Material Editor).