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.

Introducing THREE.Image

See original GitHub issue

Moved the discussion from #5728 to a separate issue.

The idea is to add THREE.Image as an additional class which is used by THREE.Texture. An instance of THREE.Image is directly mapped to an instance of WebGLTexture (the raw WebGL texture object). That means multiple textures can refer to the same instance of THREE.Image and not causing redundant texture uploads anymore (related issues #5728, #5821, #7223)

Ideally, THREE.Image will make the handling of image objects transparent (e.g. the difference in HTMLImageElement, ImageBitmap or the image stub in DataTexture is encapsulated in this new class).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
donmccurdycommented, Oct 18, 2019

What would be the goals of this change? From the issues attached I see two:

  1. Ability to use different values of repeat and offset on the same texture, without duplicate GPU upload. Using multiple THREE.Texture instances would not duplicate data as long as the underlying THREE.Image was reused.
  2. Prevent UniformsUtils.clone() from causing duplicate GPU upload. Cloning THREE.Texture instances would not duplicate data as long as the underlying THREE.Image was not cloned.

For (1), adding THREE.Image sounds like a good solution under the current API. Depending on how/if/when we are introducing NodeMaterial, there may be others:

material1.color = new TextureNode( texture, uvNode1 );
material2.color = new TextureNode( texture, uvNode2 );

For (2), I’m not sure whether UniformsUtils really needs to clone textures, or could just copy by reference.

I don’t have an opinion for or against this change yet, just trying to understand the goal and whether the additional abstraction is the right solution.

1reaction
mrdoobcommented, Feb 2, 2022

THREE.Image ended up being named THREE.Source #22846

Read more comments on GitHub >

github_iconTop Results From Across the Web

Three Image Photo Frame Template In Photoshop
In this tutorial, learn how to create a simple three-image photo frame in Photoshop, then how to easily convert the final result into...
Read more >
Introduction Through 3-image Collage - eLearningDom
Introduction Through 3-image Collage. An introduction template with a collage of three images to present objectives, summary or key learning points.
Read more >
Set the Scene with a Three-Picture Story | The Daily Post
Introducing : the three-picture story. ... The third image completes the scene by zeroing in on a detail, something you might not notice...
Read more >
Quick Images | TEDD - Teacher Education by Design
In Quick Images, children are shown pictures displaying groups of objects or symbols, viewing each for only a few seconds.
Read more >
Introduction to three-dimensional image processing
Introduction to three-dimensional image processing¶. Images are represented as numpy arrays. A single-channel, or grayscale, image is a 2D matrix of pixel ...
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