Example #1
0
/**********************************************************************
 * GLSLToonShaderHalo:
 *
 *   Does 1D Toon shading in GLSL.
 **********************************************************************/
GLSLToonShaderHalo::GLSLToonShaderHalo(Patch* p) :
   GLSLShader(p, new VertNormStripCB)
{
   set_tex(GtexUtil::toon_name(
      Config::get_var_str("HALO_TEX","halo_white2.png")
      ));
}
Example #2
0
BinaryImageShader::BinaryImageShader(Patch* p) : GLSLShader(p), 
	_binary_threshold(0.8)
{
   set_tex(GtexUtil::toon_name(
      Config::get_var_str("BINARY_IMAGE_FILENAME","warm_spec2_512_2d.png")
      ));
}
Example #3
0
/**********************************************************************
 * GLSLXToonShader:
 *
 *   Does X-Toon shader in GLSL.
 **********************************************************************/
GLSLXToonShader::GLSLXToonShader(Patch* p) :
   GLSLShader(p, new XToonStripCB),
   _layer_name("Shader"),
   _use_paper(0),
   _travel_paper(0),
   _transparent(1),
   _annotate(1),
   _color(COLOR::white),
   _alpha(1.0),
   _light_index(-1),
   _light_dir(1),
   _light_cam(1),
   _light_coords(mlib::Wvec(0,0,1)),
   _detail_map(1),
   _target_length(0.03),
   _max_factor(6.968),
   _normals_smoothed(false),
   _normals_elliptic(false),
   _normals_spheric(false),
   _normals_cylindric(false),
   _smooth_factor(0.5),
   _update_curvatures(false),
   _frame_rate(0.0),
   _nb_stat_frames(0),
   _invert_detail(false),       
   _update_uniforms(true),      
   _tex_is_good(false),
   _smoothNormal(1),           
   _smoothDetail(1)             
{
   _tex_name = "nprdata/toon_textures/contrast2_512_2d.png";
   set_tex(_tex_name);
}
Example #4
0
GLSLToonShader::GLSLToonShader(Patch* p) : GLSLShader(p)
{
   set_tex(Config::get_var_str(
              "GLSL_TOON_FILENAME",
              GtexUtil::toon_name("clear-black.png")
              ));
}
/**********************************************************************
 * GLSLPerlinTest:
 *
 *   Does 1D Toon shading in GLSL.
 **********************************************************************/
GLSLPerlinTest::GLSLPerlinTest(Patch* p) :
   GLSLShader(p, new VertNormStripCB)
{
   set_tex(toon_name(
      Config::get_var_str("GLSL_TOON_FILENAME","clear-black.png")
      ));
}
Example #6
0
void 
BinaryImageShader::set_tex(Cstr_ptr& filename)
{
   // Set the name of the texture to use
   if (_tex) {
      _tex->set_texture(filename);
   } else {
      set_tex(new TEXTUREgl(filename));
      assert(_tex);
   }
}
Example #7
0
void 
GLSLToonShader::set_tex(const string& filename)
{
   // Set the name of the texture to use
   if (_tex) {
      _tex->set_texture(filename);
   } else {
      CTEXTUREglptr tex = make_shared<TEXTUREgl>(filename);
      assert(tex);
      set_tex(tex);
   }
}
Example #8
0
BasecoatShader::BasecoatShader(Patch* p) :
   ToneShader(p),
   _basecoat_mode(0),
   _color_offset(0.3),
   _color_steepness(0.5),
   _light_separation(0)
{
   set_tex(Config::get_var_str(
              "BASECOAT_SHADER_FILENAME",
              GtexUtil::toon_name("clear-black.png")
              ));

   set_draw_sils(Config::get_var_bool("BASECOAT_IMG_DRAW_SILS",false));

   _layer[0]._is_enabled = false;
   _base_color[0] = Color::green1;
   _base_color[1] = Color::green2;
}