Feral Heart

Help & Guidance => Game Help => Topic started by: Flamesparky on December 04, 2014, 12:24:46 pm

Title: Billboards help?
Post by: Flamesparky on December 04, 2014, 12:24:46 pm
Well, title says everything. I need billboard help. I want to make stars for my map, but when I try it always look like this:
(http://i61BannedImageSite/2wr402p.png)

What I did wrong? I typed this:
material BlueStar
{
   technique
   {
      pass
      {
         ambient 0.588235 0.588235 0.588235 1
         diffuse 0.588235 0.588235 0.588235 1
         specular 0 0 0 10 0

         texture_unit
         {
            texture BStar.png
         }
      }

   }
}

I tried whit .jpg to.
Please help!
Title: Re: Billboards help?
Post by: Redlinelies on December 04, 2014, 03:32:42 pm
Jpeg images(.jpg) doesn't really support or work with transparency that I believe you're looking for?

What you need to do is to make the images use something like .png format, make sure it has transparency before saving it, and then adding a code in the material file for alpha rejection.

Try some thing like:
alpha_rejection greater_equal 128

By adding it into the code like this:
Code: [Select]
material BlueStar
{
   technique
   {
      pass
      {
         ambient 0.588235 0.588235 0.588235 1
         diffuse 0.588235 0.588235 0.588235 1
         specular 0 0 0 10 0

alpha_rejection greater_equal 128

         texture_unit
         {
            texture BStar.png
         }
      }

   }
}

Now I usually don't diddle around with materials, but I believe it's what you're missing since grass and other stuff use this too. You might need to modify the value of the alpha rejection to suit your needs however, and make sure the source image actually has transparency in it.
Title: Re: Billboards help?
Post by: Flamesparky on December 04, 2014, 03:44:52 pm
Thx very much! Now it works!

<3
Title: Re: Billboards help?
Post by: Canon on December 04, 2014, 07:05:52 pm
I bet the stars looks awesome now when it works! ouo
Title: Re: Billboards help?
Post by: Flamesparky on December 04, 2014, 08:10:54 pm
Yes they does :)