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

regl has a bug with sRGB texture #2

Open
xiaoiver opened this issue Apr 12, 2019 · 0 comments
Open

regl has a bug with sRGB texture #2

xiaoiver opened this issue Apr 12, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@xiaoiver
Copy link
Owner

xiaoiver commented Apr 12, 2019

PR: regl-project/regl#523

The bottom baseColor is correct while the top is wrong:
屏幕快照 2019-04-12 上午11 40 40
屏幕快照 2019-04-12 上午11 49 03

So we must do this conversion manually for now until regl fix this bug.

// pbr-frag.glsl
vec4 SRGBtoLINEAR(vec4 srgbIn)
{
    vec3 bLess = step(vec3(0.04045),srgbIn.xyz);
    vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );
    return vec4(linOut,srgbIn.w);;
}
@xiaoiver xiaoiver added the bug Something isn't working label Apr 12, 2019
@xiaoiver xiaoiver changed the title regl 对于 sRGB 纹理支持有误 regl has a bug with sRGB texture Apr 12, 2019
xiaoiver added a commit that referenced this issue Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant