So I'm new here (to unity3d) and was reading up a little on the shaders. Now as far as I understand is that the HLSL and Cg are the same thing, co-developed by Microsoft and nVidia? The only difference being that Cg can be compiled for DirectX and OpenGl where HLSL can only compile for Microsofts DirectX api. I hope someone can help me out a bit here so i can understand it a bit more, If this was/is to be true almost any HLSL shader could be compiled as CG shader as well? This also means that many of the free on the net HLSL shaders should be able to be used with Unity3d? Hope someone can shed some light on this for me.
According to Aras (Unity's lead graphics programmer) HLSL is identical to Cg for most purposes - he explains the matter in this thread.
Yes, the language itself is the same for all practical purposes. However, that does not mean you can take any random shader from the internet drop it into Unity and expect it to work. Any shader is bound to work only if shader "interfaces" with the underlying engine/technology the way the underlying engine expects it to. For example, built-in matrices have to have proper names or semantics, and so on.