source: trunk/packages/vizservers/nanovis/shaders/pointsvp.cg @ 3611

Last change on this file since 3611 was 2857, checked in by ldelgass, 12 years ago

Remove vr3d library - texture classes were redundant. Remove last vestiges of
opencv usage in code and remove from configure - replaced by imgLoaders library
functions.

File size: 1.6 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
3void main(in float4 posin : POSITION,
4          in float4 colin : COLOR0,
5          out float psize : PSIZE,
6          out float4 posout : POSITION,
7          out float4 colout : COLOR0,
8          uniform float atten,
9          /*uniform sampler2D normal,*/
10          uniform float4 posoffset,
11          uniform float4 basepos,
12          uniform float4 scale,         
13          uniform float4x4 modelview,
14          uniform float4x4 projection)
15{
16    float4 vec, homeye, eye;
17    vec.xyz = posin.xyz;
18    vec.w = 1.0;
19    homeye = mul(modelview, vec);
20    posout = mul(projection, homeye);
21
22    float4 p = mul(modelview, vec);
23    //psize = scale.x   *(p.w / -p.z) * 10;
24
25    //psize = 5 * scale.x;
26    //psize = 2 * p.w / -p.z;
27    //colout = float4(colin.xyz,0.1);
28
29    //  float tmp = posin.w * rsqrt(dot(eye.xyz, eye.xyz));
30    //  psize = scale.x * max(tmp, 1.0);
31    psize = 10 * p.w / -p.z;
32
33    colout = float4(colin.xyz, colin.w * 0.25);
34    /*
35      float4 vec, homeye, eye;
36      float tmp;
37
38      vec.xyz = posin.xyz;//(posin.xyz + posoffset.www) * basepos.www + basepos.xyz;
39      vec.w = 1.0;
40
41      homeye = mul(modelview, vec);
42      posout = mul(projection, homeye);
43
44      //eye = homeye / homeye.w;
45
46      //tmp = posin.w * basepos.w * scale.w * rsqrt(atten * dot(eye.xyz, eye.xyz));
47
48      //psize = scale.x * max(tmp, 1.0);
49      //tmp = min(tmp, 1.0);
50      //colout = colin;
51      //tmp = colin.w * scale.z * tmp * tmp;
52      //colout.w = max(tmp, 4.0/256);
53
54      psize = 5.0;
55
56      colout = float4(0.0, 0.0, 1.0, 0.1);
57    */ 
58}
Note: See TracBrowser for help on using the repository browser.