1 registered members (TipmyPip),
18,606
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
bmap_blitpart + transparency (UNSOLVED)
#425591
07/09/13 00:10
07/09/13 00:10
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
//skin is the BTMAP of the terrain blendMap
...
VECTOR* pos = terrain_pixel_for_pos(terrain,x,y,skin);
var dx = 64 / PIXEL_DX(terrain,skin);
bmap_blitpart(skin,brush_1, //tga with transparence
vector(pos->x-dx,pos->y-dx,0),
vector(2*dx,2*dx,0),
NULL,NULL);
I'm using the function above, for Append the contents tga in another picture! The problem is that I'm not managing to remove the background of the image that is being annexed. LOOK: PS:I am saving the image as tga with transparency, but no work Someone would know me know where I am going wrong?
Last edited by NeoNeper; 07/11/13 13:56.
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: bmap_blitpart + transparency
[Re: Superku]
#425613
07/09/13 11:36
07/09/13 11:36
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
Complicated (T.T). I thought that using this feature (bmap_blitpart), I would be able to implement different types of brushes in painting of the a blandMAP. I currently use (terrain_setpixel), for paint a blendMAP of the terrain Mult Texture. I'm trying to implement the types of brushes, and for this reason I tried to use the function (bmap_blitpart).If i solved this problem with transparency, it would be a perfect technique and simple!
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: bmap_blitpart + transparency
[Re: NeoNeper]
#425625
07/09/13 13:32
07/09/13 13:32
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
yeah, that would be nice, but it still is pretty slow (done on cpu) and has wrong filtering when scaling images...
POTATO-MAN saves the day! - Random
|
|
|
Re: bmap_blitpart + transparency
[Re: Kartoffel]
#425631
07/09/13 13:57
07/09/13 13:57
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
for small application, as is the case with my editor that I've been working on my own game is a good solution. I observed no delay at runtime. The only drawback that prevents me from using it is the lack of transparency.  How else could I work to achieve this same goal? anyone have an idea?
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: bmap_blitpart + transparency
[Re: Superku]
#425639
07/09/13 15:03
07/09/13 15:03
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
LOl. Nothing. (^.^).
Could you explain better how to work with target_map in this case?. I can not understand how to apply here!.
As the option to Shader! I believe it really is possible. I have great difficulty in working with shaders and not do the least idea where to start.
If you can show me some material practical for adapt, I would be grateful
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: bmap_blitpart + transparency
[Re: Superku]
#425667
07/09/13 21:49
07/09/13 21:49
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
I tried several ways but I am not succeeding!. Seeing that no success trying to paint the blend Map using another patern figure, i decided paint, used pixel by pixel of the blendMap from coordinate of my mouse. For Brush Size and Circle form i I made the following function.
var format = bmap_lock(skin,0);
var i,j;
for(j=0; j<skin->height; j++)
for(i=0; i<skin->width; i++)
{
// read the pixel from the texture
var pixel = pixel_for_bmap(skin,i,j);
COLOR* csrc = pixel_to_vec(NULL,NULL,format,pixel);
vec_normalize(csrc,255);
if(vec_dist(terrain_pixel_to_pos(terrain,i,j,skin),_vec(TARGET.x,TARGET.y,0)) < 100)
{
csrc->red = 0;
csrc->green = 255;
csrc->blue = 255;
pixel = pixel_for_vec(csrc,100,format);
pixel_to_bmap(skin,i,j,pixel);
}
}
bmap_unlock(skin);
{
this way I can paint map from the coordenada of my mouse, utilizando a fixed size and circular shape for painting. COOOL, But this function does not work well. She is too Slow because need read the entire map pixel by pixel to determine who need to be painted Someone has a formula that works quickly?
Last edited by NeoNeper; 07/09/13 21:50.
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
|