Javascript API to create textures
See original GitHub issueDescription
I load a gltf model into the viewer with a material that has only a baseColorFactor
defined inside its pbrMetallicRoughness
properties
Problem
I want to change material properties in order to load a baseColorTexture
.
According with the examples there is an API to handle this:
material.pbrMetallicRoughness.baseColorTexture.texture.source.setURI
However, In my scenario, baseColorTexture
is null so I’ll get an error if I try to manipulate its source.
Is it possibile to create textures with javascript code? Is there some API that I’m missing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Using textures in WebGL - Web APIs | MDN
The first thing to do is add code to load the textures. In our case, we'll be using a single texture, mapped onto...
Read more >Texture – three.js docs
An image object, typically created using the TextureLoader.load method. This can be any image (e.g., PNG, JPG, GIF, DDS) or video (e.g., MP4,...
Read more >MeshTexture | API Reference | ArcGIS API for JavaScript 4.25
MeshTexture represents image data to be used for MeshMaterial or MeshMaterialMetallicRoughness. It is mapped to the mesh by its uv vertex attributes.
Read more >Texture | Wonderland Engine
Texture JavaScript API reference ... HTMLVideoElement | HTMLCanvasElement | number, HTML media element to create texture from or texture id to wrap.
Read more >Creating Procedural Textures - Babylon.js Documentation
To use this custom texture, you need to make your folder available to your babylon.js html/javascript files and use a CustomProceduralTexture class instead...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My apologies; after looking through this part of the code in more detail we are in fact missing the ability to create a texture from scratch; we can only
setURI()
on existing textures. I’m working on adding this functionality.out now in v1.8