简体   繁体   中英

SceneKit background too bright when applying camera frame MTLTexture as a background

淘汰了SceneKit纹理

I'm trying to convert a camera frame to a MTLTexture and then use it as a SceneKit background. The texture is created successfully, and looks like it should when inspecting it. However, when I set the following:

scene.background.contents = texture

It appears too bright / washed out. Any ideas how to fix this?

Update 1: Gist here

It turns out what was causing the washed out effect in the texture was the pixel format. It should be .bgra8Unorm_srgb (not .bgra8Unorm).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM