Skip to content

Rename WebGPURenderer to Renderer. #31381

@Mugen87

Description

@Mugen87

Description

After working with WebGPURenderer for a while now and after observing how the community approaches it, I think the name WebGPURenderer is no good choice for what that thing actually is. I've seen this differently in the past but in the meanwhile, I do think the name should be Renderer.

When I initially worked on WebGPURenderer, the name was fine because it always targeted WebGPU. When WebGL support was added as a fallback, I also understand why WebGPURenderer wasn't renamed because to emphasize the usage of WebGPU.

However, this name does not make clear that WebGPURenderer is actually a universal renderer than can target different backends. It's more of a terminology thing but it is important since different expectations form in the developer's mind. We shouldn't talk about WebGL as a fallback but as a viable backend option for rendering. Hence I would suggest to:

  • Rename the internal Renderer class to AbstractRenderer (or BaseRenderer).
  • Rename WebGPURenderer to Renderer and let it derive from AbstractRenderer.
  • Rename src/renderers/webgl-fallback folder to src/renderers/webgl and avoid the "fallback" terminology completely.
  • Rename the existing src/renderers/webgl to src/renderers/webgl-legacy (it's the directory for WebGLRenderer).

This will also better reflect the long-term strategy to have a single renderer with multiple backend options. By default, the renderer picks the best available option but the developer has the freedom to choose/force the preferred backend.

Solution

Rename WebGPURenderer to Renderer.

Alternatives

Keep the name as it is.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions