source: nanovis/tags/1.1.1/shaders/renderparticle.cg @ 4833

Last change on this file since 4833 was 2852, checked in by ldelgass, 12 years ago

Fix up line endings and formatting in shader code, also add emacs magic line
to get C++ mode highlighting

File size: 1004 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
3/*
4void main(in float4 posin : POSITION,
5          in float4 colin : COLOR0,
6          out float psize : PSIZE,
7          out float4 posout : POSITION,
8          out float4 colout : COLOR0,
9          uniform float atten,
10          //uniform sampler2D normal,
11          uniform float4 posoffset,
12          uniform float4 basepos,
13          uniform float4 scale,
14          uniform float4x4 modelview,
15          uniform float4x4 projection)
16{
17    float4 vec, homeye, eye;
18    vec.xyz = posin.xyz;
19    vec.w = 1.0;
20    homeye = mul(modelview, vec);
21    posout = mul(projection, homeye);
22
23    float4 p = mul(modelview, vec);
24    //psize = scale.x   *(p.w / -p.z) * 10;
25
26    //psize = 5 * scale.x;
27    //psize = 2 * p.w / -p.z;
28    //colout = float4(colin.xyz,0.1);
29
30    float tmp = posin.w * rsqrt(dot(eye.xyz, eye.xyz));
31    psize = scale.x * max(tmp, 1.0);
32    psize = 10 * p.w / -p.z;
33
34    colout = float4(colin.xyz, colin.w * 0.25);
35}
36*/
Note: See TracBrowser for help on using the repository browser.