Tremulous Forum

Mods => Modding Center => Topic started by: PikaNoChu on September 22, 2013, 01:22:31 pm

Title: Particle Depth Sorting
Post by: PikaNoChu on September 22, 2013, 01:22:31 pm
I've been making some animated blood sprites for both teams.
This is my first encounter with the Trem particle system. I quite like it, but some things are eluding me.

For example, this gives me my alpha blended textures as the correct animation, but it bleeds through occluders.
Code: [Select]
      shader sync gfx/blood/greenblood03frame01.tga gfx/blood/greenblood03frame02.tga gfx/blood/greenblood03frame03.tga gfx/blood/greenblood03frame04.tga gfx/blood/greenblood03frame05.tga gfx/blood/greenblood03frame06.tga gfx/blood/greenblood03frame07.tga

Now I don't understand how I'm supposed to define the shaders, do I need to have a .shader file for each image?
Does the .particle refer to a .shader with the same name? Some .particle files refer to certain shaders without a filepath (eg. flame1), how does the engine know what it's supposed to get? Is it hardcoded in the source? The manual doesn't tell me anything about that.

For the depth reads/writes, do I need to do this explicitly in the shader, or is there some flag or limitation I need to know of?
Title: Re: Particle Depth Sorting
Post by: vcxzet on September 22, 2013, 02:09:11 pm
see
data-1.1.0.pk3/scripts/flame.shader
and
data-1.1.0.pk3/scripts/weapons.particle : "models/weapons/flamer/muzzlePS"

so use shaders instead of using the tgas directly
Title: Re: Particle Depth Sorting
Post by: /dev/humancontroller on September 22, 2013, 10:35:09 pm
it bleeds through occluders.
Code: [Select]
      shader sync gfx/blood/greenblood03frame01.tga
this is due to a long-standing Quake 3 / Tremulous bug (https://github.com/Unvanquished/Unvanquished/commit/3b7db9f9441bfa56081aa6bfa88ccbf4ace180f4).
Title: Re: Particle Depth Sorting
Post by: vcxzet on September 23, 2013, 05:53:09 am
Are you suggesting him to build his own client? or Is it just a shameless self plug.
Also, I think, it is a designed behavior that doesn't meet the desired behavior; not a bug.

Quote from: dhc
the proper solution would be to not use any implicit shaders, ie., to define new shaders and link them to images.
Title: Re: Particle Depth Sorting
Post by: PikaNoChu on September 23, 2013, 01:29:02 pm
This is weird, maybe I'm missing something. But I can change the shaders on every effect, except these, where the engine just seems oblivious to blendmodes etc -- with exception of requiring the filepath.  :human:
Title: Re: Particle Depth Sorting
Post by: vcxzet on September 23, 2013, 02:23:05 pm
can you post your .shader and .particle?
Title: Re: Particle Depth Sorting
Post by: /dev/humancontroller on September 23, 2013, 06:46:35 pm
Are you suggesting him to build his own client? or Is it just a shameless self plug.
neither.
Also, I think, it is a designed behavior that doesn't meet the desired behavior; not a bug.
no sufficiently reasonable coder would deem that behavior designed. (try to name an intended use case, and then think about how that case could be (intentionally) supported much better in general! you will end up showing that the said intended use case was supported retardedly at first.)
Title: Re: Particle Depth Sorting
Post by: vcxzet on September 23, 2013, 06:57:10 pm
neither.
Then why would you post that link?

sufficiently reasonable coder
you should work at id software

Quote from: dhc
the proper solution would be to not use any implicit shaders, ie., to define new shaders and link them to images.
Title: Re: Particle Depth Sorting
Post by: /dev/humancontroller on September 23, 2013, 09:56:21 pm
why would you post that link?
to get a combination of an enlightened mind and a shameless plug.
Title: Re: Particle Depth Sorting
Post by: PikaNoChu on September 29, 2013, 07:48:20 pm
Erh, issue solved, had some stray shader file I forgot of.
I don't suppose there's a way to get more than 20 frames? Playing around with the flamer effects a bit (though it's hard to improve upon).
Title: Re: Particle Depth Sorting
Post by: PikaNoChu on October 01, 2013, 12:07:00 am
Going slightly mental, is it possible to display the flame animation as a decal along with using bounceMark?
Title: Re: Particle Depth Sorting
Post by: PikaNoChu on October 10, 2013, 03:59:31 pm
[snip]
Title: Re: Particle Depth Sorting
Post by: PikaNoChu on October 10, 2013, 07:42:28 pm
What are the conditions for alpha fading to work?
I'm setting "alpha  0 1.0 0.0" to no effect, do I need to set a certain alphaGen in the shader?
Title: Re: Particle Depth Sorting
Post by: CreatureofHell on October 11, 2013, 12:56:29 am
QUADRAPOST! YEAHHHH!  8)
Title: Re: Particle Depth Sorting
Post by: your face on October 12, 2013, 02:03:29 am
that has not been done since...the ancient days.
Title: Re: Particle Depth Sorting
Post by: PikaNoChu on October 17, 2013, 03:31:33 pm
What's with the cynicism on these boards? I mean, I've seen some stuff on gaming forums, but seriously?
Guess I'll have to look elsewhere.

Anyway, here's the new stuff incase anyone wants to try
http://www.spiney.me/files/tremstuff/pikamedia01.pk3

I'm still stuck because the alpha fading being broken on some stuff for whatever reason.

Pics

(http://www.spiney.me/files/tremstuff/newcreep.jpg)

(http://www.spiney.me/files/tremstuff/newsmoke.jpg)

(http://www.spiney.me/files/tremstuff/newgoop.jpg)

(http://www.spiney.me/files/tremstuff/fancybuild.jpg)

Also new flamer, basigas, and some sounds.
Actually, I remember I need to fix the 1st person basi gassing... anyway, for next update.
Title: Re: Particle Depth Sorting
Post by: RAKninja-Decepticon on October 17, 2013, 07:13:29 pm
What's with the cynicism on these boards? I mean, I've seen some stuff on gaming forums, but seriously?


we feed off of hate.

anyway.... what exactly is different from default in your images?  jetpack and tube particles are the only things that really jump out at me.
Title: Re: Particle Depth Sorting
Post by: your face on October 19, 2013, 12:06:04 am
oh snap that looks boss. i like the new smoke effects
Title: Re: Particle Depth Sorting
Post by: vcxzet on October 20, 2013, 08:03:29 pm
what is the license?
Title: Re: Particle Depth Sorting
Post by: PikaNoChu on October 21, 2013, 03:45:36 pm
CC0 for the particles.

Sounds are here: https://github.com/enneract/cuboid/blob/master/assets/credits.txt
Title: Re: Particle Depth Sorting
Post by: ULTRA Random ViruS on October 27, 2013, 04:25:40 am
Now that I think about it, when  forked the master a few weeks ago, how come I got an ancient version, it seems that credits is actually up-to-date but mine wasn't?
https://github.com/ZdrytchX/cuboid/blob/master/assets/credits.txt