Skip to content
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

Transparent surfaces (e.g. glass) look way too dark #60

Closed
1 of 2 tasks
Tracked by #161
w23 opened this issue Sep 14, 2021 · 3 comments
Closed
1 of 2 tasks
Tracked by #161

Transparent surfaces (e.g. glass) look way too dark #60

w23 opened this issue Sep 14, 2021 · 3 comments
Assignees
Labels
ray tracing visual bug Visual glitches, something looks incorrectly

Comments

@w23
Copy link
Owner

w23 commented Sep 14, 2021

There are supposedly two issues:

  • Chance of refracting into surface is way too low.
  • Rays are double-attenuated by hitting the opposite brush surface from the inside.

Consider:

  • treating alpha as transmittance or something (after fresnel-based specular-vs-diffuse split)
  • doing (supposedly non-free) backface culling when tracing transmitted "inside" ray

Also, maybe read something like B. Walter, S. R. Marschner, H. Li and K. E. Torrance, "Microfacet Models for Refraction through Rough Surfaces," Rendering techniques, 2007.

@w23 w23 added bug Something isn't working ray tracing labels Sep 14, 2021
@w23 w23 self-assigned this Sep 14, 2021
@w23 w23 added visual bug Visual glitches, something looks incorrectly and removed bug Something isn't working labels Sep 16, 2021
@w23
Copy link
Owner Author

w23 commented Nov 1, 2021

This needs two more things:

  • me to figure out how to properly handle ray continuation selection (specular vs diffuse bounce vs trasmission vs light contribution)
  • possible a resource remaster e.g. to provide 2 textures for glass: specular+diffuse light, and transmissiveness.

@0x4E69676874466F78
Copy link
Collaborator

Надо это потюнить, сейчас они заметно темнее чем надо, тормозят свет и это влияет на итоговое освещение, в некоторых сценах очень заметно!

@0x4E69676874466F78
Copy link
Collaborator

Потому что

throughput *= material.baseColor;

Если закомментировать, то всё становится как надо.
Но тут ещё надо разобраться с

direction = refract(direction, payload_opaque.geometry_normal, .8);

0.8 это слишком много! оптимально в районе 95-98 и надо связать с толщиной стекла.

0x4E69676874466F78 added a commit to 0x4E69676874466F78/xash3d-fwgs that referenced this issue Dec 13, 2021
0x4E69676874466F78 added a commit to 0x4E69676874466F78/xash3d-fwgs that referenced this issue Dec 13, 2021
MaxG2D added a commit to MaxG2D/xash3d-fwgs that referenced this issue Dec 17, 2021
Original Commit from NightFox
MaxG2D added a commit to MaxG2D/xash3d-fwgs that referenced this issue Dec 17, 2021
@w23 w23 closed this as completed in 4d5dbd7 Dec 20, 2021
@0x4E69676874466F78 0x4E69676874466F78 moved this to ✅ Done in HLRT Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ray tracing visual bug Visual glitches, something looks incorrectly
Projects
Status: Done
Development

No branches or pull requests

2 participants