NullReferenceException: Object reference not set to an instance of an object
ShaderForge.SF_Evaluator.Evaluate ()
ShaderForge.SF_Editor.OnDisable ()
UnityEditor.EditorWindow:Close()
ShaderForge.SF_Editor:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Also for the original shader:
Property node with ID 476 not found while deserializing
UnityEngine.Debug:LogError(Object)
ShaderForge.SF_NodeTreeStatus:GetNodeByID(Int32)
ShaderForge.SF_NodeTreeStatus:DeserializeProps(String)
ShaderForge.SF_Parser:LoadFromNodeData(String, String&)
ShaderForge.SF_Parser:ParseNodeDataFromShader(SF_Editor, Shader)
ShaderForge.SF_Editor:InitializeInstance(Shader)
ShaderForge.SF_Editor:Init(Shader)
ShaderForge.SF_Editor:OpenLoadDialog()
ShaderForge.SF_Editor:<DrawPrimaryMainMenuGUI>b__28()
ShaderForge.SF_Editor:FlexHorizontal(Action)
ShaderForge.SF_Editor:DrawPrimaryMainMenuGUI()
ShaderForge.SF_Editor:DrawMainMenu()
ShaderForge.SF_Editor:OnGUI()
UnityEditor.DockArea:OnGUI()
That's very strange. I can't seem to reproduce this.
Does it happen in a new shader too?
Do you have any strange settings for the shader?
What error are you getting in the console?
In the latest version I'm getting an awkward tiling issue, I'm not sure if I'm missing something. But here's the graph, I can see the tiles doing something awkward. I already checked the vertex normals in maya, but all are pointing up.
If I try with any other regular Unity shader, it doesn't happen.
I would guess it's a very low glossiness causing that, but it does seem strange that it makes that specific tile brighter. Does it only happen with the PBL mode? Does it happen with a constant value in gloss? Does it happen with a constant value in spec?
programmer is asking whether it will be compatible with all the new stuff in unity 5.0 when it comes out. Not sure if you could even answer this right now.
programmer is asking whether it will be compatible with all the new stuff in unity 5.0 when it comes out. Not sure if you could even answer this right now.
"Compatible with all the new stuff" - depends on what all the new stuff is.
I've readied SF so that it works in unity 5 already, but I haven't made it support the new fancy features of U5 yet. It is planned though
Hey, most PBR shader workflows I look at use Albedo, Roughness, Metalness and Ambient Occlusion , normals and the cubemaps as their main textures. Is there any sort of plan for a possible tutorial on how to set up this type of PBR material set up? I tried looking through threads and couldn't find any node setups about it.
I'd like to second that request. Can I just express again how good this tool is, the more I delve into it the more I'm impressed.
Right now I'm learning slowly and mostly from trying to replicate UDK stuff (something that might help is a translation of which node is which compared to the UDK ones).
One other thing that's bugging me big time is the lack of a decent vertex painter solution in Unity, although that's in no way your fault
AO is a bit tricker - you'll have to multiply it by your cubemaps, and possibly your ambient lighting as well, which can get tricky if you want it to be super accurate.
I've planned to make an AO input of the main node soon
I get this whenever i use anything like a add, multiply etc
Hey, sorry about the late reply - I am going to look at this shader again and see if it is just local to me.
SO I remade the shader and it works as expected. I noticed that when I tick on light
map support it again kills the shader but this isnt a massive issue for me.
Hey guys and newbie alert! I'm experimenting with triplanar shading (different textures, depending on the angle of the polys), but I need some help.
As you can see in the preview, the triplanar-ness of it is actually working - there's snow on the top and bottom of it, and grass on the sides. The transition between the snow and grass is too wide and smooth though - I would like to basically "sharpen" the mask, so the transition could be tighter, perhaps even use an actual masking-texture for it.
However, I am completely stumped as to how I could do it, despite faffing about for what feels like hours trying to fix it. Anyone have any snazzy insights I am missing? Comments on the rest of the shader are welcome as well, I welcome any and all optimizations.
Is there any major differences between the SF PBL and say Toolbag 2 or the shaders in substance designer? Because, when i display my model in Unity with SF PBL some parts look like light is wrapping around the edges of it. It looks bright and not very natural. It only seems to be happening non metal parts of the mesh where i'm trying to do "rough plastic" with little to no gloss and spec. And it still looks glossy kinda.
I thought it might have something to do with my Cubemaps for IBL both Diffuse and Spec are generated from "Skyshop" and i'm decoding by multiplying the (RGB X A X 6)
Another thing i noticed was i can see seams in the cubemap when it's mipped, on the surface of the model. Does it have something to do with the way i have to put a 1- node on my gloss and multiply it by 7 to get blurred reflections working?
And i was wondering what the PBL node tree looks like when plugged in to the custom lighting part of the material, because i'm interested in learning more about shaders and don't have any programming knowledge. And i want to see if i can create the "metalness" workflow that UE4 uses.
Sorry about the length of my post, thanks if someone replys!
I don't know exactly how they implement their PBL, but there is almost certainly a difference somewhere, but it shouldn't be a big one.
If you get specular light around the edges it, it could be that you're getting normal map leaking; try it without a normal map, or that you have an old version of SF that had too strong of a fresnel.
If you're getting seams, it probably means that the skyshop cubemap was incorrectly baked, or that you've got the multiplied value too high. Change it from 7 to 6 or 5 or so, until it goes away when fully rough.
Also, the PBL node tree is rather huge, so it's not very fit for node-based approaches.
I don't know exactly how they implement their PBL, but there is almost certainly a difference somewhere, but it shouldn't be a big one.
If you get specular light around the edges it, it could be that you're getting normal map leaking; try it without a normal map, or that you have an old version of SF that had too strong of a fresnel.
If you're getting seams, it probably means that the skyshop cubemap was incorrectly baked, or that you've got the multiplied value too high. Change it from 7 to 6 or 5 or so, until it goes away when fully rough.
Also, the PBL node tree is rather huge, so it's not very fit for node-based approaches.
Thank you for the reply! I upgraded SF and the problem with the fresnel being too strong was fixed.
As for the seams in the cubemap i changed the multiply from 7 to 4-5 and the seams went away in rough materials but appeared in smooth materials, so i put a clamp 0-1 node after it and the seams went away with the multiply at 7. Was i supposed to do this in the first place?
Deferred lighting is pretty much ready now!
However, beta 0.33 will most likely be quite unstable when it's out, so be sure to have your version control ready
I'll of course try and fix any issues as fast as possible when/if they were to pop up.
This is a single quad using a Deferred Shader Forge shader, with 24 real-time point lights:
There are also two new nodes, for making boolean/toggle/switch/checkbox properties. Note that these are active, not static switches, meaning that it'll process both inputs. So don't use this for optimization, use it for things you want to enable/disable in real-time.
Mind that deferred pre-pass lighting is not a solution to all problems. While you are able to use a ton of real-time lights, you will also be much more limited in terms of lighting your shader.
Here's a summary of what's new and how deferred affects what's possible
New in Shader Forge Beta 0.33:
• Deferred Pre-Pass lighting is now supported! However, it has the following limitations:
- Blinn-Phong only
- Unavailable main node inputs: Diffuse Power, Transmission, Light Wrapping, Custom Lighting, Alpha, Refraction, Outline Width/Color
- Gloss will always be remapped from [0-1] to [0-128]
- Specular highlight colors won't be 100% accurate
- None of the lighting nodes will be available, except ambient light
• Added node: Switch
- This is a property node, exposed in the inspector as a checkbox
- Outputs the Off input when unchecked
- Outputs the On input when checked
- Note that this is an active branch, not a static branch
• Added node: Toggle
- This is a property node, exposed in the inspector as a checkbox
- Outputs 0 when unchecked
- Outputs 1 when checked
• You can now switch Channel Blend method between Summed and Layered:
- Summed means it will multiply all channels, and then add them together
- Layered means it will blend the channels on top of each other, commonly done in terrain shaders
• The forward rendering lightmapping has changed a little in how it deals with real-time lights
• Fixed a bug where energy conservation broke the shader when using a non-PBL lighting mode without specularity
• Broken shaders saved with a property node bug from 0.29 should now load without locking up Unity
AO is a bit tricker - you'll have to multiply it by your cubemaps, and possibly your ambient lighting as well, which can get tricky if you want it to be super accurate.
I've planned to make an AO input of the main node soon
Hey, I'd be highly interested in how to achieve that, how you apply an ao/cavity map in a pbl shader.. I have read into pbr a little, certainly still lack knowledge.. I'd love to hear an answer on that, or even better.. get an AO slot as you mentioned
If somebody has a solution on how to add AO or what the nodes what look like I'd appreciate it.
So basically it would mean masking the ambient light with the ao map, because ao shouldn't affect direct lighting, only ambient? If this is physically correct I think I got the nodes correct
thanks for the quick answer!
Yeah I might fake it for now... I'm thinking about using pbr in our (school) project, which is basically a scifi/cyberpunk environment
Is it possible to offset the uv coordinates of a texture but disable tiling, so only a single version of the texture appears? I am trying to create an effect somewhat like decals but within a single shader, ie placing logos on different parts of a shirt.
You should do it by setting the texture's wrapping mode to Clamp rather than Wrap, and make sure the borders aren't bleeding unwanted pixels out into the outer areas.
This may not always be possible (due to mipping etc), so in that case you can make a mask that replaces whatever is outside the 0 to 1 UV range
Shader Forge Beta 0.34 is now released!
• All nodes can now be created with hotkeys using a new quick-select menu!
- Holding a letter on the keyboard will display a menu of all nodes starting with that letter
- Scrolling the mouse wheel will move you through the list
- Clicking will create the highlighted node
• Fixed a bug where you couldn't use some vectors in the alpha clip input
• Fixed an issue where deferred pre-pass shaders didn't handle gloss values of zero properly
• Fixed a bug where you couldn't use the light direction node in the outline color input
• Fixed a bug where fog didn't work on deferred pre-pass shaders
• Fixed a bug where shaders using UV coordinates didn't compile on the PS Vita
• Potentially fixed a bug where your locale would make shaders write commas as decimal separators rather than periods
I seem to only be able to light my shader with up to 3 lights. Adding a forth and the light that was added third stops working.
Is there a way to be able to use any number of lights? Maybe I've missed something? <.<
That's a limitation of forward rendering. The light count can be controlled in the quality settings of your project.
If you enable deferred rendering in Shader Forge (and your camera/project), you'll be able to use a ton of lights, with the downside of not having as flexible/accurate shading.
Replies
ShaderForge.SF_Evaluator.Evaluate ()
ShaderForge.SF_Editor.OnDisable ()
UnityEditor.EditorWindow:Close()
ShaderForge.SF_Editor:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Also for the original shader:
Property node with ID 476 not found while deserializing
UnityEngine.Debug:LogError(Object)
ShaderForge.SF_NodeTreeStatus:GetNodeByID(Int32)
ShaderForge.SF_NodeTreeStatus:DeserializeProps(String)
ShaderForge.SF_Parser:LoadFromNodeData(String, String&)
ShaderForge.SF_Parser:ParseNodeDataFromShader(SF_Editor, Shader)
ShaderForge.SF_Editor:InitializeInstance(Shader)
ShaderForge.SF_Editor:Init(Shader)
ShaderForge.SF_Editor:OpenLoadDialog()
ShaderForge.SF_Editor:<DrawPrimaryMainMenuGUI>b__28()
ShaderForge.SF_Editor:FlexHorizontal(Action)
ShaderForge.SF_Editor:DrawPrimaryMainMenuGUI()
ShaderForge.SF_Editor:DrawMainMenu()
ShaderForge.SF_Editor:OnGUI()
UnityEditor.DockArea:OnGUI()
Strange though, not sure what could have gone wrong. Upload the shader to pastebin
http://pastebin.com/5Z40SKKM
proporder:2-1037-1306-533-447-69-9-177-571-626-145-476
Remove -476 from that list, and it should work again.
This is due to a bug that was in 0.29, in which you saved the shader, most likely
Also. when i try blending this with another diffuse, it doesnt work and gives me the magenta colour?
If you want to invert it, you should be able to do (farPlane-nearPlane) / depth.
What node setup gave you a broken shader?
I get this whenever i use anything like a add, multiply etc
Does it happen in a new shader too?
Do you have any strange settings for the shader?
What error are you getting in the console?
If I try with any other regular Unity shader, it doesn't happen.
Deferred lighting will be supported soon!
(With a few limitations of course, due to how the deferred pre-pass lighting system works)
"Compatible with all the new stuff" - depends on what all the new stuff is.
I've readied SF so that it works in unity 5 already, but I haven't made it support the new fancy features of U5 yet. It is planned though
Right now I'm learning slowly and mostly from trying to replicate UDK stuff (something that might help is a translation of which node is which compared to the UDK ones).
One other thing that's bugging me big time is the lack of a decent vertex painter solution in Unity, although that's in no way your fault
Diffuse <- Albedo
Gloss <- OneMinus <- Roughness
Specular <- Metalness
AO is a bit tricker - you'll have to multiply it by your cubemaps, and possibly your ambient lighting as well, which can get tricky if you want it to be super accurate.
I've planned to make an AO input of the main node soon
Hey, sorry about the late reply - I am going to look at this shader again and see if it is just local to me.
SO I remade the shader and it works as expected. I noticed that when I tick on light
map support it again kills the shader but this isnt a massive issue for me.
Thanks for the quick responses.
(Note that they aren't static / multi-compile switches, they are still properties. Static switches may come later!)
As you can see in the preview, the triplanar-ness of it is actually working - there's snow on the top and bottom of it, and grass on the sides. The transition between the snow and grass is too wide and smooth though - I would like to basically "sharpen" the mask, so the transition could be tighter, perhaps even use an actual masking-texture for it.
However, I am completely stumped as to how I could do it, despite faffing about for what feels like hours trying to fix it. Anyone have any snazzy insights I am missing? Comments on the rest of the shader are welcome as well, I welcome any and all optimizations.
I thought it might have something to do with my Cubemaps for IBL both Diffuse and Spec are generated from "Skyshop" and i'm decoding by multiplying the (RGB X A X 6)
Another thing i noticed was i can see seams in the cubemap when it's mipped, on the surface of the model. Does it have something to do with the way i have to put a 1- node on my gloss and multiply it by 7 to get blurred reflections working?
And i was wondering what the PBL node tree looks like when plugged in to the custom lighting part of the material, because i'm interested in learning more about shaders and don't have any programming knowledge. And i want to see if i can create the "metalness" workflow that UE4 uses.
Sorry about the length of my post, thanks if someone replys!
If you get specular light around the edges it, it could be that you're getting normal map leaking; try it without a normal map, or that you have an old version of SF that had too strong of a fresnel.
If you're getting seams, it probably means that the skyshop cubemap was incorrectly baked, or that you've got the multiplied value too high. Change it from 7 to 6 or 5 or so, until it goes away when fully rough.
Also, the PBL node tree is rather huge, so it's not very fit for node-based approaches.
Thank you for the reply! I upgraded SF and the problem with the fresnel being too strong was fixed.
As for the seams in the cubemap i changed the multiply from 7 to 4-5 and the seams went away in rough materials but appeared in smooth materials, so i put a clamp 0-1 node after it and the seams went away with the multiply at 7. Was i supposed to do this in the first place?
However, beta 0.33 will most likely be quite unstable when it's out, so be sure to have your version control ready
I'll of course try and fix any issues as fast as possible when/if they were to pop up.
This is a single quad using a Deferred Shader Forge shader, with 24 real-time point lights:
There are also two new nodes, for making boolean/toggle/switch/checkbox properties. Note that these are active, not static switches, meaning that it'll process both inputs. So don't use this for optimization, use it for things you want to enable/disable in real-time.
Mind that deferred pre-pass lighting is not a solution to all problems. While you are able to use a ton of real-time lights, you will also be much more limited in terms of lighting your shader.
Here's a summary of what's new and how deferred affects what's possible
It should definitely be out this week!
New in Shader Forge Beta 0.33:
• Deferred Pre-Pass lighting is now supported! However, it has the following limitations:
- Blinn-Phong only
- Unavailable main node inputs: Diffuse Power, Transmission, Light Wrapping, Custom Lighting, Alpha, Refraction, Outline Width/Color
- Gloss will always be remapped from [0-1] to [0-128]
- Specular highlight colors won't be 100% accurate
- None of the lighting nodes will be available, except ambient light
• Added node: Switch
- This is a property node, exposed in the inspector as a checkbox
- Outputs the Off input when unchecked
- Outputs the On input when checked
- Note that this is an active branch, not a static branch
• Added node: Toggle
- This is a property node, exposed in the inspector as a checkbox
- Outputs 0 when unchecked
- Outputs 1 when checked
• You can now switch Channel Blend method between Summed and Layered:
- Summed means it will multiply all channels, and then add them together
- Layered means it will blend the channels on top of each other, commonly done in terrain shaders
• The forward rendering lightmapping has changed a little in how it deals with real-time lights
• Fixed a bug where energy conservation broke the shader when using a non-PBL lighting mode without specularity
• Broken shaders saved with a property node bug from 0.29 should now load without locking up Unity
Hey, I'd be highly interested in how to achieve that, how you apply an ao/cavity map in a pbl shader.. I have read into pbr a little, certainly still lack knowledge.. I'd love to hear an answer on that, or even better.. get an AO slot as you mentioned
If somebody has a solution on how to add AO or what the nodes what look like I'd appreciate it.
So basically it would mean masking the ambient light with the ao map, because ao shouldn't affect direct lighting, only ambient? If this is physically correct I think I got the nodes correct
Masked by Diffuse AO:
Diffuse IBL, Ambient lighting, Indirect lightmap light, Light probes
Masked by Specular AO:
Specular IBL
Right now there are no nodes for doing lightmaps and/or light probes though
Yeah I might fake it for now... I'm thinking about using pbr in our (school) project, which is basically a scifi/cyberpunk environment
This may not always be possible (due to mipping etc), so in that case you can make a mask that replaces whatever is outside the 0 to 1 UV range
• All nodes can now be created with hotkeys using a new quick-select menu!
- Holding a letter on the keyboard will display a menu of all nodes starting with that letter
- Scrolling the mouse wheel will move you through the list
- Clicking will create the highlighted node
• Fixed a bug where you couldn't use some vectors in the alpha clip input
• Fixed an issue where deferred pre-pass shaders didn't handle gloss values of zero properly
• Fixed a bug where you couldn't use the light direction node in the outline color input
• Fixed a bug where fog didn't work on deferred pre-pass shaders
• Fixed a bug where shaders using UV coordinates didn't compile on the PS Vita
• Potentially fixed a bug where your locale would make shaders write commas as decimal separators rather than periods
BTW Am I free to redistribute the shaders made in SF (eg. sell assets that use them)?
Is there a way to be able to use any number of lights? Maybe I've missed something? <.<
If you enable deferred rendering in Shader Forge (and your camera/project), you'll be able to use a ton of lights, with the downside of not having as flexible/accurate shading.