-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limited number of lightsources ? #4234
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already. |
Hi @DjangoCharango yes there is a limit to the number of lighting uniforms that mobile devices and browsers support. So the hard limit is 5 per type at any one time. Thanks for pointing this out. It is clear that this should be documented better. I am going to add a This should be done with: |
Thanks a lot for your answer. My Tests show, that I can have 9 pointLights in Chrome. Do you know, where I could find more information, on how many light sources, browsers support ? |
If you are using a version <= 10.2 of p5 then you will have an upper limit of 8. Not sure how you are getting 9. Version 1.0 will have a limit of 5 lights. This is because the number of uniforms is limited to 64 in iOS. We do not adjust the number of uniforms based on the browser/device, so these limitations will apply to all sketches made with p5. You can view this PR for more info.. Also here is the relevant shader. If you are targeting a specific hardware/browser combo that allows more uniforms (such as desktop or android) and you need a large number of lights, you can change the array lengths in the shader and build p5 from source. |
I came here to report the same problem five years later, found this issue marked done, found the merged PR... but the documentation for directionalLight doesn't mention the 5-per-type limit. maybe I should open a new issue? |
Documentation for other light source types already says this. I found the limit by experimentation. Fixes processing#4234 processing#4234
Is the numbers of lightsources (pointlight, directional ...) you can add to a 3-dimensional scene limited in some way?
I am trying to figure out, why some lightsources in my scene are being rendered, while others are not.
The text was updated successfully, but these errors were encountered: