]> git.tdb.fi Git - libs/gl.git/commitdiff
Consistently use the same spelling for diffuse_map and normal_map
authorMikko Rasa <tdb@tdb.fi>
Sun, 11 Sep 2016 10:36:04 +0000 (13:36 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 11 Sep 2016 10:37:12 +0000 (13:37 +0300)
It appears that spelling them as two separate words is more correct than
a compound word.

demos/desertpillars.cpp
demos/shaders.cpp
source/programbuilder.cpp
source/programbuilder.h
source/text.cpp

index be197828a6ed97c53326e9449867d233010af956..2f141898ee027e63ec5f247221beba267f253298 100644 (file)
@@ -577,7 +577,7 @@ void DesertPillars::create_ground()
        features.lighting = true;
        features.shadow = true;
        features.texture = true;
-       features.normalmap = true;
+       features.normal_map = true;
        features.custom = ground_variables;
        GL::ProgramBuilder(features).add_shaders(ground_shprog);
        ground_shprog.bind_attribute(7, "ground_type");
index 6b7336fe6c50307f28459add241df02eaa844c43..88ad06daa2a3d6c68ed513801cf189d23d85dbe2 100644 (file)
@@ -71,7 +71,7 @@ int main()
                feat.material = i/4>0;
                feat.texture = i/4>1;
                feat.lighting = i%4>0;
-               feat.normalmap = i%4>1;
+               feat.normal_map = i%4>1;
                feat.specular = i%4>2;
                programs.push_back(new GL::Program(feat));
        }
index 195d410fe10f7971739e9ee03448f810dd7c8235..829691b61c8fbd8929262fe8a5da6e6404e167ef 100644 (file)
@@ -106,8 +106,8 @@ const ProgramBuilder::VariableDefinition ProgramBuilder::standard_variables[] =
        { FRAGMENT, "n_zzz_light_dir[i]", "vec3", "normalize(zzz_light_dir[i])", 0 },
        { FRAGMENT, "n_tbn_normal", "vec3", "normal_sample*2.0-1.0", "n" },
        { FRAGMENT, "n_eye_normal", "vec3", "normalize(eye_normal)", "!n" },
-       { FRAGMENT, "normal_sample", "vec3", "texture2D(normalmap, texture_coord).xyz", 0 },
-       { FRAGMENT, "diffuse_sample", "vec4", "texture2D(diffusemap, texture_coord)", 0 },
+       { FRAGMENT, "normal_sample", "vec3", "texture2D(normal_map, texture_coord).xyz", 0 },
+       { FRAGMENT, "diffuse_sample", "vec4", "texture2D(diffuse_map, texture_coord)", 0 },
 
        { VERTEX, "gl_Position", "vec4", "projection_matrix*eye_vertex", 0 },
        { VERTEX, "gl_ClipDistance[i]", "float", "dot(eye_vertex, clip_planes[i].equation)", "c" },
@@ -133,10 +133,10 @@ const ProgramBuilder::VariableDefinition ProgramBuilder::standard_variables[] =
        { ATTRIBUTE, "tangent", "vec3", 0, 0 },
        { ATTRIBUTE, "binormal", "vec3", 0, 0 },
 
-       { UNIFORM, "diffusemap", "sampler2D", 0, 0 },
+       { UNIFORM, "diffuse_map", "sampler2D", 0, 0 },
        { UNIFORM, "shadow", "sampler2DShadow", 0, 0 },
        { UNIFORM, "ShadowMap::shadow_darkness", "float", 0, 0 },
-       { UNIFORM, "normalmap", "sampler2D", 0, 0 },
+       { UNIFORM, "normal_map", "sampler2D", 0, 0 },
        { UNIFORM, "environment", "samplerCube", 0, 0 },
        { UNIFORM, "EnvMap::env_eye_matrix", "mat3", 0, 0 },
        { UNIFORM, "Material::reflectivity", "float", 0, 0 },
@@ -391,10 +391,10 @@ void ProgramBuilder::add_shaders(Program &prog) const
                        prog.bind_attribute(NORMAL3, "normal");
                else if(features.material)
                        prog.bind_attribute(COLOR4_FLOAT, "color");
-               if(features.texture || features.normalmap)
+               if(features.texture || features.normal_map)
                        prog.bind_attribute(TEXCOORD4, "texcoord");
        }
-       if(features.normalmap)
+       if(features.normal_map)
        {
                prog.bind_attribute(get_component_type(TANGENT3), "tangent");
                prog.bind_attribute(get_component_type(BINORMAL3), "binormal");
@@ -758,7 +758,7 @@ ProgramBuilder::StandardFeatures::StandardFeatures():
        skylight(false),
        fog(false),
        specular(false),
-       normalmap(false),
+       normal_map(false),
        shadow(false),
        reflection(false),
        clipping(false),
@@ -784,7 +784,7 @@ string ProgramBuilder::StandardFeatures::create_flags() const
                        flags += 'y';
                if(specular)
                        flags += 'p';
-               if(normalmap)
+               if(normal_map)
                        flags += 'n';
        }
        if(fog)
@@ -1132,12 +1132,15 @@ ProgramBuilder::StandardFeatures::Loader::Loader(StandardFeatures &f):
        add("material",  &StandardFeatures::material);
        add("max_clip_planes", &StandardFeatures::max_clip_planes);
        add("max_lights", &StandardFeatures::max_lights);
-       add("normalmap", &StandardFeatures::normalmap);
+       add("normal_map", &StandardFeatures::normal_map);
        add("reflection", &StandardFeatures::reflection);
        add("shadow",    &StandardFeatures::shadow);
        add("skylight",  &StandardFeatures::skylight);
        add("specular",  &StandardFeatures::specular);
        add("texture",   &StandardFeatures::texture);
+
+       // Deprecated
+       add("normalmap", &StandardFeatures::normal_map);
 }
 
 } // namespace GL
index e61e9942c0a343083f5d876baaa819befac61b44..f2046e458f7e81c650dcd73de36f2fe4b59fa8a7 100644 (file)
@@ -88,7 +88,7 @@ public:
                bool specular;
 
                /** Use a normal map texture.  Only used if lighting is true. */
-               bool normalmap;
+               bool normal_map;
 
                /** Use a shadow map.  Requires a ShadowMap effect or equivalent in the
                pipeline. */
index 85647a83980b9fbc0bdf45514460859a8c98a6f2..cb39a695dcb6095d931cf68564c52115ad03e445 100644 (file)
@@ -23,7 +23,7 @@ void Text::set_technique(const Technique *tech)
        if(tech)
        {
                technique = *tech;
-               technique.replace_texture("diffusemap", font.get_texture());
+               technique.replace_texture("diffuse_map", font.get_texture());
                object.set_technique(&technique);
        }
        else