Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DeleD blending methods

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Development
View previous topic :: View next topic  
Author Message
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Tue Mar 09, 2010 10:19 pm    Post subject: DeleD blending methods Reply with quote

Hey guys

I noticed that the blending methods used by DeleD ignore the alpha values a texture could have (TGA). I have modified the code a bit, so that the alpha channel is used when it's available. The only mode that completely ignores alpha is "replace".

Here are the blend modes as they are now (from left ro right: replace, add, modulate, alpha blending)



Here are the modes as I have them in mind:



The new "add" and "modulate" are more "alpha aware" than the old ones. Smile

Note: The second picture from the left (add mode) doesn't really look different, but it IS still different.
In the old version, parts of the image that are black appear transparent. However the alpha channel is completely ignored.
In the new version parts of the image that have either zero alpha or are black, appear transparent.

What do you think?
Back to top
View user's profile Send private message
AWM Mars
Member


Joined: 06 Jan 2010
Posts: 1195
Location: Wilts England

PostPosted: Tue Mar 09, 2010 11:14 pm    Post subject: Reply with quote

It does give clarity to what those do Smile

With the alpha blend mode, can I use any texture with a black background in the first layer (on its own), asign it as a alpha blend mode and therefore create say tree billboards?
_________________
Politeness is priceless when received, cost nothing to own or give, yet some cannot afford.

Checkout:
http://www.awm.mars.yourinside.com/
http://www.bccservices.co.uk
http://www.localtradecheck.co.uk
Back to top
View user's profile Send private message Visit poster's website
trucker2000
DeleD PRO user


Joined: 11 May 2005
Posts: 1839
Location: Sacramento, California

PostPosted: Wed Mar 10, 2010 3:54 am    Post subject: Reply with quote

AWM, Yes.

Chrono. Now that's the way the images Should look. Great work there.
_________________
Some day I will grow up and be a real modeler.
"Never give up! Never surrender!!"
Sys specs:
asus
8 gigs ram
Invidia gtx560 video card
Windows 8 (worst op sys Ever)
Back to top
View user's profile Send private message Visit poster's website
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Wed Mar 10, 2010 7:15 am    Post subject: Reply with quote

That looks very nice indeed! Smile
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Wed Mar 10, 2010 10:36 am    Post subject: Reply with quote

AWM Mars wrote:
It does give clarity to what those do Smile

With the alpha blend mode, can I use any texture with a black background in the first layer (on its own), asign it as a alpha blend mode and therefore create say tree billboards?


Well, you should make the black part transparent in photoshop by adding an extra CHANNEL. Save it as TGA and put it in the texture directory. Then you can use alpha-blend.
You could use add blending with images without transparency, but then your leaves would look very bright.

I'll give a short explanation of the different blend-modes now. Smile
This explanation is for single-layered materials.

- Inactive: I don't know about this one. It says "no blending", but it doesn't sound usefull to me. Just don't use this one.
- Replace: The default blend mode. It replaces the colors of the pixels with the new colors of the object. It ignores alpha.
- Add: The color value's of the object that is rendered is "added" to the existing color in the viewport. Add mode often results in very bright and (partially) transparent images. They are suitable for effects like fire, explosions, magical effects etc..
- Modulate: The color of the object is multiplied with the color existing in the viewport. This normally makes things a bit darker but still transparent. Use for dark clouds and stuff..
- Alpha blend: This shows the normal texture, but takes the alpha channel into account. Use this one when you just want to render textures with transparent parts in it.

As for your tree billboards, I'd use Alpha blending with a texture that has an alpha channel. Smile

DeleD doesn't have a "subtract" blend mode, which might also be very suitable for dark cloudy effects. Maybe we should add it.
We could also add "modulate2x". I think it does the same as modulate, but the result is less dark. I'm still unsure what parameters i need to achieve the latter one though.


Last edited by chronozphere on Wed Mar 10, 2010 12:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
AWM Mars
Member


Joined: 06 Jan 2010
Posts: 1195
Location: Wilts England

PostPosted: Wed Mar 10, 2010 11:10 am    Post subject: Reply with quote

I'm no artist, I'm self taught as far as modelling goes.. I understand the terminology of your very useful explaination, but when you said 'add another layer, and black is transparent, in photoshop.. that's where the mind block came lol. The last time I set any alphas, was in a GIF and I used a eye dropper to select colours I wanted to be alpha. Laughing I think the Titanic was about to sail then..... Rolling Eyes
_________________
Politeness is priceless when received, cost nothing to own or give, yet some cannot afford.

Checkout:
http://www.awm.mars.yourinside.com/
http://www.bccservices.co.uk
http://www.localtradecheck.co.uk
Back to top
View user's profile Send private message Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Wed Mar 10, 2010 12:23 pm    Post subject: Reply with quote

Sorry.. For TGA you have to add another channel.. not a layer. Smile

Let's say you add a fourth channel and view it, then black is completely transparent while white is opaque (If i'm not mistaking). You can just paint in the fourth layer and finally save it as a 32bit TGA (24 bit TGA's dont have alpha).

Note that the transparency in a TGA is very different from transparency in a GIF. GIF uses a so called color-key. This is a user-defined color that represents the transparent parts of the image. TGA works differently. It has an entire channel for alpha (every pixel has a 0-255 alpha value). This way you can make pixels partially transparent, while this is not possible with GIF.
Back to top
View user's profile Send private message
AWM Mars
Member


Joined: 06 Jan 2010
Posts: 1195
Location: Wilts England

PostPosted: Sat Mar 13, 2010 4:44 pm    Post subject: Reply with quote

Ahh thats where ya got me. I do have Photoshop, but prefer Fireworks. I know my way round that programme blind fold, however I have not seen, or used, a channel function. Layers, yes.

One method I was shown, to extract the foreground (in this case a tree) from the background, put that onto a solid black background. Copy and paste that to another layer above, then invert the tree so its totally black, and the background is now white. Save as a PNG 32bit (native format to Fireworks) and it should give a alpha channel.

Anyone used the background eraser from PaintShop Pro V8 I think it came out? What an excellent tool, you simply used a fat brush, making sure you covered the area between the bit you wanted, and the bit you didn't. The 'brush' would have a very good guess (95% right) which was which.

I sometimes make my own textures. Most times, I have a list of quality sources. Laughing
_________________
Politeness is priceless when received, cost nothing to own or give, yet some cannot afford.

Checkout:
http://www.awm.mars.yourinside.com/
http://www.bccservices.co.uk
http://www.localtradecheck.co.uk
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum