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

WebGPURenderer: Add preferWebGL parameter. #27589

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

RenaudRohlinger
Copy link
Collaborator

@RenaudRohlinger RenaudRohlinger commented Jan 19, 2024

Add a new parameter to the WebGPURenderer to force the WebGL backend even if WebGPU is available.

Example usage:

const renderer = new WebGPURenderer( { preferWebGL: true } );

This contribution is funded by Utsubo

@RenaudRohlinger RenaudRohlinger added this to the r161 milestone Jan 19, 2024
@Mugen87 Mugen87 changed the title WebGPURenderer: new preferWebGL parameter WebGPURenderer: Add preferWebGL parameter. Jan 19, 2024
@RenaudRohlinger RenaudRohlinger merged commit fe3a039 into mrdoob:dev Jan 19, 2024
11 checks passed
@sunag
Copy link
Collaborator

sunag commented Jan 19, 2024

What do you think of forceWebGL?

@LeviPesin
Copy link
Contributor

Why not just new Renderer( new WebGLBackend( ... ) )?

@RenaudRohlinger
Copy link
Collaborator Author

RenaudRohlinger commented Jan 20, 2024

What do you think of forceWebGL?
I'm fine with it 👍

Why not just new Renderer( new WebGLBackend( ... ) )?

I'd say that this feels a lot easier to use:

import WebGPURenderer

new WebGPURenderer( { forceWebGL: overrideInASpecificCase })

than:

import Renderer
import WebGLBackend
import WebGPURenderer

if ( overrideInASpecificCase ) {

renderer = new Renderer( new WebGLBackend( ... ) )

} else {

renderer = new WebGPURenderer()

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants