This file is indexed.

/usr/share/gazebo-9/media/materials/programs/point_receiver_fp.glsl is in gazebo9-common 9.0.0+dfsg5-3ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
uniform vec3 derived_light_diffuse_color;
uniform vec4 derived_light_specular_color;
uniform float surface_shininess;
uniform vec4 light_position_view_space;
uniform vec4 light_attenuation;
uniform sampler2D diffuse_map;

varying vec3 vertex_world_view_pos;
varying vec3 vertex_world_norm;

void main()
{
  float specular = 0.0;

  // Normalized fragment normal
  vec3 norm = normalize(vertex_world_norm);

  // Direction from the fragment to the light 
  vec3 lightDirView = light_position_view_space.xyz - vertex_world_view_pos.xyz * light_position_view_space.w;

  // light_position_view_space.w == 0 for directional lights
  float lightDist = length(lightDirView);
  lightDirView = normalize(lightDirView);

  float lambertTerm = max( dot(norm, lightDirView), 0.0 );

  //////////////////////////////////////////////////////////////////////////////
  // COMPUTE DIFFUSE CONTRIBUTION
  vec4 diffuse_tex = texture2D(diffuse_map, gl_TexCoord[0].st);
  vec4 diffuse_contrib = vec4(derived_light_diffuse_color * diffuse_tex.rgb * 
                             lambertTerm,1.0);


  //////////////////////////////////////////////////////////////////////////////
  // COMPUTE SPOT AND SPECULAR COMPONENTS
  if (lambertTerm > 0.0 && lightDist <= light_attenuation.x) 
  {
    vec3 view = -normalize(vertex_world_view_pos.xyz);
    vec3 halfway = normalize( view + lightDirView );
    float nDotH = dot(norm, halfway);

    float fAtten = 1.0 / (light_attenuation.y + 
                          light_attenuation.z*lightDist + 
                          light_attenuation.w*lightDist*lightDist);    

    // Works for all light types
    specular = pow(clamp(nDotH, 0.0, 1.0), surface_shininess) * fAtten;
  }

  vec4 specular_contrib = specular * derived_light_specular_color;

  gl_FragColor = (diffuse_contrib + specular_contrib);
}