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

Various export fixes for subsurface scattering #2450

Merged
merged 3 commits into from
Mar 8, 2022

Conversation

MoritzBrueckner
Copy link
Collaborator

  • The "Auto" option for SSS could lead to a missing sssWidth variable in the shader which is one of the issue mentioned here: Just few bug pictures #2136
  • If multiple SSS nodes were present in a material but the first to be parsed was not used, the shader didn't use SSS. It's still far away from Blender's subsurface scattering, but it's a bit more reliable now.
  • When compiling with SSS disabled and then setting it to "Auto" without clearing the cache, it could happen that the generated materials didn't activate SSS because the _SSS flag wasn't set. I'm not completely happy with the solution, but I'm not yet confident enough with the material exporter code to be able to refactor the code in a way that prevents the dependency/order issues that can happen. It might be a good idea to first check all the requirements of a material, store them temporary with the material and only then create the shaders.

@luboslenco Do you remember why the material ID is handled via a uniform whose value is defined during export (see this and this)? Is it for context variants or to be able to merge similar shaders for less context switches?

@MoritzBrueckner MoritzBrueckner added the Release Notes: Fixes A pull request that fixes something. Used to generate release notes. label Mar 7, 2022
@luboslenco luboslenco merged commit 9b90626 into armory3d:master Mar 8, 2022
@luboslenco
Copy link
Member

Thanks!

Is it for context variants or to be able to merge similar shaders for less context switches?

Yeah looks like it was done for less context switches.

@MoritzBrueckner MoritzBrueckner deleted the fix-sss branch March 8, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes: Fixes A pull request that fixes something. Used to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants