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 / [SOLVED] How to set 3D particles to 2D game in the AGK-Particle Editor into AGK Studio ?

Author
Message
AmarJSB
4
Years of Service
User Offline
Joined: 11th Feb 2020
Location:
Posted: 17th Feb 2020 06:17
I made a 2D game and wanted to insert the particles that I made in AGK-Particle Editor into AppGameKit Studio.

I tried some guide code in the DLC AppGameKit folder particle editor but the particle that I put in my game code didn't appear when the game was run

is there an easy code example that I can learn to insert particles in the AppGameKit particle editor into AppGameKit Studio for 2D games?

The author of this post has marked a post as an answer.

Go to answer

GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 18th Feb 2020 06:56 Edited at: 18th Feb 2020 06:56
This post has been marked by the post author as the answer.
Here is a simple approach that uses SetViewOffset for scrolling and places the 3D particle effects at the correct positions using an ortho cam.
Supports 2 layers of particle effects (front and between sprite layers)
You just need to change it to use your own effects and images.
Scroll with A/D, or whatever your default is for GetJoystickX.



It's admittedly very crude and simple, but I hope it helps to point you in the right direction.
I will work on a better 2D integration soon.
AmarJSB
4
Years of Service
User Offline
Joined: 11th Feb 2020
Location:
Posted: 18th Feb 2020 07:23
wow thanks for helping me, i will try this code after at home later
AmarJSB
4
Years of Service
User Offline
Joined: 11th Feb 2020
Location:
Posted: 24th Feb 2020 06:41
@GaborD
can 3D particles in AppGameKit particle editor be installed to 2D sprites?
for example when the sprite is running then the particles also follow the sprite without moving the camera.
psychoanima
5
Years of Service
User Offline
Joined: 19th Jun 2018
Location:
Posted: 24th Feb 2020 21:13
Quote: "can 3D particles in AppGameKit particle editor be installed to 2D sprites?
for example when the sprite is running then the particles also follow the sprite without moving the camera."


I am so much waiting for this option
GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 24th Feb 2020 22:09
I see two different ways to approach it, each serving a different purpose.
a) Rendering an individual effect into a rendertex, then using that as texture on sprites. This would move the entire effect with a moving sprite, including the emitted particles, so it wouldn't be good for things like smoke trails or such.
b) Allowing to define the effect position based on 2D screen position and then rendering all the effects set to 2Dmode into a fullscreen layer. Would need some tinkering like taking the global Spriteoffset/Screenoffset into account, but it's certainly doable.
Not sure which of the two most people would prefer. I don't work in 2D in AppGameKit, so you guys should have the decision what you want/prefer/need.
JosephB
17
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 24th Feb 2020 23:32
GaborD,

Quote: "a) Rendering an individual effect into a rendertex, then using that as texture on sprites. This would move the entire effect with a moving sprite, including the emitted particles, so it wouldn't be good for things like smoke trails or such.
b) Allowing to define the effect position based on 2D screen position and then rendering all the effects set to 2Dmode into a fullscreen layer. Would need some tinkering like taking the global Spriteoffset/Screenoffset into account, but it's certainly doable."


Could option a) be used on a smaller invisible sprite, with the rendertex, that was at some offset of the displayed sprite work for something like a smoke trail?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 24th Feb 2020 23:46
A sprite shader would be faster and have the same effect
im sure there would be one here that does what you are after
but may need some modifying to suit the glsl version agk uses
http://glslsandbox.com/

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
psychoanima
5
Years of Service
User Offline
Joined: 19th Jun 2018
Location:
Posted: 25th Feb 2020 01:22
Quote: "a) Rendering an individual effect into a rendertex, then using that as texture on sprites. This would move the entire effect with a moving sprite, including the emitted particles, so it wouldn't be good for things like smoke trails or such.
b) Allowing to define the effect position based on 2D screen position and then rendering all the effects set to 2Dmode into a fullscreen layer. Would need some tinkering like taking the global Spriteoffset/Screenoffset into account, but it's certainly doable."



a) will this cause performance drop because you have to re-render sprites?


b) should this work for both percentage-based system and virtual resolution?

GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 25th Feb 2020 01:44
Quote: "a) will this cause performance drop because you have to re-render sprites?

b) should this work for both percentage-based system and virtual resolution?"


If the effect is on screen you have to render it anyway, don't think rendering it to a texture and then displaying it on a sprite would have much impact. (obviously, you need to render the sprite, but that's as simple&fast as it gets shader wise)
I will have to test it though, we will see.
Could use it for speedup if you reuse the same tex for several identical copies on screen.
Would also make it possible to create some interesting effects by taking the rendered particle FX and adding additional effects in the sprite shader (distortion, localized animated tinting, CA, etc).

Yes the texture version would work in a percentage based setup, because you are just making animated sprite textures. Doesn't change the sprite handling itself.
psychoanima
5
Years of Service
User Offline
Joined: 19th Jun 2018
Location:
Posted: 25th Feb 2020 18:54
Quote: "Could use it for speedup if you reuse the same tex for several identical copies on screen.
Would also make it possible to create some interesting effects by taking the rendered particle FX and adding additional effects in the sprite shader"


this already sounds lovely
AmarJSB
4
Years of Service
User Offline
Joined: 11th Feb 2020
Location:
Posted: 2nd Mar 2020 02:14
Quote: "this already sounds lovely "

Yeah

Login to post a reply

Server time is: 2024-04-26 03:26:16
Your offset time is: 2024-04-26 03:26:16