#Wash out texture when import
74 messages ยท Page 1 of 1 (latest)
loader = new THREE.CubeTextureLoader();
texture = loader.load([
`./panorama/${environmentType}/skybox_0.png`,
`./panorama/${environmentType}/skybox_1.png`,
`./panorama/${environmentType}/skybox_2.png`,
`./panorama/${environmentType}/skybox_3.png`,
`./panorama/${environmentType}/skybox_4.png`,
`./panorama/${environmentType}/skybox_5.png`
]);
scene.background = texture;
Note: The ${environmentType} is just a selection thing, don't care much about it
set texture.colorSpace=THREE.SRGBColorSpace for each texture
and if you are using ACESFilmic encoding it'll make it look different too
So like this
texture.colorSpace=THREE.SRGBColorSpace
texture = loader.load([
`./panorama/${environmentType}/skybox_0.png`,
`./panorama/${environmentType}/skybox_1.png`,
`./panorama/${environmentType}/skybox_2.png`,
`./panorama/${environmentType}/skybox_3.png`,
`./panorama/${environmentType}/skybox_4.png`,
`./panorama/${environmentType}/skybox_5.png`
]);```
Hmm
Uncaught TypeError: Cannot set properties of undefined (setting 'colorSpace')
mmm no , it has to be added on each THREE.Texture instance
what does 'texture=' variable contain ? its an array of THREE.Textures ?
texture varible is empty
This part is in a function so I declare let texture; outside of the function
What...
before dealing with textures
are you using renderer.toneMapping = ACESFilmicToneMapping ?
oh , try commenting that ReinHard line and make the exposure value 1
I believe texture in your code is an array of Texture objects. You'd have to set the color space on the individual texture objects in the array, and do it after you load.
This actually fix it....
Bruh
Thank you so much
@agile geyser
You're the best
๐
ah ! ๐ป
The tickets system is disabled for this server. Enable it at: https://yagpdb.xyz/manage/685241246557667386/tickets/settings.
@agile geyser
Remove ToneRemapping fix the Background texture
But it messes up my Model
Is there a way to exclude ToneRemapping effect on the scene.background?
no i don't think so
for materials you can do material.tonemapping=false
but background is not a material
for models are you doing texture.colorSpace=THREE.SRGBColorspace anywhere ?
No
Try adding it after whenever you load any texture
Oh yeah try the skybox
Let me find a template first
I've never touched skybox
Hmm
Can I project 6 images onto a sphereGeometry?
Or I need to merge them first into 1 finalized texture and project it onto sphere?
@agile geyser
Im done with the Skybox
let skyboxGeo = new THREE.BoxGeometry( 2000, 2000, 2000);
let skybox = new THREE.Mesh( skyboxGeo, materialArray );
scene.add( skybox );
How can I stop the ToneRemapping again?
What does material array contain?
For each material add
toneMapped=false
let materialArray = [];
let texture_ft = new THREE.TextureLoader().load( './panorama/nether/skybox_0.png');
let texture_bk = new THREE.TextureLoader().load( './panorama/nether/skybox_1.png');
let texture_up = new THREE.TextureLoader().load( './panorama/nether/skybox_2.png');
let texture_dn = new THREE.TextureLoader().load( './panorama/nether/skybox_3.png');
let texture_rt = new THREE.TextureLoader().load( './panorama/nether/skybox_4.png');
let texture_lf = new THREE.TextureLoader().load( './panorama/nether/skybox_5.png');
materialArray.push(new THREE.MeshBasicMaterial( { map: texture_ft }));
materialArray.push(new THREE.MeshBasicMaterial( { map: texture_bk }));
materialArray.push(new THREE.MeshBasicMaterial( { map: texture_up }));
materialArray.push(new THREE.MeshBasicMaterial( { map: texture_dn }));
materialArray.push(new THREE.MeshBasicMaterial( { map: texture_rt }));
materialArray.push(new THREE.MeshBasicMaterial( { map: texture_lf }));
for (let i = 0; i < 6; i++)
materialArray[i].side = THREE.BackSide;
let skyboxGeo = new THREE.BoxGeometry( 2000, 2000, 2000);
let skybox = new THREE.Mesh( skyboxGeo, materialArray );
scene.add( skybox );
So each texture_face, I need to set toneMapped = false?
Thanks
for (let i = 0; i < 6; i++)
materialArray[i].side = THREE.BackSide;
materialArray[i].toneMapped= false;
https://threejs.org/docs/?q=material#api/en/materials/Material.toneMapped
also try
texture_ft.colorSpace=THREE.SRGBColorspace
for each texture
no
put the image through a html canvas
or use postprocessing (which will affect everything )
Hey @agile geyser
You know the "Closest neighbour" option in scaling?
How can we apply that in THREEJS?
is this texture related ?
https://threejs.org/docs/index.html?q=text#api/en/constants/Textures
Oh
I found the answer using ChatGPT lol
Threejs can make a skybox with only this texture ?
(a) This should be asked in a new thread; (b) you might have to be a little more specific about what you mean.
a) i dont know how to make a new thread b) it's simple, can i use this texture instead of 6 textures for a skybox, the question was clear ... it's resolved