Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
¿Puedo configurar el filtrado de texturas para las texturas cargadas?

El reto

El objetivo es mostrar la imagen cargada pixelada, con el filtrado de textura NEAREST .

Lo que probé hasta ahora

  1. Usando la propiedad image-rendering CSS.
  2. Establecer los filtros del modelo .glb en NEAREST .

cual creo que es el problema

Creo que el problema es que las imágenes que vienen con el modelo están correctamente filtradas, pero la nueva cargada no.

Enlaces interesantes que he encontrado

API de materiales del visor de modelos

Ejemplo

 document.getElementById("urlA").addEventListener("change", function() { const file = this.files[0]; const viewer = document.getElementById("modelA"); if (!file) return; const reader = new FileReader(); reader.addEventListener('load', async function() { const texture = await viewer.createTexture(reader.result); viewer.model.materials[0].pbrMetallicRoughness.baseColorTexture.setTexture(texture); }); reader.readAsDataURL(file); })
 body { background-color: rgba(255, 255, 255, 0.85) } h1 { margin: 0; font-size: 16pt; font-family: Arial, Helvetica, sans-serif; color: #4a5a8a } model-viewer { width: 256px; height: 256px; border: 2px solid black; background-color: #484E61 } input[type="file"] { margin: 15px auto }
 <script src="https://unpkg.com/@google/model-viewer@1.12.0/dist/model-viewer-umd.js"></script> <h1>Upload an image to preview it in the model</h1> <input type="file" id="urlA"> <model-viewer id="modelA" camera-controls src="https://modelviewer.dev/shared-assets/models/Astronaut.glb" shadow-intensity="0" environment-image="neutral" exposure="0.5"></model-viewer>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!