question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Texture bug on r137

See original GitHub issue

Describe the bug

DDS and PNG textures lose all color, I don’t know how to really explain, I attached screenshots bellow. Since I only use these 2 types of textures, I can’t test other types.

If the browser has DDS support, it will be used, otherwise fallback to PNG. This happens on all browsers and devices I tested.

To Reproduce

Steps to reproduce the behavior: Go to either of the live examples below and press on a weapon or amor icon, the differences will be visible.

Code

A code snippet of how I’m using it.

		const manager = new THREE.LoadingManager(() => {
			const loadingScreen = document.getElementById('loading-screen')
			if (loadingScreen) {
				loadingScreen.classList.add('fade-out')

				loadingScreen!.addEventListener('transitionend', onTransitionEnd)
			}
		})
		manager.addHandler(/\.dds$/i, new DDSLoader())

		const mtlLoader = new MTLLoader(manager)
		mtlLoader.setPath(url!)
		mtlLoader.load(`${model}.mtl`, (materials) => {
			materials.preload()

			const objLoader = new OBJLoader(manager)
			objLoader.setMaterials(materials)
			objLoader.setPath(url!)
			objLoader.load(`${model}.obj`, (object) => {
				object.scale.setScalar(1 / 200)

				object.traverse((child) => {
					child.frustumCulled = false
					if ((child as any).material instanceof THREE.MeshPhongMaterial) {
						(child as any).material.side = THREE.DoubleSide
					}
				})
				scene.add(object)
			}, undefined, (error) => console.error(error))
		})

Live example

Screenshots

Public version with r136: Public version with r136

Dev version with r137 Dev version with r137

Platform:

  • Device: Desktop, Mobile
  • OS: Windows, Android
  • Browser: Tested on Vivaldi (both Desktop and Android), Chrome, Firefox and Edge
  • Three.js version: r137

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
Karbustcommented, Jan 31, 2022

@Karbust If you update to 0.137.4 you shoudn’t need the alphaWrite code anymore.

Correct, it’s working without alphaWrite. Thank you

1reaction
mrdoobcommented, Jan 27, 2022

As far as I can see the only issue of #18631 is that it broke this use case:

Confirmed. This breaks AdditiveBlending when texture.a < 1 and material.transparent is false.

In this new world of alpha: true, I think I’m totally okay with breaking that use case.

And then we’ll be able to get rid of material.alphaWrite.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Applying circle texture to point renders a square; behavior ...
Describe the bug When creating a new Three.PointsMaterial using a circle ... The behavior has changed from version r137.2 to version 137.3.
Read more >
Does anyone else have this texture bug and/or know how to ...
Does anyone else have this texture bug and/or know how to fix it? I think it's a bug with the shadows : r/midnightsuns....
Read more >
[MC-257089] Texture Bug minecraft 1.8 - Jira
Bug - A problem which impairs or prevents the functions of the product. MCL-22662 All textures are blank in older versions of Minecraft....
Read more >
Hard Reset Texture Bug - YouTube
Hard Reset is one of the most bug -free PC games we've played in some time, but we did manage to encounter one...
Read more >
Texture/Mesh issues - Bugs - Fatshark Forums
Have had this issue since closed beta, the textures dont load correctly on enviroment and weapons. Reticle on the gun And many more....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found