The tile blending effect
by Hugeone · in Torque Game Builder · 10/20/2005 (4:48 am) · 8 replies
In the game, we need some resources, that I want to make it through blending effect.
I have two origin picture, following as:
Sea Tile:
Grass Tile:

I want to use the mask to blending the two tiles. The mask follow as:

The result follow as:

Using the T2D engine , how to do it ?
Anybody can tell me , Thanks.
I have two origin picture, following as:
Sea Tile:
Grass Tile:
I want to use the mask to blending the two tiles. The mask follow as:

The result follow as:

Using the T2D engine , how to do it ?
Anybody can tell me , Thanks.
#2
What you said is that I can find the solution in the OpenGL reabook. lol
I will consult the relative book in the next time. If you have time to do it, please post your method in here. I will know it quickly. Thanks a lot.
10/22/2005 (8:46 am)
@MatthewWhat you said is that I can find the solution in the OpenGL reabook. lol
I will consult the relative book in the next time. If you have time to do it, please post your method in here. I will know it quickly. Thanks a lot.
#3
10/22/2005 (1:49 pm)
Perhaps use anti-grain to prerender.
#4
@Huge- instead of having a separate mask image, why not create 2 separate tiles for the sea, one with no alpha channel and one with a stepped alpha channel that goes to 0 alpha. (transparent). Then simply layer the sea w/ alpha channel over the grass tile - et voila exactly what you have for "The result follow as". You wouldn't even need to set blending modes.
If you want to do it with a mask, and I think it may be possible to do it with T2D blending modes, play around with T2D Blending Demo. I played with it a while using your images and could not achieve the affect, but did get close. This shows your images overlapping sprites with various blend effects applied:

Always fun to mess around with blending modes :-)
10/22/2005 (8:46 pm)
I wouldn't start hacking OpenGL code, but that's just me... I'd rather spend my time scripting and making art...@Huge- instead of having a separate mask image, why not create 2 separate tiles for the sea, one with no alpha channel and one with a stepped alpha channel that goes to 0 alpha. (transparent). Then simply layer the sea w/ alpha channel over the grass tile - et voila exactly what you have for "The result follow as". You wouldn't even need to set blending modes.
If you want to do it with a mask, and I think it may be possible to do it with T2D blending modes, play around with T2D Blending Demo. I played with it a while using your images and could not achieve the affect, but did get close. This shows your images overlapping sprites with various blend effects applied:

Always fun to mess around with blending modes :-)
#5
Hi, thank you give me a reply.
You offer to me a method "why not create 2 separate tiles for the sea, one with no alpha channel and one with a stepped alpha channel that goes to 0 alpha. (transparent) ... ", I want to know how to edit the tile source image, please give me two sample images. lol
You can use my sample image and to edit the sample image, thanks a lot.
On the other hands, I also play around the " T2D Blending Demo", but I cannot find a blending method that can show the blend effect.
10/23/2005 (1:30 am)
@AlexHi, thank you give me a reply.
You offer to me a method "why not create 2 separate tiles for the sea, one with no alpha channel and one with a stepped alpha channel that goes to 0 alpha. (transparent) ... ", I want to know how to edit the tile source image, please give me two sample images. lol
You can use my sample image and to edit the sample image, thanks a lot.
On the other hands, I also play around the " T2D Blending Demo", but I cannot find a blending method that can show the blend effect.
#6
10/23/2005 (9:17 am)
How to edit it, depends completely on what graphics app you are using. For the sea make it like this image you already made, except use a transparent background instead of the grass image.
#7
10/23/2005 (9:17 am)
And use a format that supports alpha channel (e.g. not jpg)
#8
1 source tile_sea.jpg destination mask.bmp
LayerMode: ZERO ONE_MINUS_SRC_COLOR
2 clip the blending effect file and save as a new file:step1.png;
3 source tile_grass.jpg destination mask.bmp
LayerMode: ZERO SRC_COLOR
4 clip the blending effect file and save as a new file:step2.png;
5 source step1.png destination step2.png
LayerMode: ONE ONE
6 the final effect
10/23/2005 (6:46 pm)
The steps:1 source tile_sea.jpg destination mask.bmp
LayerMode: ZERO ONE_MINUS_SRC_COLOR
2 clip the blending effect file and save as a new file:step1.png;
3 source tile_grass.jpg destination mask.bmp
LayerMode: ZERO SRC_COLOR
4 clip the blending effect file and save as a new file:step2.png;
5 source step1.png destination step2.png
LayerMode: ONE ONE
6 the final effect
Torque Owner Matthew "Ashteth" Kee
Default Studio Name
What you are attempting to do appears to be somewhat proprietary to your game so it probably isn't reasonable to assume that the engine should be able to achieve this exact effect. If you wait long enough, someone (myself or someone else) will provide a T2D stencil mask object which you should be able to adapt to your purpose, but as the saying goes: "if you want it now, you'll have to build it yourself" :) The OpenGL redbook would be a good place to start.