Changeset 1263 for trunk


Ignore:
Timestamp:
Apr 21, 2012, 9:45:02 PM (8 years ago)
Author:
sam
Message:

orbital: fix syntax errors in the HLSL shader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/mesh.h

    r1262 r1263  
    1919    {
    2020        m_vert_cursor = m_vert.Count();
     21        ComputeQuadNormals(m_quadidx_cursor,
     22                           m_quadidx.Count() - m_quadidx_cursor);
    2123        m_quadidx_cursor = m_quadidx.Count();
     24        ComputeTriNormals(m_triidx_cursor,
     25                          m_triidx.Count() - m_triidx_cursor);
    2226        m_triidx_cursor = m_triidx.Count();
    2327    }
     
    6468            "          out float4 out_Position : POSITION,"
    6569            "          out float4 pass_Color : COLOR) {"
    66             "    float4x4 Light = float4x4(10.0, 1.0, 1.0, 1.0);"
    67             "    float3x3 Kd = float3x3(1.0, 0.8, 0.8);"
    68             "    float3x3 Ld = float3x3(1.0, 0.8, 0.8);"
    69             ""
    70             "    float3x3 tnorm = normalize(mul(in_NormalMat, in_Normal));"
    71             "    float4x4 Eye = mul(in_ModelView, float4x4(in_Vertex, 1.0));"
    72             "    float3x3 s = normalize((Light - Eye).xyz);"
    73             ""
    74             "    pass_Color = float4x4(Ld * Kd * max(dot(s, tnorm), 0.0), 1.0);"
     70            "    float4 Light = float4(10.0, 1.0, 1.0, 1.0);"
     71            "    float3 Kd = float3(1.0, 0.8, 0.8);"
     72            "    float3 Ld = float3(1.0, 0.8, 0.8);"
     73            ""
     74            "    float3 tnorm = normalize(mul(in_NormalMat, in_Normal));"
     75            "    float4 Eye = mul(in_ModelView, float4(in_Vertex, 1.0));"
     76            "    float3 s = normalize((Light - Eye).xyz);"
     77            ""
     78            "    pass_Color = float4(Ld * Kd * max(dot(s, tnorm), 0.0), 1.0);"
    7579            "    out_Position = mul(in_Proj, Eye);"
    7680            "}",
Note: See TracChangeset for help on using the changeset viewer.