Render predicate logic

render.predicate({"tile", "particle"}) doesn’t seem to render anything for me. If I just do tile or particle it works. Is the predicate filter not an “or”? Or is it an “and” so that only things that have both tile and particle tags are rendered?

In other words: Is it tile || particle or tile && particle? Seems it should be OR, but it appears to be AND

It’s and, a restrictive filter. We need to extend the whole predicate concept to enable more accurate draw commands.

So there currently is no way for me to draw particles and sprites interleaved, sorted by depth? Particles will always be in front or behind then.

You could create a new material that you render both sprites and particles with or alternatively maybe you can set the material for the particles you want drawn with sprites to be sprite.material (Disclaimer: I haven’t tried this, or looked at the shaders for the materials, so this might not be a good idea, someone at Defold might know better)

Yes, the current best solution seems to be create new materials that share the same tag.

As a side note. It would be nice if your could also do render.predicate({hash(“tile”)}) so that you can have a field in the editor that ends up in a predicate. (Or even better: allow more complex types in the editor such as strings and arrays)