summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-01-23 22:34:38 -0800
committerKenneth Graunke <kenneth@whitecape.org>2011-01-26 21:22:46 -0800
commit174a165b7b13627b09bac206363f1fe18aaaf2ca (patch)
tree80964b4a743e559394b8dd160463b803616b2a30
parentb2a30c5914b51b47ff7b5e75dd4c61060b7666d7 (diff)
phong: Rename "sampler" to "environment".
We're gonna have another sampler in a moment.
-rwxr-xr-xsrc/phong.frag4
-rwxr-xr-xsrc/scene.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/phong.frag b/src/phong.frag
index 2e773e1..82da128 100755
--- a/src/phong.frag
+++ b/src/phong.frag
@@ -1,5 +1,5 @@
#version 120
-uniform samplerCube sampler;
+uniform samplerCube environment;
varying vec3 normal_ws;
varying vec3 eye_direction_ws;
@@ -63,7 +63,7 @@ void main(void)
float F = schlick(n, v);
- vec4 envir = textureCube(sampler, reflect(normalize(eye_direction_ws), normal_ws));
+ vec4 envir = textureCube(environment, reflect(normalize(eye_direction_ws), normal_ws));
vec4 light = step(0.0, dot(n, l)) * vec4(diff + vec3(spec), 1.0);
gl_FragColor = mix(light, envir, F);
diff --git a/src/scene.cpp b/src/scene.cpp
index be5586f..95b2353 100755
--- a/src/scene.cpp
+++ b/src/scene.cpp
@@ -110,7 +110,7 @@ static GLint phong_mvp_location;
static GLint phong_mv_location;
static GLint phong_m_location;
static GLint phong_s_location;
-static GLint phong_sampler_location;
+static GLint phong_environment_location;
static GLint phong_eye_location;
static GLint phong_light_location;
@@ -169,7 +169,7 @@ Render(const GLUvec4 &look_at, bool occluders_only)
glUniformMatrix4fv(phong_mvp_location, 1, false, (float *) &mvp);
glUniformMatrix4fv(phong_mv_location, 1, false, (float *) &mv);
glUniformMatrix4fv(phong_m_location, 1, false, (float *) &m);
- glUniform1i(phong_sampler_location, 0);
+ glUniform1i(phong_environment_location, 0);
glUniform4fv(phong_eye_location, 1, eye.values);
GLUvec4 light_pos_es = view * light;
@@ -300,7 +300,7 @@ setup_shader()
phong_eye_location = glGetUniformLocation(phong_prog, "eye");
phong_light_location = glGetUniformLocation(phong_prog, "light_pos_es");
phong_s_location = glGetUniformLocation(phong_prog, "s");
- phong_sampler_location = glGetUniformLocation(phong_prog, "sampler");
+ phong_environment_location = glGetUniformLocation(phong_prog, "environment");
if (!load_and_compile_program_code("shadow", shadow_prog,
"normal", 1, // FIXME!