/usr/share/celestia/shaders/specular.vp is in celestia-common 1.6.1+dfsg-3.
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | !!VP1.0
# Compute specular and diffuse light from a single source
# c[0]..c[3] contains the concatenation of the modelview and projection matrices.
# c[4]..c[7] contains the inverse transpose of the modelview
# c[15] contains the eye position in object space
# c[16] contains the light direction in object space
# c[17] contains H, the normalized sum of the eye and light direction
# c[20] contains the object color * light color
# c[32] contains the ambient light color
# c[33] contains the haze color
# c[34] contains the specular color * light color
# c[40] contains (0, 1, 0, specPower)
# v[OPOS] contains the per-vertex position
# v[NRML] contains the per-vertex normal
# v[TEX0] contains the per-vertex texture coordinate 0
# o[HPOS] output register for homogeneous position
# o[TEX0] output register for texture coordinate 0
# o[COL0] output register for primary color
# R0...R11 temporary registers
# Transform the vertex by the modelview matrix
DP4 R1.x, c[0], v[OPOS];
DP4 R1.y, c[1], v[OPOS];
DP4 R1.z, c[2], v[OPOS];
DP4 R1.w, c[3], v[OPOS];
# Compute the diffuse light component
DP3 R2, v[NRML], c[16];
# Clamp the diffuse component to zero
MAX R2.x, R2, c[40].xxxx;
# Get the vector from the eye to the vertex
ADD R4, c[15], -v[OPOS];
# Normalize it
DP3 R0.w, R4, R4;
RSQ R0.w, R0.w;
MUL R4.xyz, R4, R0.w;
# Haze
DP3 R2.y, v[NRML], R4;
ADD R2.y, c[40].y, -R2.y;
MUL o[FOGC].x, R2.x, R2.y;
# Compute the half angle vector for specular lighting
ADD R7, R4, c[16];
DP3 R0.w, R7, R7;
RSQ R0.w, R0.w;
MUL R7, R0.w, R7;
# Calculate the specular reflection
MOV R6.x, R2.x;
# DP3 R6.y, c[17], v[NRML];
DP3 R6.y, R7, v[NRML];
MAX R6.y, R6, c[40].x;
MOV R6.w, c[40].w;
# Output the texture
MOV o[TEX0], v[TEX0];
MOV o[TEX1], v[TEX1];
# Output the primary color
MOV R0, c[32];
MAD o[COL0], c[20], R2.xxxx, R0;
# Compute and output the secondary color
LIT R0, R6;
MUL R0.z, R0.z, R2.x;
MUL o[COL1], c[34], R0.zzzz;
# Output the vertex
MOV o[HPOS], R1;
END
|