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

Exporting textures - 3.6 changes the texture while 4.2 does not #2387

Open
ronh991 opened this issue Oct 27, 2024 · 11 comments
Open

Exporting textures - 3.6 changes the texture while 4.2 does not #2387

ronh991 opened this issue Oct 27, 2024 · 11 comments

Comments

@ronh991
Copy link

ronh991 commented Oct 27, 2024

Describe the bug
Having a texture node going to a separate RGB node and placed into a group node, and then to roughness and metallic in BSDF. Exporting this as a gltf and having the texture also exported. In Blender 3.6.5 3.6.10 and 3.6.16 and 3.6.17 the texture gets changed to all white, while I do the same in 4.2 and works as expected.

To Reproduce
Steps to reproduce the behavior:

  1. set up texture node to separate node to BSDF with channels going to roughness and metallic - set the texture node to non-color - set a group node (non group nodes do not have this issue)
  2. export as glTF - with texture folder ../texture ( do not overwrite same folder)
  3. compare the source texture to the texture saved in the ../texture folder
  4. See difference

Expected behavior
The texture should NOT be modified.
Screenshots
If applicable, add screenshots to help explain your problem.

.blend file/ .glTF (mandatory)
test_omr_compissue_2.zip

texture from source in both scenarios

DA40CGDFQ_2024 10 27_9h45m59s

3.6 export texture is test_comp.png

DA40CGDFQ_2024 10 27_9h46m39s

4.2 export

DA40CGDFQ_2024 10 27_9h47m5s

3.6 shader nodes

DA40CGDFQ_2024 10 27_9h52m5s

4.2 shader nodes

DA40CGDFQ_2024 10 27_9h51m18s

Version

  • OS: windows 10
  • Blender Version 3.6.5, 3.6.10, 3.6.16, 3.6.17 not working 4.2.3 working

Additional context
Please, This is a huge problem for a lot of MSFS developers, as they use 3.6 and we cannot use 4.2 with all the breaking changes - as I have reported in my previous issues.

@ronh991
Copy link
Author

ronh991 commented Oct 27, 2024

Update 3.2 and 3.3 does not have this issue.

@julienduroure
Copy link
Collaborator

Hello,
Thanks for the report.
I will have a look on it soon.

Another related topic: Is there still some issue regarding 4.2 that are not solved regarding hooks & MSFS?
Could be great to spend time on it, to be sure you are not stuck on 3.6 forever.
Can you please open a new ticket with all remaining issues?

@julienduroure
Copy link
Collaborator

Hello,
Based on your node tree, no occlusion is provided, so Red channel of the image is not used.
That means, that, strictly for glTF specification, both are OK.

About perf:
Having the red channel from the original image let you have the image unchanged, that should be better for perf (using _is_happy path). This still need to be confirmed.

About MSFS:
Not sure how this impact your changes, but any Red channel should be ignored, because there is no occlusion.
Now, I know that you have lots of hooks, and maybe this leads to inconsistancies. I don't have any real vision of what you are using. That leads to my previous request to have a complete overview of your hook work, and remaining problems.

@ronh991
Copy link
Author

ronh991 commented Oct 30, 2024

Thanks for looking into this. The strange thing is that 4.2 works fine - WITHOUT the MSFS hooks and code, 3.6 does not. my test is a simple cube with only the Khronos glTF code enabled. It also works fine WITHOUT the grouping of the node - it's the group nodes version that does not work. perhaps a Blender issue with inputs and outputs for group nodes.

As to my other issues with 4.2, I have been able to get around the neutral_bone naming and the Opaque/Blend issues from before.

Here is my hook code for 4.2

msfs_export_42.zip

Here is my hook code for 3.6
msfs_export_36.zip

@julienduroure
Copy link
Collaborator

Hello,
Can you please send me your original test_comp.png file, as I want to be as close as possible to your test case? Your texture file is not packed inside the .blend file. Seems I am not able to reproduce for now.

As to my other issues with 4.2, I have been able to get around the neutral_bone naming and the Opaque/Blend issues from before.

So, no more issue preventing upgrading to 4.2?

@ronh991
Copy link
Author

ronh991 commented Oct 31, 2024

Here is the texture - also note it's only in a group node.
test_comp2.zip

DA40CGDFQ_2024 10 31_10h9m52s

@ronh991
Copy link
Author

ronh991 commented Oct 31, 2024

Here's what happens when you make a group Node

https://youtu.be/pMi94r_6f10

@julienduroure
Copy link
Collaborator

Hello,
Traversal of node groups was added only in 4.1, so it can't work properly in previous version.
Policy of backporting to LTS is to backport only crashes and regression, not new feature.

You will not be able to see your texture correctly in 3.6

@ronh991
Copy link
Author

ronh991 commented Nov 1, 2024

Thanks for your time spent on this and confirmation of this issue. ASOBO has proposed a work around.

@julienduroure
Copy link
Collaborator

Before closing this ticket, I want to be sure that there is no blocker on my side to let you update to 4.2+ versions?

@ronh991
Copy link
Author

ronh991 commented Nov 1, 2024

The issues I have presented have been resolved or have work around code. So going to 4.2 should not be an issue however MSFS is evolving to 2024 version where new ASOBO extensions/features will be added. I am testing those now.

This ticket can be closed.

The neutral bone issue has a work around - I have not tested your fixes.
The Blend OPAQUE issue has a work around also.

There is no reason yet that a 4.2 version of ASOBO's MSFS glTF exporter cannot be used.

I don't work for ASOBO, just a crazy dev user, trying to get on the bleeding edge of technology.

The only concerning part in the existing code is how we export an image and get the texture_info - we currently add a fake BSDF node and directly connect a temp image texture node to the proper input based on base color, ORM, normal.

We use your gather_texture_info and gather_material_normal_texture_info_class

There is a complicated node structure that sometimes have two textures that combine to input to base color - gather_texture info does not work because of all the other nodes. Is there a better way to expore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants