Weird shading issues. Any explanation?

If your topic doesn't fit anywhere else, put it here.

Moderator: joepal

Weird shading issues. Any explanation?

Postby thedude22 » Sat Feb 10, 2024 6:57 pm

I'm working with someone trying to get makehuman working inside Godot game engine.

We are running into various issues, but this one is really bothering me. Can someone explain it to me?

MPFB looks great in blender.

Exporting to .glb and importing into godot does not look very good. There are many shading artifacts, some of which are shown in the picture attached.

At first I thought godot shading was just bad, but...


While trying to get animations working I uploaded the same mesh to mixamo, downloaded it as fbx, imported it back into blender and exported it back into Godot. Suddenly it looks a lot better. So it's not just a Godot looks bad thing. I can't figure out what is happening. Does anyone have any ideas?
Attachments
Untitled.png
demonstration of differences
thedude22
 
Posts: 10
Joined: Wed May 10, 2017 4:25 pm

Re: Weird shading issues. Any explanation?

Postby tomcat » Sun Feb 11, 2024 12:14 pm

thedude22 wrote:I'm working with someone trying to get makehuman working inside Godot game engine.

I work with Godot, too. The reason, apparently, is that Godot doesn't understand Blender shaders very well. The complicated way of multistage export-import simplifies shaders and the engine starts to accept them normally.

In my opinion, the most reasonable thing is to make a skin shader in the engine and assign it to MH models.
Foreigners' reactions to Russian "Bird's Milk" candies
— Are your birds being milked?
— In Russia everyone is milked. Here even the zucchini is used to make caviar.
User avatar
tomcat
 
Posts: 344
Joined: Sun Sep 27, 2015 7:53 pm
Location: Moscow (Orcish Stan), The Aggressive Evil Empire

Re: Weird shading issues. Any explanation?

Postby thedude22 » Tue Feb 13, 2024 4:03 am

We may write a skin shader at some point. But this is just a basic material with white albedo. Nothing fancy. And it's the same on the mixamo exported model, so why does that one look so much cleaner? It seems like something is wrong with the normals. We do have all the shapekeys on our mesh, unlike the mixamo mesh, but they're all at 0 so they should be the same. Maybe mixamo does their own calculation to get new normals or something. But I don't understand how there can be problems with the normals that don't show up in the same mesh in blender.

By the way I think you will like our plugin when it is ready. We are exporting all (or most) of makehuman functionality directly into the game engine. No more exporting from MH. It's all available as a custom node.
thedude22
 
Posts: 10
Joined: Wed May 10, 2017 4:25 pm

Re: Weird shading issues. Any explanation?

Postby tomcat » Tue Feb 13, 2024 12:53 pm

thedude22 wrote:But I don't understand how there can be problems with the normals that don't show up in the same mesh in blender.

MPFB has a simple textured skin. Maybe it will look good in the engine.

By the way I think you will like our plugin when it is ready. We are exporting all (or most) of makehuman functionality directly into the game engine. No more exporting from MH. It's all available as a custom node.

Yeah, the plugin looks interesting. But for my project, I need the characters to grow over time.
Foreigners' reactions to Russian "Bird's Milk" candies
— Are your birds being milked?
— In Russia everyone is milked. Here even the zucchini is used to make caviar.
User avatar
tomcat
 
Posts: 344
Joined: Sun Sep 27, 2015 7:53 pm
Location: Moscow (Orcish Stan), The Aggressive Evil Empire

Re: Weird shading issues. Any explanation?

Postby punkduck » Sun Feb 18, 2024 6:37 pm

Hi

It depends on how the program deals with the shading terminator problem. Not only godot, also unreal engine fights with that (especially since real time needs to be faster than a cycles render). I guess most of them do. I have the problem as well.
You will find some tricks in the net how to fix it besides from "more vertices, less artifacts", which is normally not really the solution for a game engine, which should be fast. So then they often use an extra "artificial smoothing".

But in the end it is an effect rather well known, even by the big ones, also the math is not new:

https://media.disneyanimation.com/techn ... inator.pdf

Greets,
punkduck
User avatar
punkduck
 
Posts: 1218
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Weird shading issues. Any explanation?

Postby thedude22 » Fri Feb 23, 2024 12:38 am

tomcat wrote:
thedude22 wrote:But I don't understand how there can be problems with the normals that don't show up in the same mesh in blender.

MPFB has a simple textured skin. Maybe it will look good in the engine.

By the way I think you will like our plugin when it is ready. We are exporting all (or most) of makehuman functionality directly into the game engine. No more exporting from MH. It's all available as a custom node.

Yeah, the plugin looks interesting. But for my project, I need the characters to grow over time.

Yes this will be possible with our plugin as well. The shapekeys are all exported into Godot.
thedude22
 
Posts: 10
Joined: Wed May 10, 2017 4:25 pm

Re: Weird shading issues. Any explanation?

Postby thedude22 » Fri Feb 23, 2024 12:39 am

punkduck wrote:Hi

It depends on how the program deals with the shading terminator problem. Not only godot, also unreal engine fights with that (especially since real time needs to be faster than a cycles render). I guess most of them do. I have the problem as well.
You will find some tricks in the net how to fix it besides from "more vertices, less artifacts", which is normally not really the solution for a game engine, which should be fast. So then they often use an extra "artificial smoothing".

But in the end it is an effect rather well known, even by the big ones, also the math is not new:

https://media.disneyanimation.com/techn ... inator.pdf

Greets,
punkduck

Thank you for the info. Any idea why the mixamo exported model looks so much better??? They must have recalculated normals using some smoothing algorithm, right?
thedude22
 
Posts: 10
Joined: Wed May 10, 2017 4:25 pm


Return to General discussions about makehuman

Who is online

Users browsing this forum: No registered users and 1 guest

cron