godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.05k stars 21.18k forks source link

3D Particles color gradient / albedo of mesh is preferred over particle material #9781

Closed jedStevens closed 4 years ago

jedStevens commented 7 years ago

Operating system or device - Godot version: Manjaro, master as of posting commit: aa798eb

Particles seems to ignore any color modulation in the process material. This is causing problems trying to create effects such as clouds and other fade out effects. Would be nice for 3.0.

Can provide a project if needed, but adding a color gradient to a particle3d node in the process material is enough to replicate. Was wondering if anyone else was getting this error.

Zylann commented 7 years ago

Godot 3.0 alpha1, Windows 10 64 bits, nVidia geforce 940M:

I'm getting this too, color or gradient don't do anything. I'm using the built-in procedural quad meshes.

Project: ParticlesColorRamp.zip

Bauxitedev commented 7 years ago

This is not a bug, although it might be kind of confusing at first why this happens. You need to set the material of the particle mesh to use the vertex color as albedo (because internally, the particles are colored by setting the vertex colors). A demonstration:

albedo

parts

(also you should check the Transparent flag if you want alpha to work in the color ramp)

Jummit commented 4 years ago

This should be documented. I had to search for this issue to find out why colors weren't working.

Calinou commented 4 years ago

Ideally, we should disable a node configuration warning if vertex colors should be enabled but they aren't, but this sounds difficult to detect programmatically.

Even better, Vertex Color > Use As Albedo should be enabled automatically when creating a new SpatialMaterial for use in Particles or CPUParticles.

clayjohn commented 4 years ago

@Calinou this is documented in the ParticleMaterial documentation here http://docs.godotengine.org/en/latest/tutorials/shading/shading_reference/particle_shader.html#vertex-built-ins

I disagree that we should force use_as_albedo on users. Many users use COLOR as a general purpose data container.

Zireael07 commented 4 years ago

That's shading reference, not material/particle documentation, though.

clayjohn commented 4 years ago

@Zireael07 fair enough. Please also see the Particles Material documentation http://docs.godotengine.org/en/latest/classes/class_particlesmaterial.html#class-particlesmaterial-property-color

clayjohn commented 4 years ago

Closing as this is documented in multiple places http://docs.godotengine.org/en/latest/tutorials/shading/shading_reference/particle_shader.html#vertex-built-ins and http://docs.godotengine.org/en/latest/classes/class_particlesmaterial.html#class-particlesmaterial-property-color