-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
ViewHelper: Customize the viewport size and fix renderer.autoClear
settings
#31355
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
base: dev
Are you sure you want to change the base?
Conversation
Do you mind demonstrating the issue with a live example that is fixed by this PR? (https://jsfiddle.net/mnqr9oj0/) Can the issue be reproduced somehow with the editor (which is the primary user of |
// | ||
|
||
const x = domElement.offsetWidth - dim; | ||
const y = renderer.isWebGPURenderer ? domElement.offsetHeight - dim : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's correct to drop this check. WebGPURenderer
and WebGLRenderer
have different viewport conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's correct to drop this check.
WebGPURenderer
andWebGLRenderer
have different viewport conventions.
It's really an oversight on my part here, and I think it's good to delegate viewport operations directly to the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's correct to drop this check.
WebGPURenderer
andWebGLRenderer
have different viewport conventions.
However, the helper can only get the renderer instance inside the render function, and the cached variables are outside.I think it's better to leave the location settings of the helper to the user, the difference between GL and GPU is harmless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the difference between GL and GPU is harmless
The view helper won't be proper positioned without this code. So it must be restored. This is not something the user should care about on app level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the difference between GL and GPU is harmless
The view helper won't be proper positioned without this code. So it must be restored. This is not something the user should care about on app level.
The new commit already takes care of this, using the renderer as an argument to the constructor
The new demo is here https://jsfiddle.net/sdtL5bao/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new commit already takes care of this, using the renderer as an argument to the constructor The new demo is here https://jsfiddle.net/sdtL5bao/
Please ignore this commit for now, some bugs are not fully fixed
https://jsfiddle.net/ej1md8st/4/ |
Your fiddle contains a runtime error because you are importing the You should demonstrate with a live example like https://jsfiddle.net/kofv1t6p/3/ what currently does not work. I'm afraid I still don't understand both issues you have raised in your initial post. |
ViewHelper
was not able to adjust its display position automaticallyViewHelper
was only possible to manually clear the canvas to allow the helper and scene to display properlyThis PR adds the function "setViewport" to customize the display location, and automatically handles the clear of the canvas