Skip to content
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

WebGLRenderer: Avoid creating per-camera render states. #20422

Merged
merged 6 commits into from
Dec 8, 2020

Commits on Sep 27, 2020

  1. Avoid creating per-camera render states

    Now we usually only create one render state per scene. Instead of creating camera-specific render states, the view-dependent light uniforms are updated with a separate function whenever rendering. This helps avoid initMaterial calls when rendering cube maps or array cameras, improving performance dramatically.
    
    The only exception is handling nested render() calls done from callbacks. These are sometimes used to render the same scene from a different viewpoint, for example to generate a mirror reflection. They could also potentially modify the scene in some other ways. For these reasons they can't share the same render state.
    
    Related issues: mrdoob#12883
    Oletus committed Sep 27, 2020
    Configuration menu
    Copy the full SHA
    4033064 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0905964 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2020

  1. Configuration menu
    Copy the full SHA
    1c4fee4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ddbc492 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2020

  1. Configuration menu
    Copy the full SHA
    ad2a514 View commit details
    Browse the repository at this point in the history
  2. Remove manual render state setting

    Nested render calls now automatically restore the correct render state from the stack.
    
    getRenderState/setRenderState are not part of the public API so they can be safely removed from WebGLRenderer.
    Oletus committed Nov 24, 2020
    Configuration menu
    Copy the full SHA
    60defe3 View commit details
    Browse the repository at this point in the history