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

Convert bump maps to normal maps #651

Closed
wants to merge 6 commits into from
Closed

Conversation

andybak
Copy link
Contributor

@andybak andybak commented Mar 12, 2024

Supercedes #534 - I've added an editor script that (hopefully) exports the normal maps exactly as Unity sees them internally.

@andybak andybak requested review from mikeage and mikeskydev March 12, 2024 10:41
@andybak andybak changed the title Editor script and converted maps Convert bump maps to normal maps Mar 12, 2024
@andybak andybak requested a review from NicholasLiang March 17, 2024 11:12
@NicholasLiang
Copy link
Collaborator

The following is a screenshot on a simple material on a plane that use the old and the new normal map on a simple default material
normal
expectedNormalPreview
I have an idea that may work. We can screen capture the normal map generated from Unity inspector and use that.
normal2

@andybak
Copy link
Contributor Author

andybak commented Mar 17, 2024

@NicholasLiang - let me double check something first.

@andybak
Copy link
Contributor Author

andybak commented Mar 17, 2024

@NicholasLiang Take a look now. I changed the algorithm and hopefully the data is correct..

@andybak andybak marked this pull request as ready for review March 18, 2024 09:19
@andybak
Copy link
Contributor Author

andybak commented Mar 18, 2024

Now we have "real" normal maps we can fix our gltf shaders to not apply an unnecessary bump to normal conversion.

The problem is that any code out there that has it's own copy of our shaders but makes use of the supplied texture maps will be wrong.

@mikeskydev - you know more about this side of things. Can you help me think this through? Does your three.js code use the textures but it's own copy of the shader code?

@andybak andybak marked this pull request as draft March 19, 2024 16:34
@andybak
Copy link
Contributor Author

andybak commented Mar 19, 2024

Marking this as draft. I am beginning to think we should keep both sets of normal maps. The old ones can go in the legacy GLTF folder and the new ones can go everywhere else.

@mikeskydev
Copy link
Member

mikeskydev commented Mar 27, 2024

@andybak my three.js plugin ships with it's own set of textures (see https://github.com/icosa-foundation/three-icosa/blob/main/brushes/OilPaint-f72ec0e7-a844-4e38-82e3-140c44772699/OilPaint-f72ec0e7-a844-4e38-82e3-140c44772699-v10.0-BumpMap.png) so any changes to textures in unity shouldn't affect that side, but should test!

Also need to make sure the unity toolkit is sorted?

@andybak
Copy link
Contributor Author

andybak commented Mar 27, 2024

Also need to make sure the unity toolkit is sorted?

Yes. I can cover that.

How about Icosa upload? it seems to require the textures for a valid upload. (at least when I tested it the other week for the competition stuff)

@mikeskydev
Copy link
Member

Oh! If Open Brush changed from the external tilt brush texture references to local references, that might have confused the URI rewriter. I can get that fixed.

@andybak
Copy link
Contributor Author

andybak commented Mar 27, 2024

I've merged this into #573 as it should really be merged at the same time as that.

@andybak andybak closed this Mar 27, 2024
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

Successfully merging this pull request may close these issues.

3 participants