-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Describe the bug
I'm trying to use the Image abstraction, in order to load images on planes, but the loaded images are rendered more bright than they really are.
Even the official documentation has the same display issue:
Original asset | Documentation display |
---|---|
![]() |
Why am I considering the color space as root cause?
I've seen that the Image component has a color
prop, which has white
as default value. This color seems to be used as multiplied color, over the loaded asset.
When tweaking it to another color, it applies it to the assets in the canvas.
I looked for issues and discussions, and found a similar behavior here: https://github.com/orgs/Tresjs/discussions/739
The contributor solved his issue by applying the SRGBColorSpace
color space (though, their issue is not related to Image
, but to useTexture
).
Reproduction
https://cientos.tresjs.org/guide/abstractions/image.html
Steps to reproduce
Go to the official documentation, or use the given snippet:
<script setup lang="ts">
import { NoToneMapping, SRGBColorSpace } from 'three'
import { TresCanvas } from '@tresjs/core'
import { Image, OrbitControls } from '@tresjs/cientos'
const gl = {
clearColor: '#82DBC5',
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
const URL_STUB = 'https://upload.wikimedia.org/wikipedia/commons/'
const URLS = [
'f/f0/Cyanistes_caeruleus_Oulu_20150516.JPG',
'3/36/Cyanistes_caeruleus_Oulu_20130323.JPG',
'2/2e/Cyanistes_caeruleus_Oulu_20170507_02.jpg',
].map(url => URL_STUB + url)
</script>
<template>
<TresCanvas
v-bind="gl"
>
<TresPerspectiveCamera :position="[0, 0, 2]" />
<OrbitControls />
<Image :url="URLS[0]" :radius="0.2" :transparent="true" :position="[-1.5, 0, -1]" />
<Image :url="URLS[1]" :radius="0.2" :transparent="true" />
<Image :url="URLS[2]" :radius="0.2" :transparent="true" :position="[1.5, 0, -1]" />
</TresCanvas>
</template>
System Info
Used Package Manager
yarn
Code of Conduct
- I agree to follow this project's Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.