Light.BlitTransformed(x, y, 600, 600, 50, 50, 0.0, Tinted(Rgba(1.0, 1.0, 1.0, 1.0)), 1.0);
Light.BlitTransformed(200, 200, 200, 200, 50, 50, 0.0, Tinted(Rgba(0.5, 1.0, 0.5, 1.0)), 1.0);
Blenders::Set(GL_SRC_ALPHA_SATURATE, GL_SRC_COLOR);
Map[MAPID]->Draw();
Blenders::Set(GL_SRC_COLOR, GL_SRC_COLOR);
Bmp->Blit(SCREEN_W/2, SCREEN_H/2, 1.0);
Blenders::Set(ALPHA_BLENDER);
I'm using OpenLayer, but my problem lies within OpenGL blenders.
As you can see, the "character" is fully lit, while there is no "light" nearby. Is there any specific blender combination that would make the bitmap fade when outside a light source's range?
Light.BlitTransformed(x, y, 600, 600, 50, 50, 0.0, Tinted(Rgba(1.0, 1.0, 1.0, 1.0)), 1.0);Light.BlitTransformed(200, 200, 200, 200, 50, 50, 0.0, Tinted(Rgba(0.5, 1.0, 0.5, 1.0)), 1.0);Blenders::Set(GL_SRC_ALPHA_SATURATE, GL_SRC_COLOR); Map[MAPID]->Draw();Blenders::Set(GL_DST_COLOR, GL_ONE); Bmp->Blit(SCREEN_W/2, SCREEN_H/2, 1.0);Blenders::Set(ALPHA_BLENDER);
It did help... a little, but it's still not what I've been hoping for.
The image fades when outside of a light radius, but when it's inside, it becomes translucent.
BTW, I've tried all of them, nothing seems to be working. Halfway translucent image is the best I can get.
Quote:Original post by CursedTyrant
BTW, I've tried all of them, nothing seems to be working. Halfway translucent image is the best I can get.
What kind of texture you are using for that ? Does it have alpha layer ?
Quote:Original post by CursedTyrant
Bmp = new Bitmap("data/players/0.png", "data/players/0a.png")
0a.png is the alpha mask.
Ok I am not familiar with openLayer, but why you need 2 images ? The alpha of png can be saved within the first image. Anyway if you are loading them right, try to check that the images and especially alpha image has correct alpha mask.
I am loading them right, and they do have a correct alpha mask. If I don't use blenders, the image looks fine.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement