Jump to content

Blend modes for particles


shadmar
 Share

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

  • Upvote 2

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

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?)

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  • 2 weeks later...

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"

Link to comment
Share on other sites

  • 2 weeks later...
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

 

ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3

Link to comment
Share on other sites

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

  • Upvote 5

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...