3D lighting; More 3D model updates; Bug fixes.
Hello!
In r498, built-in Sprite objects receive Material Properties and work with 3D lighting. Is there a public SDK v2 API or capability flag for custom world plugins to opt in, so Construct creates the per-instance material state and shows the Material section?
Can custom geometry rendered with IRenderer.drawMesh() use the built-in 3D lighting pipeline? If so, how should normals be supplied or generated, and does SetMustPreDraw(true) require special handling?
I also noticed a custom mesh can appear affected by a previously drawn Sprite’s material in the Layout View, but renders dark in Preview. Could this be inherited renderer state?
If custom addon lighting support is not available yet, is it planned?
There's a PluginInfo method SetSupports3DLighting() in this release so third-party addons can opt-in to 3D lighting support (I forgot to add that to the changelog, sorry). Custom geometry can use MeshData and call either copyNormalBuffer() to set a normal buffer, or computeNormalBuffer() to calculate it from vertex positions.
Rendering should not be affected by anything previously drawn - if so it's a bug so please file an issue!
Thank you, Ashley, for the very quick and precise reply! I tested it immediately: SetSupports3DLighting(true) together with MeshData, computeNormalBuffer() and drawMeshData() works with our custom animated mesh in WebGPU Preview. Multiple colored lights and the standard Material Properties are working correctly.
Your answer saved us a lot of time and confirmed the right integration path. Much appreciated! :)