-
-
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
VideoTexture’s colorSpace not working on Emissive channel #29625
Comments
Related: Currently VideoTexture is a special case because the browser's sRGB decoding is unreliable for videos. Perhaps we need to extend the inline GLSL sRGB decoding to other slots on default materials. The underlying browser issues remain unfixed. |
@Mugen87 I don't mind making a PR for this, is it OK to scope the fix only to .emissiveMap? Technically this also applies to .sheenColorMap, .specularColorMap, etc... but I doubt these are being used with video, and I imagine we might not want this chunk appearing everywhere: #ifdef DECODE_VIDEO_TEXTURE
// use inline sRGB decode until browsers properly support SRGB8_ALPHA8 with video textures (#26516)
sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
#endif We could log a warning when video textures use SRGBColorSpace on an unsupported slot, perhaps. Aside, which of these blocks us from using WebGL's sRGB decoding for video? Do we need both fixed, or just the Safari one? |
Supporting just emissive sounds good to me! AFAICS, we need both browser bugs fixed. |
Description
When a
videoTexture
is applied onemissiveMap
of aMeshStandardMaterial
,SRGBColorSpace
does not work and it always stays in Linear Color Space.Reproduction steps
emissiveMap
ofMeshStandardMaterial
Code
Live example
In this demo jsfiddle.net
The same VideoTexture and an ImageTexture is applied on
emissiveMap
input of aMeshStandardMaterial
map
input of aMeshStandardMaterial
map
input of aMeshBasicMaterial
& GUI controls colorSpace of both
Screenshots
(look at the top right plane in this video)
Untitled.video.-.Made.with.Clipchamp.mp4
Version
r169
Device
Desktop
Browser
Chrome
OS
Windows
The text was updated successfully, but these errors were encountered: