Open dmnsgn opened 2 months ago
// Instead of for (let i = 0; i < directionalLights.length; i++) { sharedUniforms[`uDirectionalLights[${i}].intensity`] = directionalLights[i].intensity; sharedUniforms[`uDirectionalLights[${i}].color`] = lightColorToSrgb(directionalLights[i]); } const uniforms = { uDirectionalLights: directionalLights.map((light) => { intensity: light.intensity, color: lightColorToSrgb(light), }) } ctx.submit({ uniforms })
Will require checking uniforms value Array.isArray of objects.
Will require checking uniforms value Array.isArray of objects.