How can I use a HLSL code in a shader

How can I use a HLSL code in a shader ? What do I need to do it.

There is already documentation on this.

i Saw that and i was hoping for a visual look at how it uses the code simler to this one

Pass {
      // ... the usual pass state setup ...

      CGPROGRAM
      // compilation directives for this snippet, e.g.:
      #pragma vertex vert
      #pragma fragment frag

      // the Cg code itself

      ENDCG
      // ... the rest of pass setup ...
  }

whin it says “//the Cg code itself” do i copy and past the hole Cg code there or what?

Read further through the documentation. There are examples.

Open the compiled shaders. They are examples.

Also, copy/pasting HLSL code from a non-Unity HLSL shader straight in probably won’t do a lot. You need to set it up to be integrated with Unity’s lighting system - which you can probably work out from studying various shaders posted on these forums and the Unify Community Shader Wiki.

ok thank you