Hello everyone, I'm with a small issue, easy to solve, but I'm looking for a more user friendly way to solve... I'm made a pixelated and warp shader to port a game from constuct to unity, there any way to mix these two shaders os I just can do that with a multpass shader?
Shaders are made of instructions. Mixing will involve combining instructions. However, mixing is not a defined term, so the question is unanswerable for now, in a way that will be useful to you.
Can you mix two shaders in a single material? No-t really in that sense. As Jessy said you can write a shader that uses shared cg instruction library (see UnityCG.cginc for example). You can use different "shader" functions for every pass and use shader blending to "mix" the resulting colors: http://docs.unity3d.com/Manual/SL-Blend.html DX11.1 has some nice features; exacly what you need, right? But these nice XOR features will not work on pre-DX11.1 graphic cards. The only way to do this is to rewrite and "merge" both shader functionality in one pass (shader program - dummy.shader). See vertex and fragment shader examples at http://docs.unity3d.com/Manual/SL-VertexFragmentShaderExamples.html. Further reading: https://cgcookie.com/unity/cgc-courses/noob-to-pro-shader-writing-for-unity-4-beginner/ http://en.wikibooks.org/wiki/Cg_Programming/Unity