Can we create black particles?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Can we create black particles?

Post by MrChoke »

After over a month off from modding, I am back in the saddle.

I am having trouble using black in any particle-based object. A fireball for example. I can modify the two flame textures and the particle colors to anything I want, except black. It is an issue of course since the texture background color is black. But even setting the "color0" values for the particles to (0, 0, 0) seems to if anything make them invisible it seems. I did try changing "blendMode" from Additive to Translucent. Black starts showing then but it also creates awful blockiness which is not good.

Any ideas or is black the no-no color?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Can we create black particles?

Post by minmay »

Additive blend mode adds the RGB values to the ones already on screen. For black, these values are 0, so nothing will happen with black pixels. Additive blending cannot create any amount of black, it will always lighten the colours behind it, or leave them the same.
Translucent blend mode uses alpha blending.
If you look at the flame particle textures, you'll see that their backgrounds are black, and every pixel has full alpha. This is because they are designed for additive blending, where black pixels will be completely transparent. If you want to use alpha blending, you need to make an image with a transparent background, not a black one. (Any decent image editor will have a "colour to alpha" function). The results are never going to look like additive blending unless the texture is completely white, since the blend modes are fundamentally different.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: Can we create black particles?

Post by MrChoke »

Thanks Minmay. That works.
Post Reply