~ubuntu-branches/ubuntu/lucid/meshlab/lucid

« back to all changes in this revision

Viewing changes to meshlab/src/meshlabplugins/render_splatpyramid/shaders/shader_point_projection.frag

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-10-08 16:40:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091008164041-0c2ealqv8b8uc20c
Tags: 1.2.2-1
* New upstream version
* Do not build filter_isoparametrization because liblevmar dependency
  is not (yet) in Debian
* Fix compilation with gcc-4.4, thanks to Jonathan Liu for the patch
  (closes: #539544)
* rules: Add compiler variables to the qmake call (for testing with new
  GCC versions)
* io_3ds.pro: Make LIBS and INCLUDEPATH point to Debian version of lib3ds
* io_epoch.pro: Make LIBS point to Debian version of libbz2
* control:
  - Move Homepage URL to the source package section
  - Update to standards-version 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/// GLSL CODE
 
2
 
 
3
/// 1st Fragment Shader
 
4
 
 
5
// Projects points to screen space and rotates normal
 
6
// stores output on texture
 
7
#extension GL_ARB_draw_buffers : enable
 
8
 
 
9
uniform float scale;
 
10
uniform vec2 canvas_size;
 
11
 
 
12
varying vec3 normal_vec;
 
13
varying vec3 radius_depth_w;
 
14
varying float dist_to_eye;
 
15
 
 
16
//varying vec2 pos;
 
17
 
 
18
void main(void)
 
19
 
20
  if (radius_depth_w.x <= 0.0)
 
21
    discard;
 
22
 
 
23
  float proj_radius = radius_depth_w.x * scale / dist_to_eye;
 
24
  float depth_interval = proj_radius;
 
25
 
 
26
  vec2 screen_pos = (vec2(gl_FragCoord.xy) - vec2(0.5)) / canvas_size.xy;
 
27
  
 
28
  //vec2 screen_pos = pos;
 
29
 
 
30
  // First buffer  : normal.x, normal.y, normal.z, radius
 
31
  // Second buffer : minimum depth, depth interval, center.x, center.y
 
32
  // Third buffer  : color
 
33
  //  gl_FragData[0] = vec4 (normal_vec, radius_depth_w.x / radius_depth_w.z );
 
34
  gl_FragData[0] = vec4 (normal_vec, proj_radius );
 
35
  gl_FragData[1] = vec4 (radius_depth_w.y, 2.0*depth_interval, screen_pos);
 
36
}