-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using atlas causes texture to reupload multiple times. Works in R89/R90, doesnt in R91+ #14391
Comments
https://excaa.github.io/threejs/atlas/indexR90.html Topleft text is the renderer.info.memory data. With R90 the texture amount stays properly on 2. With R94 it increases until all textures are used at least once. Clicking changes the texture in cubes. |
That happens because of #13102 You can easily verify this with the following fiddle: https://jsfiddle.net/f2Lommf5/8204/ It uses your code with The new implementation based on |
Is there another way then to reuse the basetexture. Will have a huge performance hit if texture uploading happens multiple times. |
Why not having a single texture and alter the uv-coordinates of the geometries, instead? |
Any yes, having multiple |
I have a shared geometry currently in use. But will check if that would be more optimal solution. Thanks for the ideas & info. Closing the issue as it's not really an issue after all. |
It is an issue — either the |
@donmccurdy There was an interesting suggestion by @mrdoob to introduce something like |
Interesting... now that ES From my perspective if we were adding a layer of abstraction it should be between Material and Texture, rather than beneath a Texture, like Material -> Map/Slot -> Texture -> texture.image, where the Map/Slot becomes a good place for UV transforms, x/y/z channel switches, etc., and removes most reasons to clone a texture. But of course that's also a very large change, and overall the NodeMaterial approach seems much more flexible. |
Description of the problem
In version R90 I have an atlas that is loaded/created with:
In addition to atlas I have large equirectangular textures loaded. With version 90 (and 89) renderer.info.memory says 23 textures when scene is being rendered and it keeps at that whenever objects found in the scene are set to visible / invisible.
With R91 and newer the texture count starts to ramp up quickly. Initial state has textures set at 79 (most likely due to overlay ui which has lots of assets all found in one atlas. Whenever I click an area where object is and it is set to visible then the count jumps by some sum (depending on what the object is). All of the textures used on objects are found in another atlas image.
Checking with the debugger in R90 and R89 texture upload is done only initially. In R91+ it happens everytime an object is set to visible (one that has not been visible before).
Will provide an example after I find some images I can distribute freely.
Three.js version
Browser
Most likely also IE. Cannot test with one at the moment.
OS
Hardware Requirements (graphics card, VR Device, ...)
GPU used in tested is nvidia 1060 and 770.
The text was updated successfully, but these errors were encountered: