Teie kommentaarid

In the meantime, how about a simpler implementation where you can simply select a group of nodes and save them along with their connections (amongst themselves). Then when you're in a shader, you could browse the list of saved nodes and load a saved group and Shader Forge would recreate all those nodes in your current canvas like a copy/paste. Not as tidy I guess, but still super helpful when you have commonly used node trees and don't want to manually recreate them when making a new shader.

Don't worry about updating prefab instances of the node groups or whatever (user can simply load updated group and swap it out with old one themselves), or number of outputs, or stuff like that. Just plop the nodes in there.

Would be nice -- at the moment I create a shader in SF, then port the generated code into a skeleton shader I wrote that works with GPU instancing.

Hey, is there any chance you could rehost that image? Interested to see how you'd do this with nodes. Thanks!

Just one point light in both examples.  Everything is the same except I swapped the Lerp's A and B values.  
So in reference to that last image, that's the expected behavior?  I'm still confused as to what's going on.  The behavior is the same with one light and multiple lights, and I'm just pulling the alpha of the light to keep things simple for now (swapping the alpha for the rgb doesn't fix it)

On the left side, the light attenuation setup provides a smooth transition from 1 to 0 as you move away from the light source.  When I have that plugged in to lerp between 0 and 1, it works as expected.  

But when I plug the (assumed) identical values from LightAtten into a lerp between 1 and 0, it's as if the light attenuation changes and I no longer get a smooth transition.  Why does changing A and B of the lerp node seem to change the values that LightAtten * LightColor provides it?  

The values being fed into the lerp's T should be the same -- the light is the same and the nodes feeding lighting data are the same.  A T value of 0.5 should output 0.5 in both setups (and it does if I use a slider instead of the LightAtten setup), but it doesn't here.  Why not? 

(only difference is that I swapped the 0 and 1 values)

Is this correct behavior?  Left is what I'd expect, but on right I'd expect it to go dark to light (opposite of left).  

If I swap out the LightAtten * LightColorAlpha setup with a slider, it can go dark as I'd expect, so it feels like a bug to me.  

edit: If I take the right side setup and change 1 to 0.5, this is the behavior: http://gfycat.com/ExcellentPartialIndigobunting

I'm confused heh.  
Unfortunately your emission solution doesn't work for what I'm actually trying to do (not pictured in graphs).  I want to use the light attenuation as a lerp value (to control the strength of a softened fresnel effect) and I can't pass that into the emission channel (LightAtten * LightColorAlpha is always 0 if plugged into emission).  

Try to do it all in the custom lighting channel and I bump back into this behavior -- haven't found a way to normalize it.  
Your solution does work, but I guess I'm still confused about how the output could be affected by what's plugged into B if T is set to 0 (100% A).  
This is happening to me in 0.34 -- PMed you link to shader file