Fix socket indices of Principled BSDF node #2606
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apparently, Blender changed the Principled BSDF sockets a second time between 3.0-3.3 without a note in the release notes, at least I can't find it anywhere.
This PR fixes parsing normals and emission values. Emission is still pretty broken since we have no space left in the gbuffers to save any emission color (#1774), and I don't think that we can fix it without a 3rd render target. However, this would mean that either the 3rd render target would be bound all the time during mesh rendering, or we'd need to sort the meshes each frame to prevent to many context switches and maybe also bandwidth issues (I'm not sure what affects the bandwidth in what way, more specifically where it matters). @ luboslenco do you have an opinion on this? I think the current emission support is a problem, but I can also understand if you say that improving it would waste too much performance.
Here's a comparison between Blender and Armory, the cubes on the left use the Principled BSDF node, and the cubes on the right use the emission node. If you want I can add this file to the armory_calibration repo, but as you can see it doesn't completely work yet:
Off-topic: what exactly is
rp_render_to_texture
supposed to do/solve? There's a bug with transparency if this flag is disabled, I found two possible fixes and my decision about what fix to choose depends on what this flag does.