-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Shader Refactoring #24805
Shader Refactoring #24805
Conversation
@Mugen87 Some users may be assigning a PMREM as a background. It is fair to say that support for that is no longer needed now that blurry backgrounds are supported? |
Yes, that makes sense. Users can now assign the "raw" or "unprocessed" environment map to |
@Mugen87 I am reasonably-happy with this refactoring. Please let me know what you think. |
@@ -225,14 +225,27 @@ const ShaderLib = { | |||
|
|||
}, | |||
|
|||
backgroundCube: { |
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.
Instead of using the term backgroundCube
, what do you think about skybox
instead?
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.
OK, we can change it. How do you feel about blurredCube
shader? That is the most descriptive name I can think of...
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.
True, but I have the feeling skybox
is what most 3D users understand of what the shader essentially represents. It's a common term in 3D engines.
However, the name is not something that blocks the PR for me. If we can't quickly agree on a name, we can merge the refactoring first and then discuss alternatives. backgroundCube
isn't wrong after all.
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.
We already have a skybox shader called 'cube' shader.
-
'cube': a skybox shader, used by post-processing, and other apps
-
'background': used by the renderer for
scene.background
(flat only) -
'backgroundCube': used by the renderer for blurring
scene.background
(cube only)
The nomenclature is not a deal breaker for me, but let's revisit in a later PR. 😇
@Mugen87 FYI, with this PR, assigning a PMREM directly to I am open leaving that as-is, or removing it in a follow-on PR. |
/ping @sunag just in case... |
Let's merge this so we have it in |
I have changed my mind on this. Some users may have only a PMREM. For example, scene.environment = pmremGenerator.fromScene( new RoomEnvironment() ).texture;
scene.background = scene.environment; // assign PMREM to background
scene.backgroundBlurriness = 0.2; So, as long as PMREM is used for blurring |
I've added a note in the migration guide for |
Follow-on to #24752.
This post is intended as a basis for further discussion.
EDIT: It looks like we have agreement here. Yay!