How to handle many light sources on the scene?

briarheart

I have a map definition with plenty of light sources (about 350). When I'm trying to create THREE.PointLight objects and add them to the scene, I'm getting the following error along with low FPS:

three.js:29438 THREE.WebGLProgram: shader error:  0 gl.VALIDATE_STATUS false gl.getProgramInfoLog Fragment shader active uniforms exceed MAX_FRAGMENT_UNIFORM_VECTORS (1024).

What does it mean? Is there some limit of THREE.PointLight objects on the scene? Are there any good practices to keep high performance when you have many light sources?

For now the only idea that comes to mind is somehow reduce the number of light sources and leaving only those that I really need.

Nop Jiarathanakul

This error means you've exceeded the maximum number of uniforms in your fragment shader. This limit is determined by your graphics card and/or driver. You can check by going to http://webglreport.com/.

Looks like on your system the limit is 1024. A Three.js light typically uses 6-10 uniforms depending on the type of light and the material. Given you're using ~350 lights, it makes sense that you're blowing way past this limit.

Generally speaking, 350 discrete lights is a lot, probably way more than you need. Using more lights is also computationally intensive. A typical WebGL scene has no more than a handful. You might want to consider other techniques to achieve what you want.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to handle "no scene" in a scene transition attempt?

From Dev

How to build scene builder from openjfx sources

From Dev

How to handle Day Light Saving in Oracle database

From Dev

How to I turn off the ambient light in Scene Kit (with Swift)?

From Dev

How to handle multiple data sources with rxjava?

From Dev

Multiple light sources on canvas

From Dev

Multiple light sources on canvas

From Dev

How many "&&" can an "if" statement handle?

From Dev

How to handle the back button on WP 8.1 using MVVM light?

From Dev

How to handle 1000 of tables in one scene in javafx without hang?

From Dev

Scene2d how to handle touched actor?(LibGDX)

From Dev

Gnu make - how to handle sources from outside my project tree

From Dev

Gnu make - how to handle sources from outside my project tree

From Dev

How can I get a light node in scene kit to be directly above the person at all times?

From Dev

How to handle this code in Many-One in linq

From Dev

how to handle "Too many values to unpack"

From Dev

how to handle "Too many values to unpack"

From Dev

How many cores can Linux kernel handle?

From Dev

How to handle Many to Many records, when using Rails as REST API

From Dev

How to handle Many to Many records, when using Rails as REST API

From Dev

Is there a way to make a dark/low light SceneKit scene?

From Dev

WebGL multiple light sources creating dark edges

From Dev

WebGL fragment-shader for multiple light sources?

From Dev

WebGL fragment-shader for multiple light sources?

From Dev

Business intelligence solutions with many to many data sources

From Dev

How can I wait to see how many times the light flashes with arduino?

From Dev

Estimate how many user that can handle in every instance of signalr app

From Dev

How many concurrent read call can Redis server handle?

From Dev

How to handle database storage/backup and application logs with many linked containers?

Related Related

  1. 1

    How to handle "no scene" in a scene transition attempt?

  2. 2

    How to build scene builder from openjfx sources

  3. 3

    How to handle Day Light Saving in Oracle database

  4. 4

    How to I turn off the ambient light in Scene Kit (with Swift)?

  5. 5

    How to handle multiple data sources with rxjava?

  6. 6

    Multiple light sources on canvas

  7. 7

    Multiple light sources on canvas

  8. 8

    How many "&&" can an "if" statement handle?

  9. 9

    How to handle the back button on WP 8.1 using MVVM light?

  10. 10

    How to handle 1000 of tables in one scene in javafx without hang?

  11. 11

    Scene2d how to handle touched actor?(LibGDX)

  12. 12

    Gnu make - how to handle sources from outside my project tree

  13. 13

    Gnu make - how to handle sources from outside my project tree

  14. 14

    How can I get a light node in scene kit to be directly above the person at all times?

  15. 15

    How to handle this code in Many-One in linq

  16. 16

    how to handle "Too many values to unpack"

  17. 17

    how to handle "Too many values to unpack"

  18. 18

    How many cores can Linux kernel handle?

  19. 19

    How to handle Many to Many records, when using Rails as REST API

  20. 20

    How to handle Many to Many records, when using Rails as REST API

  21. 21

    Is there a way to make a dark/low light SceneKit scene?

  22. 22

    WebGL multiple light sources creating dark edges

  23. 23

    WebGL fragment-shader for multiple light sources?

  24. 24

    WebGL fragment-shader for multiple light sources?

  25. 25

    Business intelligence solutions with many to many data sources

  26. 26

    How can I wait to see how many times the light flashes with arduino?

  27. 27

    Estimate how many user that can handle in every instance of signalr app

  28. 28

    How many concurrent read call can Redis server handle?

  29. 29

    How to handle database storage/backup and application logs with many linked containers?

HotTag

Archive