-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
Description
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 toAbstractRenderer
(orBaseRenderer
). - Rename
WebGPURenderer
toRenderer
and let it derive fromAbstractRenderer
. - Rename
src/renderers/webgl-fallback
folder tosrc/renderers/webgl
and avoid the "fallback" terminology completely. - Rename the existing
src/renderers/webgl
tosrc/renderers/webgl-legacy
(it's the directory forWebGLRenderer
).
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