cannot solve this error : "Both vertex and fragment programs must be present in a CGPROGRAM"

some error with the shader in attached files, Unity version is 5.4.2p3

errors(2):

  1. Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
  2. Both vertex and fragment programs must be present in a CGPROGRAM. Excluding it from compilation.

3424576–270373–C5-SimpleShader.shader (358 Bytes)

Define #pragma target 2.0 at least, below your other pragmas.

Also you should have a Fallback, like:
Fallback “Unlit/Color”

Place it before the last curly brace on the whole script.

2 Likes

try again and it still didn’t work :frowning:

Errors(1):

  1. Both vertex and fragment programs must be present in a CGPROGRAM. Excluding it from compilation.

it seems that the unity shader compiler cannot find the “vert” and “frag” function , but idk why

3425352–270459–C5_SimpleShader.shader (509 Bytes)

You need to remove the spaces betwen # and pragma. it has to be “#pragma”. So right now the compiler doesn’t know which methods are vert and frag.

1 Like

You saved my life !:smile::stuck_out_tongue:

1 Like