About Store Forum Documentation Contact



Post Reply 
Moon image: alpha channel
Author Message
Ezequel Offline
Member

Post: #1
Moon image: alpha channel
Hi,

I want to put a custom moon image in my project, but when I convert it from .psd or .png into .gfx file using converter from the SDK, the alpha channel is not working. When I open the PNG image, the alpha is fine there. Also in the SDK data browser my image looks good with the alpha channel working.

I tried several settings in converter, like DXT3, 2D texture, mip maps enabled. This results in an image which is visible in game, but the alpha channel is not working in game: there is whitespace over it.

When I use the standard moon.gfx file provided with the engine SDK/tutorials, the alpha from that image works fine...

Any ideas on how to make this work? Thanks in advance.
07-29-2012 10:50 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Moon image: alpha channel
can you attach the source image and GFX file, and code that you're using
also check for astronomical properties in c++ (like 'blend' param)
08-02-2012 02:11 PM
Find all posts by this user Quote this message in a reply
Ezequel Offline
Member

Post: #3
RE: Moon image: alpha channel
Here is the code:

Code:
{
      Astro &moon=Astros.New();  
      moon.image=Images("gfx/sky/moon.gfx");
      moon.pos =!Vec(-1.8,1,1.5);
      moon.size*=1.0f;
      moon.blend=false;
      moon.image_color.set(50,50,50,0);
      moon.light_color.zero();
   }

If I enable moon.blend the moon will not show.
The image and GFX file are in the attachment:

.rar  moon.rar (Size: 364.57 KB / Downloads: 5)
08-02-2012 03:14 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Moon image: alpha channel
did you try setting alpha
moon.image_color.set(50,50,50,0);
to
moon.image_color.set(50,50,50,255);
08-11-2012 12:54 PM
Find all posts by this user Quote this message in a reply
Ezequel Offline
Member

Post: #5
RE: Moon image: alpha channel
Yes, I tried 255 as value for the alpha. However, it doesn't solve the problem.

I guess the problem lies by the conversion settings in converter of the .png image to .gfx, because the alpha works fine on the .png image itself. I will create another moon image, test it and post an update here.

Thanks you for the reply.
08-12-2012 08:12 PM
Find all posts by this user Quote this message in a reply
Ezequel Offline
Member

Post: #6
RE: Moon image: alpha channel
Update:
I made a new image and firstly got the same result.
But because the standard moon from the SDK worked fine, I tried working with alternative presets in photoshop. So instead of a transparent background, I made the background layer black, and converted the .psd file to .gfx (instead of exporting as .png first). The problem is solved now smile
08-13-2012 06:01 PM
Find all posts by this user Quote this message in a reply
Post Reply