File: depthVSM.frag

package info (click to toggle)
meshlab 2022.02%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 47,348 kB
  • sloc: cpp: 536,635; ansic: 27,783; sh: 539; makefile: 36
file content (16 lines) | stat: -rw-r--r-- 315 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
varying vec4 point;

void main(void)
{
  float depth = point.z;// / point.w;
  depth = depth * 0.5 + 0.5;
  
  float moment1 = depth;
  float moment2 = depth * depth;

  float dx = dFdx(depth);
  float dy = dFdy(depth);
  moment2 += 0.25 * (dx * dx + dy * dy);

  gl_FragColor = vec4(moment1, moment2 , 0.0, 1.0);
}