Team colors

Team colors

Postby Skorpio » 07 Nov 2010, 15:28

So, I managed to colorize the orc by using his alpha channel, but there's still a problem: the texture becomes shadeless. I have no idea why that happens, so I probably have to ask for help in the OGRE forum.

Here's the script:
{l Code}: {l Select All Code}
material Orc
{
   receive_shadows on
   technique
   {
      pass
      {   
         ambient 0.00000 0.00000 0.00000 1.000000
         diffuse 0.640000 0.640000 0.640000 1.000000
         specular 0.049000 0.049000 0.049000 1.000000 62.250000
         emissive 0.000000 0.000000 0.000000 1.000000
         texture_unit
         {
            texture Orc.tga
            tex_address_mode wrap
            filtering trilinear
            colour_op_ex blend_texture_alpha src_texture src_manual 0 1 0
         }
      }
   }
}
material Orc/TWOSIDE
{
   receive_shadows on
   technique
   {
      pass
      {
         ambient 0.00000 0.00000 0.00000 1.000000
         diffuse 0.640000 0.640000 0.640000 1.000000
         specular 0.049000 0.049000 0.049000 1.000000 62.250000
         emissive 0.000000 0.000000 0.000000 1.000000
         cull_hardware none
         cull_software none
         texture_unit
         {
            texture Orc.tga
            tex_address_mode wrap
            filtering trilinear
         }
      }
   }
}
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Team colors

Postby andrewbuck » 07 Nov 2010, 17:06

That is an interesting approach. It looks like you are basically setting the base color of the object and then anywhere the alpha value is low the "inside" will show through to the surface. I realized the other method of changing the color pixel by pixel was probably a bad way to do it but I wasn't aware of other ways to do the same thing. I hope you can get this working as this seems like a better system.

-Buck
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Who is online

Users browsing this forum: No registered users and 1 guest