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

WebGLRenderer: Fix equirect texture conversion. #20048

Merged
merged 1 commit into from
Aug 14, 2020
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Aug 11, 2020

Fixed #20043 (comment)

When you load an equirect texture, WebGLCubeMaps will return null if the texture is not loaded yet. When the loading process is completed and the cube map was created, an update of the shader program is required. This missing bit was responsible for the uniform location errors.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Aug 11, 2020

webgl_loader_gltf is broken. Investigating...

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Aug 11, 2020

Okay, should be fixed now!

I actually like the simplifications in WebGLMaterials^^.

@@ -1502,6 +1504,10 @@ function WebGLRenderer( parameters ) {

initMaterial( material, scene, object );

} else if ( materialProperties.envMap !== envMap ) {
Copy link
Collaborator Author

@Mugen87 Mugen87 Aug 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, there is no way around this check. However, if an existing cube map is changed with another one, initMaterial() will not trigger the expensive shader compilation (unless mode, encoding or mapping is different).

@WestLangley
Copy link
Collaborator

@Mugen87 Thank you for helping with this. :-) After preliminary testing, everything appears to be working correctly for me.

@WestLangley WestLangley added this to the r120 milestone Aug 11, 2020
@mrdoob mrdoob merged commit b9fd220 into mrdoob:dev Aug 14, 2020
@mrdoob
Copy link
Owner

mrdoob commented Aug 14, 2020

Thanks!

@WestLangley
Copy link
Collaborator

WestLangley commented Aug 16, 2020

@Mugen87 Git bisect is pointing to this commit... Are you able to reproduce it?

Screen Shot 2020-08-15 at 9 44 22 PM

@mrdoob
Copy link
Owner

mrdoob commented Aug 16, 2020

@WestLangley is this a continuation of a conversation from somewhere else?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Aug 16, 2020

Ah, I see what @WestLangley means. The sphere should have the same env map like the background.

@WestLangley
Copy link
Collaborator

@WestLangley is this a continuation of a conversation from somewhere else?

It was a follow-up to my previous comment where I said:

@Mugen87 Thank you for helping with this. :-) After preliminary testing, everything appears to be working correctly for me.

I was not sure if it actually never worked, or broke subsequent to testing...

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.

3 participants