-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continuation of work on visual particles system #42248
Conversation
d9b48d1
to
5d7c715
Compare
8b3667e
to
78eae55
Compare
78eae55
to
7e325d4
Compare
|
c08cdbc
to
8857063
Compare
4c624d9
to
7b528a9
Compare
7b528a9
to
b94a059
Compare
b94a059
to
3c78ce1
Compare
3c78ce1
to
8f6aca0
Compare
8f6aca0
to
164a4a9
Compare
164a4a9
to
a8c5fb2
Compare
a0aa685
to
ae6b863
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't comment from a code perspective, but I did try out the PR and it already adds pretty good functionalities. It's solid work that will already bring Godot's particle shaders miles ahead in terms of accessibility! 👍
I tested this out locally and played around with it for a bit. The only odd thing I noticed was that |
d8de7f5
to
e16012d
Compare
@clayjohn I removed |
I managed to make scaling and rotation properly work with CurveTexture in Process, but this required an additional matrix to be attached to each particle to keep started transformation: The position is being redundant here - since it is inherited from the start function, and being modified by velocity. |
e16012d
to
d17f0dc
Compare
a0fbb7a
to
d49be6c
Compare
d49be6c
to
b4ab3e5
Compare
@reduz said that he would add new built-ins for user data to better performance so I've reverted the changes I made about introducing START_TRANSFORM to the particles renderer. This PR can be merged as it is as it mostly worked properly. |
I was not suggesting that you remove |
b4ab3e5
to
c85e1e4
Compare
Sorry, then I wrongly understood you (probably tired). Bring it back and fixed. |
c85e1e4
to
814b328
Compare
814b328
to
f632e36
Compare
Thanks! |
This is a continuation of my work to the particle system in visual shaders.
Added new shader modes:
Added nodes:
New Emit nodes:
class VisualShaderNodeParticleOutput :
VisualShaderNodeOutput
Description: Created automatically in all modes of particle shader.
Have different input ports (depending on the shader mode).
Availability: Everywhere
Common Input ports (on all shader modes):
vec3 velocity - an initial velocity vector, translates to VELOCITY
vec3 color - translates to COLOR.rgb
float alpha - translates to COLOR.a
Transform position - translates to TRANSFORM
float scale
bool active
Emit:
Emit (Custom):
Process:
Process (Custom):
End:
class VisualShaderNodeParticleEmitter :
VisualShaderNode
Description: Abstract base class for all emitters.
Availability: Emit
Output ports:
position
- position of the particle, need to be connected to theposition
input port insideVisualShaderNodeParticleOutput
.class VisualShaderNodeParticleBoxEmitter :
VisualShaderNodeParticleEmitter
Description: Generates a position inside a box.
Availability: Emit
Input ports:
extents
(default: vec3(1, 1, 1)) - Defines a volume of the box.Output ports:
class VisualShaderNodeParticleRingEmitter :
VisualShaderNodeParticleEmitter
Description: Generates a position inside a ring.
Availability: Emit
Input ports:
radius
(default:10) - A radius of the ring.inner
(default:0) - An inner volume size of the ring.outer
(default:0) - An outer volume size of the ring.Output ports:
class VisualShaderNodeParticleSphereEmitter :
VisualShaderNodeParticleEmitter
Description: Generates a position inside a sphere.
Availability: Emit
Input ports:
radius
(default:10) - A radius of the sphereuse_inner_space
(default:true
) - iffalse
the particles will generates on a sphere but not inside it.Output ports:
class VisualShaderNodeParticleTextureEmitter :
VisualShaderNodeParticleEmitter
Description: (I think @reduz should implement it himself since I'm not sure how to make it properly).
Availability: Emit
Input ports:
position
normal
Output ports:
class VisualShaderNodeParticleRandomness :
VisualShaderNodeParticleEmitter
Description: Generates a random scalar or a vector.
Availability: Everywhere
Properties: Op
Type - OP_TYPE_SCALAR / OP_TYPE_VECTOR which affect a type of result
Input ports:
min
(default: 0.0/vec3(-1, -1, -1)) - a minimum value to generatemax
(default: 1.0/vec3(1, 1, 1)) - a maximum value to generateOutput ports:
random
- a generated valueclass VisualShaderNodeParticleConeVelocity
Description: Generates a velocity normalized vector inside a cone.
Availability: Emit
Input ports:
direction
(default: vec3(1, 0, 0)) - a direction vectorspread(degrees)
(default: 45.0) - spread amountOutput ports:
velocity
- a velocity normalized vector inside a cone.class VisualShaderNodeParticleAccelerator :
VisualShaderNode
Description: Intended to modify particle velocity via time.
Availability: Process
Properties: Mode: MODE_LINEAR/MODE_RADIAL/MODE_TANGENTIAL
Input ports:
velocity
amount
randomness
Notes:
The internal code is mainly copy/pasted from ParticlesMaterial and their outputs is almost identical
All these new types have a "Particle" suffix to make sorting/seeing of them easy.