playcanvas-spine icon indicating copy to clipboard operation
playcanvas-spine copied to clipboard

Allow optional material configuration for the plugin

Open heretique opened this issue 3 years ago • 1 comments

Hey team,

while using the Spine plugin on one of our projects we've noticed that the Spine animations were white. We discovered that that was due to the ambient light that was set to white. We fixed that issue by patching the plugin and inside createMaterial method we disabled the diffuse color

material.diffuse = new pc.Color(0, 0, 0, 0); // include diffuse component, this allows lights contribution

I think this is kind of "hacky" on our part and was wondering if there could be a way of setting this as an option on the SpineComponent?

Thanks!

heretique avatar Jan 28 '22 11:01 heretique

Another issues I've noticed is that the internally created material by default enables lighting - so that the meshes can be lit if required. This causes the fragment shader to be more expensive than needed, if the user does not need lighting. This is especially true for when the clustered lights are used.

mvaligursky avatar Jul 13 '22 13:07 mvaligursky