-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
It seems reflectionSource do not respect gamma ? #6897
Comments
Oh that's interesting. We can investigate updating the reflection decode to respect We probably won't be able to push a change like this out quickly though, so I suggest you patch |
@slimbuck I think you should respect
Don't worry, I can use a custom build of PlayCanvas engine. 😃 |
Typically, the decode functions on texture sampling is purely based on the texture format. The lighting part of the shaders needs all data in linear space, and so if the texture is sRGB it needs to be decoded to linear space. If the texture is linear, it should do pass-through decoding. useGammaTonemap is not related to the way textures are sampled, but only to the way the final pixel is written to the framebuffer. In engine v2 the useGammaTonemap was removed, and we only have useTonemap. Gamma is automaticaly based on the scene / camera gamma settings. |
Yes, but the get encoding() {
switch (this.type) {
case TEXTURETYPE_RGBM:
return 'rgbm';
case TEXTURETYPE_RGBE:
return 'rgbe';
case TEXTURETYPE_RGBP:
return 'rgbp';
default:
return (this.format === PIXELFORMAT_RGB16F ||
this.format === PIXELFORMAT_RGB32F ||
this.format === PIXELFORMAT_RGBA16F ||
this.format === PIXELFORMAT_RGBA32F ||
isIntegerPixelFormat(this.format)) ? 'linear' : 'srgb';
}
} Even though I know the Why vec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {
return textureCube(tex, uvw);
} It is in linear space.
Yes, I want to upgrade to v2 too, but I still need to support WebGL 1. So I may stick to 1.73.4 until our product drop support iOS 15-... |
In case you use engine only, you should be able to change the type of the texture like this. Not sure specifically about cubemaps or what options are supported there, @slimbuck might know more
|
I am sure my standard materials do not need
useGammaTonemap
, so I set it tofalse
. All textures are sampled correctly except formaterial.cubeMap
, which appears darker than it should. Here is what I found:In
standard.js
, we have the following logic:It will check
litOptions.gamma
to picklinear
orencoding
.But in
lit-shader.js
, the reflectionSource will not checkgamma
:This means all of the
$DECODE
will be replaced todecodeGamma
.Even though I set
app.scene.gammaCorrection = 0
, the cubeMap still usedecodeGamma
, but what I want isdecodeLinear
... 😢The text was updated successfully, but these errors were encountered: