Ignore:
Timestamp:
Mar 23, 2012 1:31:05 AM (12 years ago)
Author:
ldelgass
Message:

Some minor refactoring, also add some more fine grained config.h defines
(e.g. replace NV40 define with feature defines). Add tests for some required
OpenGL extensions (should always check for extensions or base version before
calling entry points from the extension). Also, clamp diffuse and specular
values on input and warn when they are out of range.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/shaders/vertex_std.cg

    r2852 r2877  
    2020    v2f OUT;
    2121
     22    // IN.Position is in eye coords
     23    float4 objPos = mul(modelViewInv, IN.Position);
     24    float4 eyePosObjSpace = mul(modelViewInv, float4(0,0,0,1));
     25
    2226    //clip space vertex position
    23     OUT.HPosition = mul(modelViewProjMatrix, mul(modelViewInv, IN.Position));
     27    //OUT.HPosition = mul(modelViewProjMatrix, mul(modelViewInv, IN.Position));
     28    OUT.HPosition = mul(modelViewProjMatrix, objPos);
    2429
    2530    //eye space texture coordinates
     
    2732
    2833    //world space eye position
    29     OUT.EyeVector = normalize(-IN.Position.xyz);
     34    //OUT.EyeVector = normalize(-IN.Position.xyz);
     35    OUT.EyeVector = normalize(eyePosObjSpace - objPos);
    3036
    3137    //world space light postion
    32     OUT.Light = normalize(float3(1,1,1)-IN.Position.xyz);
     38    //OUT.Light = normalize(float3(1,1,1)-IN.Position.xyz);
     39    OUT.Light = normalize(mul(modelViewInv, float4(1,1,1,1))-objPos);
    3340
    3441    return OUT;
Note: See TracChangeset for help on using the changeset viewer.