-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Blurred Environment Map #19736
Comments
So you are expecting a sharp background? |
@ManishJu This is a two fold problem. The low res background happens because, in the example, we are setting the output of PMREMGenerator directly to the background. Currently, the highest MIP level of the generated texture is fixed and limited to 256px, so no matter how high quality the original texture is, the background will always be 256px. Good news is that I'm currently working on a solution to allow customizable resolution for the max MIP level, so we should have an out of the box solution for this very soon. The other point of view, is that we should be setting the equirectangular original texture to the background, not the PMREM version. However, the internal shader does not know how to deal with equirectangular textures, but IMO it should. |
Related #9733. I also remember that @mrdoob lately mentioned the idea to introduce |
I see, however, I find that the approaches suggested by that thread are no longer relevant in our current design. We wouldn't need to create a cube map from an equirectangular texture. It's really just a simple 2 liner fix.
We just add || background.mapping === EquirectangularReflectionMapping to this line, so that WebGLBackground understand that it can read an equirectangular texture. And, inside the shader, we also include #include <common> , so that it understands equirectUv . That's it.
Here's how it looks: https://rawcdn.githack.com/sciecode/three.js/0ac95becdc228f836b60caeffa41b3e84c39b7ea/examples/webgl_tonemapping.html I don't see any seams, or any other problems exposed by that thread. What are your guys opinion on this temporary fix? @WestLangley @Mugen87 ?
In working on the CUBE_UV I find that it would also be beneficial to have a |
@ManishJu See if #9733 (comment) works for you. |
Thanks @WestLangley it worked fine. I changed the background precison from 512px to 4096px and it looks amazing. I will just start another issue for this if you guys want. |
@ManishJu See #19716 (comment) and try |
@WestLangley thanks for your input. Changing magnification filter has no effect for me. The minification filter introduces the artifacts. In short the first 2 code snippets below give results as that of image 1 posted above and the last 2 produces image 2 from above :
|
Please show all your code so it is clear what you are doing. A live example is preferable. |
@WestLangley thanks for waiting, below is the complete code. It is directly modified version of example "webgl_tonemapping". You can change line 121 with the 4 options already present.
|
As I said, you will get artifacts applying linear filtering to RGBE-encoded textures. The only reason linear filtering may work in your case is because you are setting the cube size to 4096, which is likely larger than the resolution of your monitor. For rgbe-encoded textures, you should set generateMipmaps: false
magFilter: THREE.NearestFilter
minFilter: THREE.NearestFilter |
Closing. Let's track the support for equirectangular background textures in #9733. The current workaround is the usage of WebGLCubeRenderTarget.fromEquirectangularTexture(). |
On using HDR loader and PMREMGenerator as in the example https://threejs.org/examples/?q=tone#webgl_tonemapping
you will always get the scene background blurred no matter what the size of the HDR you are using. I tried 1k,4k and 8k hdr texture from https://hdrihaven.com/hdri/?h=small_cathedral, I still get the same blurred background.
Three.js version
Browser
OS
The text was updated successfully, but these errors were encountered: