pmndrs / pmndrs/react-postprocessing
[Bug] - N8AO works incorrectly with adaptiveDpr
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.4k
- Forks
- 134
- Merge medio
- 4 min
- PR fusionados (30 d)
- 4
Descripción
Hey everyone! I seems found a bug in N8AO related to AdaptiveDpr
We found a strange effect in our application after adding N8AO to EffectComposer - sometimes it started to add weird 'reflections' to the materials, and we couldn't understand where it's coming from
This is how it looks like: On the surface of the model you can see "reflection" from grid, which should't be present (but it's not only about grid but any objects can appear as reflection).
After debugging for a while I've noticed that this happens on my machine when DPR value is changed. If we (or system) change dpr from 2 to 1, N8AO started to add this 'reflections'. As I can see class has size values which are half of the initial renderer size (if I understand correctly)
If I manually call setSize(width, height) method on N8AOPostPass instance and upscale this values back to dpr=2 values this bug disappears. So it's either should always keep initial values or there is some error in calculation after updating render size
Steps to reproduce
Lest say screen size is 1000x500 with dpr=2. initial values of renderer is 2000x1000px, dpr=2, we set dpr to 1, values are updated to 1000x500, bug appears. If I set values manually by calling setSize() on N8AOPostPass instance to setSize(2x1000, 2x500) it starts working correctly again
versions
"@react-three/drei": "^9.97.5",
"@react-three/fiber": "^8.15.16",
"@react-three/postprocessing": "^2.16.2",
"postprocessing": "^6.35.3",
"three": "^0.161.0",
Can anyone help with this? I can help with fix if you can explain a bit more of how it works. Thanks in advance
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el comportamiento de N8AOPostPass descrito en el issue y reproduce el caso cambiando la DPR del renderer de 2 a 1 en los setups de react-postprocessing y three indicados. Sigue cómo se actualizan sus valores de tamaño; se considera terminado cuando adaptiveDpr ya no produce reflejos espurios después de la transición de DPR.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- react, three.js, typescript
- Área
- frontend, performance, web-dev
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100