Product Chat / Question about existing GG 'particle' generator (or is Ravey still around?)

Author
Message
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Apr 2018 17:26 Edited at: 28th Apr 2018 18:00
The particles use the decal_basic.fx one but the animation is done in the CPU. In another thread I posted some links relating to what this shader needs to do to improve the look of the particle effect but I'm not sure how hard that would be to implement.
(this link: https://forum.game-guru.com/outbound?url=https%3A%2F%2Fsoftware.intel.com%2Fen-us%2Farticles%2Fa-more-accurate-volumetric-particle-rendering-method-using-the-pixel-shader

Actual decal entities use either the decal_animate4 or decal_animate8 shader depending on how many frames they have. These shaders do the animation frame bit themselves depending on the 'Time' variable which from what I can gather will be the same value for all enties on each shader pass.

To make each decal calculate a different frame we would need to pass in a 'tweak' value to the shaders which could be added to the Time value, each decal entity could then have the 'tweak' value set to a random amount from 0 to 63, this only needs to happen once, the animate4 shader can simply divide the tweak value by 4 (i.e. 16 frames rather than 64 frames).

I'm just not sure where in the code I would need to put it to make it visible to the shader!

(for completeness here is the other link from the other thread: http://developer.download.nvidia.com/assets/cuda/files/smokeParticles.pdf)

One thing I'm unclear about is the difference between a vertex shader and a pixel shader, I think the decal_basic.fx shader is a vertex shader but the links above talk about pixel shaders. Does this mean we need two separate shaders?

Another thing I'm wondering about, having read up on shaders a bit, is whether we could use a 'compute' shader to offload the updating of particles to the GPU(s) and whether that would improve things performance wise, or enable more particles and/or more advanced techniques to be employed.
Been there, done that, got all the T-Shirts!
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 28th Apr 2018 18:52
Might have to give Preben a PM. He seems to know where the shader code is.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 2nd May 2018 10:18
Hey all, been away for a bit, just shifted state

Just wanted to chime in with regard to the fire - it definitely looks better without the flame decal, much more convincing.

I have a Hot Camp Fire model in the store - it's not PBR - but I recon it would look great with that emitter effect you have going there AmenMoses. I be happy to give it to you to try if you want. Just PM me if you be interested, and I will give you a coupon thingy for it.

Impressive work....

Reliquia....
aka OldFlak
Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd May 2018 20:21
Here is an image I'm using for inspiration, screen shot from Nephise Ascension which is Tonguc Bodur's latest walking sim.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 8th May 2018 17:04 Edited at: 8th May 2018 17:07
I would love more additions to the particle stuff. I've been recently playing around with what we can already do and having a bit of fun with it:



Would love more options and variations
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 8th May 2018 18:40
@Teabone-now I really like that
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: SegAutoWelder, Entity+Weapon Welder, FPEtoBAT, DBO2X
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 8th May 2018 19:27
I really wish Lee would give us some idea of what he has planned for particles, i.e. keep it CPU based, move to purely GPU, or a combination? Is someone working on shaders for particle effects already or is he planning on hard coding them? Modular system maybe?

I can fiddle around with the existing stuff and add more commands but I'd rather replace the whole lot with something way more powerful and flexible, for example if someone could supply a dds or png image with 64 'frames' (like the snow flakes) with each 'frame' being an image of a bullet hole (so 64 variations on a theme) or a blood splatter or even scratch marks, I could easily add a system to display a random frame at a bullet collision point for example.

The real gold plated solution would be to have the modular system whereby the particle math is encapsulated in a compute shader, the basic rendering in a vertex shader (in which case we could even have 3d models as 'particles') and the 'special effects' like additive blending in a pixel shader.

That way you can mix and match shaders to get the effect you want, lightning, snow, smoke, flames, laser beams, rain, fog, sparks, fireworks, anything you're imagination can come up with in fact, all done with the same few Lua commands. All you would do is set the emitter characteristics and select the appropriate shaders to use, then in real time simply issue Lua commands to change the shader variables to control the effects.

Depending on the capabilities of the GPU(s) available at run time you could have a few hundred particles or a few million so the game would basically always look the best it can on the system it is running on. (and also by shifting the entire burden away from the CPU should also free up valuable CPU time for things like AI)

From what I've read in my big pile of new books DX11 is perfectly capable of doing all this, just need to jump through a few hoops and sacrifice a few virgins and stuff like that.



Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 9th May 2018 05:38 Edited at: 9th May 2018 05:41
I agree with all of the above. Especially if there is a method to keep performance up with lots of particles on screen.

In regards to bulletholes, its been a big topic lately among many of the game developers using Game Guru lately. Here is the atlas from FPSCx10. (i have the original DDS too. I believe its the same as the FPSCx9 one).



Not sure how they worked in FPSCx9 and FPSCx10, if they worked on anything other than segments. Like static entities or not. Its been a while since i fired up either.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 9th May 2018 21:37
Well put it this way, running a particles demo, in a web browser, on my machine I can easily handle a million particles without the beast breaking a sweat! (That is obviously *only* rendering particles in a very simple 3d scene and I think it was Vulkan based rather than DXnn but it demonstrates that the hardware is capable)

Been there, done that, got all the T-Shirts!
PM
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 10th May 2018 01:02
When a ship hits light speed. You see these colorful lights. They make the ship appear as it was going a billion mph. That's what I been trying to do! Do we have particles for that? How does that work?
Jim C
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th May 2018 07:48 Edited at: 10th May 2018 08:12
You can do that with simple decals and a decent fx shader.

In my asteroids demo thingy I simply created a bunch of asteroid decals and had them randomly appear in front of the player then travel past the player at a rate equal to the forward velocity of the ship. I had about 100 different decals and by randomly scaling and rotating them it gave the effect I was looking for without being obvious that they are simply flat images. The tricky part is making sure they are all rotated correctly to the camera and that the player can't fly straight through them (which would ruin the effect).

Do something similar and add an fx shader to colour shift the images and you could get the effect you are looking for.

Here's the asteroids thingy I'm referring to, video doesn't really do it justice though as only half the frames are captured:

Been there, done that, got all the T-Shirts!
PM
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 11th May 2018 04:01
That looks really good. I want the strips of light look. Would I need a script for light speed to be triggered? Say, added to a vehicle script? I want to trigger it by pressing a key on my keyboard. And how do I add an fx shader to colour shift the images? I'm lost. I have to research this a little more.
Jim C

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th May 2018 09:39
I'm learning about shaders myself but it is a bit of a dark art.

Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-05-04 18:20:46
Your offset time is: 2024-05-04 18:20:46