Search Unity

Shader Editing problem - compiled shader in editor

Discussion in 'Shaders' started by snicholls, Apr 8, 2009.

  1. snicholls

    snicholls

    Joined:
    Mar 19, 2009
    Posts:
    229
    Ive been messing with shaders the past days, but I have run into the problem that when I save a shader and reopen it to edit it, I see the following... (or similar) this is not what I have put in.

    Code (csharp):
    1.     SubShader{
    2.         Pass{
    3.             Program "" {
    4. // Vertex combos: 1, instructions: 7 to 7
    5. // Fragment combos: 1, instructions: 2 to 2, texreads: 0 to 0
    6. SubProgram "opengl " {
    7. Keywords { }
    8. Bind "vertex", Vertex
    9. Bind "normal", Normal
    10. "!!ARBvp1.0
    11. # 7 instructions
    12. PARAM c[5] = { { 0.5 },
    13.         state.matrix.mvp };
    14. TEMP R0;
    15. DP4 R0.x, vertex.position, c[3];
    16. MAD result.color.xyz, vertex.normal, c[0].x, c[0].x;
    17. DP4 result.position.w, vertex.position, c[4];
    18. MOV result.position.z, R0.x;
    19. DP4 result.position.y, vertex.position, c[2];
    20. DP4 result.position.x, vertex.position, c[1];
    21. MOV result.fogcoord.x, R0;
    22. END
    23. # 7 instructions, 1 R-regs
    24. "
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Are you sure it changes your original shader file, and you're not just clicking on the "open compiled shader" button in the inspector?