gkjohnson / three-gpu-pathtracer

Path tracing renderer and utilities for three.js built on top of three-mesh-bvh.
https://gkjohnson.github.io/three-gpu-pathtracer/example/bundle/index.html
MIT License
1.27k stars 125 forks source link

MeshStandardMaterial not working properly with alpha ,normal and roughness maps when rendering #552

Closed nightfury07x closed 3 months ago

nightfury07x commented 3 months ago

Describe the bug

I have threejs mesh with MeshStandardMaterial that have alpha,normal and roughness maps added to the material with repeating and wrapping

alpha.wrapS = THREE.RepeatWrapping; alpha.wrapT = THREE.RepeatWrapping;

Material.alphaMap?.repeat.set(1 / scale, 1 / scale);

But when rendering the object these maps are not showing in correct scale but the base texture apply with correct repeat and scale

Expected behavior

when rendering other maps should be scaled and repeated correctly as the base texture in the material

Screenshots and Repro Model

before the render how alpha map is working (can see the transparent windows are placed correctly)

309722080-ddc2c145-05f7-4715-82b3-9f1b6e7823f5

when rendering (base texture placed correctly but windows are very small are wrongly placed )

309722381-593ad7d8-e135-481d-810f-bb8df4af94c8

gltf model than exported from the scene blocks.zip

Platform:

Device: [Desktop] OS: [Windows] GPU: [NVidia ] Browser: [Chrome] Browser Version: Version 122.0.6261.95 (Official Build) (64-bit) Three.js version: "three": "^0.161.0", Library version: three-gpu-pathtracer": "^0.0.17

gkjohnson commented 3 months ago

Your model does not include an alpha map...

image
nightfury07x commented 3 months ago

@gkjohnson I think when exporting the gltf alpha map is did not attached to the material here is the alpha map I have used opacity25

gkjohnson commented 3 months ago

I'm sorry, I need you to provide a model or working example. I cannot spend my time figuring out the right way to textures to your models in order to reproduce your problem.

gkjohnson commented 3 months ago

Closing until a working example that demonstrates the problem is provided.