Using Blender's nodes in Unity

Hello everyone!
Does anybody know if it is possible to export a material including nodes from Blender and use it in Unity afterwards?
Also, I would like to know if it is possible to export compositing nodes to Unity.

Many thanks in advance,
Shu

You can use neither Blender materials nor compositing in Unity.

The closest thing you will possibly get in Unity for nodes is Shader Forge or the sort of outdated Strumpty’s Shader editor for shader customization. However when it comes to post processing you will need Unity Pro to get anything like those features in Blender.

Thank you very much for your answers, m9105826 and Beardbotnik!

@Beardbotnik:
Yes, Shader Forge is not bad. I use it, but I like Blender’s node system better. I don’t know why, but Shader Forge is somewhat confusing to me. Also, when I build objects for Unity in Blender, I sometimes try setting up a whole scene (including materials). After exporting, I have to set up the whole thing again in Unity.
Oh and I do actually use Unity Pro. But I have not seen anything for post processing. Can this be found in Unity’s UI? Or is this something that has to be programmed? If it has to be programmed, do you think it’s better to use assets from the asset store? Because if it’s more complex, I don’t really want to write thousands of lines just for one effect.

https://www.assetstore.unity3d.com/#/content/3842
and https://www.assetstore.unity3d.com/#/content/935
would be examples of assets from the asset store.

If programming those effects would not be much time consuming and if it is possible using UnityScript, I’d rather want to have the complete control over how an effect looks like and program it myself.

Post Processing is basically shaders that manipulate rendered frame data, you can get those on the Unity store, but if you are familiar with shader writing at all it shouldnt be too hard to make ones you want. I imagine Unity also comes with some pre-packaged ones as well. You just apply the post processing shader to the camera I believe.

I guess Shader Forge nodes can seem confusing at first, but they are nodes that use common language when it comes to real-time shaders and feaures of game engines, so they can be good to learn and the site for it has pretty good descriptions of the nodes.

The main thing though is that Blender works much different than Unity or any node based realtime shader editor as far as I can tell when it comes to node options and whatnot and Unity uses it’s shaderlab system which would make conversions a bit difficult.

Thank you very much, Beardbotnik!
This was very enlightening!

I guess, at first, I will use Shader Forge. Maybe I will take a look into the created shaders and learn from them.
Then, at some point, I may be able to program them myself.
Also, do you think using Shader Forge’s shaders on a camera will work?

I’m not totally sure how that would work. Personally I’m using Unity Free so I can’t really experiment with post processing effects and whatnot. I don’t think that Shader Forge shaders would generally work on a shader otherwise since they are surface shaders and camera don’t have geometry data. But that might be something to ask the guy that makes it, he seems to respond to people on the thread over on the Unity forums daily.

Alright, thank you very much! I will try to talk to the developer of Shader Forge. Maybe there is a way of doing this using Shader Forge’s shaders. :slight_smile:

I found that if you only use one shader per material in Blender the conversion to Unity works. But if you mix more than one shader it doesnt work, because Unity doesn’t even have this option (I think).

Many thanks for your answers, neondrop and Meat5000!

@neondrop:
This is very interesting! Maybe this can help at some point!

@Meat5000:
Very nice links! I will try using image effects in Unity directly!
When it comes to GLSL, though, it seems to be rather problematic.
At least

suggests using Cg for programming shaders in Unity:

However, use of raw GLSL is only recommended for testing, or when you know you will only target Mac OS X or OpenGL ES 2.0 compatible mobile devices.

.

Also, I have asked the developer of Shader Forge if it’s possible to use the shaders created by Shader Forge for post-processing. He told me it’s not the best idea and not optimized, but it seems to be possible when using a plane in front of the camera that accesses the scene data. Then, one can modify the data. Or at least that’s how I understood this.