X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fprogrambuilder.cpp;h=829691b61c8fbd8929262fe8a5da6e6404e167ef;hp=195d410fe10f7971739e9ee03448f810dd7c8235;hb=437609f708f2918067ec64f6d02261d113b1cac0;hpb=4d27357dfe703c56ed4d6346690eeb64c2c703b7 diff --git a/source/programbuilder.cpp b/source/programbuilder.cpp index 195d410f..829691b6 100644 --- a/source/programbuilder.cpp +++ b/source/programbuilder.cpp @@ -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