Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Particle Editor Command Question

Author
Message
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 6th Feb 2020 09:06
Hello guys,

Can please some explain to me how can I delete sub positions correctly through the command: "gpup_deleteSubPosition( ID, pos )" ? What that the position variable mean? How is it applied?

I have this code:



How can I delete those effects?

Thank you very much!
www.alexmatei.com
GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 6th Feb 2020 21:49
The addSubPosition command will return you the ID of the added sub-position, you need to keep track of them.
pos1 = addSubPosition( ID of effect, x1, y1, z1)
pos2 = addSubPosition( ID of effect, x2, y2, z2)
Then you can delete each with gpup_deleteSubPosition( ID of effect, ID of sub-position )
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 7th Feb 2020 09:13
Hello GaborD,

Thank you for responding. This is really useful. Thank you!

But, if I want to increment the sub position, can I do:



?

I tried this and it didn't worked, and it is a manual burst emitter with the command:
www.alexmatei.com
GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 7th Feb 2020 09:46
If you just want to emit one burst at each bullet impact point when the bullet hits the object, you can reposition the entire effect to each hit with gpup_setGlobalPivot( effectID, x, y, z ), then burst and then move it again when the next bullet hits (just make sure there was a particle update between the moves).
Moving it with gpup_setGlobalPivot ensures that already emitted particles don't move with the effect and will continue on their original path.

Using subpositions would trigger all currently set subpositions for the effect when using the burst (because subpositions are implemented in the particle object shader and are just virtual offsets in order to ensure they all use own correct noise and vector field positions in the calcs as if they were emitted at the main origin without needing to add more data into the data textures). So that's a bad fit for this kind of effect.
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 7th Feb 2020 18:20
Yes, that is a good solution indeed, but the only problem is that when using global pivot, the already active smoke from hole number one, while animating, it spawns right next to the next bullet hole. In bullet holes, there are multiple and individual smoke particles.
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 8th Feb 2020 22:41
any ideas?
www.alexmatei.com
GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 9th Feb 2020 07:51 Edited at: 9th Feb 2020 07:52
Depends on a lot of things. How many simultaniously smoking bullet holes will you have? Do they emit smoke for long periods of time? How long o the smoke particles live?
You could set up 2 or 3 emitters and re-pivot in a cycling manner, that means you can easily have active smoke in 5 or 6 positions simultaniously including the already emitted still lingering smoke. (even more if you juggle positions and don't emit at each position on every update)
The particle counts will be fairly low, so it shouldn't be an issue to update several effects with small data textures.
A simpler solution could be added to the system in the next update, but it would have some limitations (vector fields and noise not being localized to each sub-position) unless we want to expand the data textures and store more information for each particle, which could have a negative effect on the performance of all effects.
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 9th Feb 2020 11:43
Alright, so, the only obvious way I can do, is to set the life span of the particle, much lower, so the user cannot see the particle actual teleporting to different positions.
www.alexmatei.com

Login to post a reply

Server time is: 2024-03-29 14:21:44
Your offset time is: 2024-03-29 14:21:44