aframevr / aframevr/aframe

material: repeat doesn't work, when repeat has default or '1 1' set

Open
#5,120 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

Description:

  • A-Frame Version: 1.3.0
  • Platform / Device: Any
  • Reproducible Code Snippet or URL:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>A-Frame - material texture repeat issue</title>
		<meta name="description" content="A-Frame">
		<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
	</head>
	<body>
		<a-scene>
			<a-plane src="https://cdn.vrdoro.com/data/vrdoro/images/11/1663758749743.jpeg" position="0 1.6 -1" rotation="0 0 0"></a-plane>
		</a-scene>
	</body>
</html>

Now do in console of browser inspector: document.querySelector('a-plane').setAttribute('material', 'repeat:2 2');

  • Result: Texture is not repeated correct.
  • Expected: Texture is repeated twice.
  • Interesting: document.querySelector('a-plane').getObject3D('mesh').material.map.wrapS; (and wrapT) is 1001 but should be 1000 (=THREE.RepeatWrapping)

Workaround (choose one):

  1. Set material="repeat: 1.001 1.001" as initial value
  2. call document.querySelector('a-plane').getObject3D('mesh').material.map.needsUpdate = true; once

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided A-Frame HTML and the browser-console setAttribute call, then inspect the plane mesh material's map.wrapS and wrapT values. Done means setting repeat to 2 2 produces two texture repetitions without manually setting needsUpdate, with both wrapping values using THREE.RepeatWrapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.