Jump to content
shadmar

Blend modes for particles

Recommended Posts

I think perhaps we should have some more blend modes.

Doing a fire without additative alpha blendmodes like

SRC: GL_SRC_ALPHA
DST: GL_ONE

Isn't possible now I think to achive particle effects like this :

 

RnXuP.png

Share this post


Link to post

I've tried hacking around this using gl functions

 

    glEnable (GL_BLEND);
    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

 

But I couldn't make it work, seem like material->SetBlendMode(Blend::Alpha); is the only one it will react to for alpha blending.

 

They can look ok using alphablending if you use :

 

SetSortMode(true);
SetDepthTestMode(false);

 

But then again they will render on top of everything, so smoke beind a wall or something wouldn't work.

 

Particles seem almost useless in their current state with limited alpha blending (if I didn't miss something completely?)

Share this post


Link to post

I don't understand what is being asked here. There are modes for alpha blending and additive blending.

Share this post


Link to post

I think Rick means the following: The screenshot uses the default particle emitter. particles overlap each other.

post-45-0-93554100-1374181066.jpg

Share this post


Link to post

blendmode=1
depthtest=1
depthmask=0
zsort=1

 

does the trick for alpha, but how to set for additiative blending?

Share this post


Link to post

I see no depthmask/depthtest property in the material editor.

Share this post


Link to post

Here is the mat file I'm using. This still produces the issue.

 

//Leadwerks Material File

 

blendmode=1

castshadows=0

zsort=1

cullbackfaces=1

depthtest=1

depthmastk=0

diffuse=1.00000000,1.00000000,1.00000000,1.00000000

specular=1.00000000,1.00000000,1.00000000,0.000000000

lightingmode=1

 

shader="shaders\particles\default.shader"

texture0=".\default.tex"

Share this post


Link to post

yeah it's the new property don't you know! I'll correct when I get home and test. Why don't I see a property in the material editor for this?

Share this post


Link to post

Why don't you just make your particle image the way you want it and use the additive blend?

Share this post


Link to post

Nothing to see here, move on...All good. Would still like it exposed in the mat editor though.

Share this post


Link to post

Why don't you just make your particle image the way you want it and use the additive blend?

 

Ah, don't use alpha for additive.

 

got it... works.

 

le3padd.jpg

Share this post


Link to post
Just use some picture having alpha channel ?
Ah, don't use alpha for additive.

As I understand shad's phrase, you can't have transparency in your images for it to work. smile.png

Share this post


Link to post

For additive blended particles

  • fires,
  • explotions

Use a non alpha particle, black fades the particle:

 

padditive.png

 

Use mat file containing this (3=Light):

blendmode=3
depthtest=1
depthmask=0
zsort=1

 

 

 

 

For alpha blended particles

  • smoke,
  • clouds

use non additive blend just pure alpha to fade the particle (deafult particle is like this)

 

palpha.png

 

Use mat file containing this (1=alpha):

blendmode=1
depthtest=1
depthmask=0
zsort=1

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...