ruyo / VRM4U

Runtime VRM loader for UnrealEngine5
Other
1.37k stars 178 forks source link

Material mess, updated and improved. #151

Open Master-Dinochan opened 2 years ago

Master-Dinochan commented 2 years ago

Hello there! The base material function is a very messy in the default plugin, we tried to fix it by separating the logic into separate modules, to make it clean and easy to edit and customize.

Just look and compare, before and after screenshots.

BEFORE. image

AFTER. image

All the features and code of materials are the original, we just separated it and cleaned the code into separate modules, please reply if you need this fix, we tried to improve the system for everyone.

We hope if you would like to, we can send the updated files, so you could apply the fixes in the future plugin versions.

ruyo commented 2 years ago

Thanks for the suggestion.

I have always wanted to organize this node as well. However, I think the problem with dividing them into modules like this is that it becomes very difficult to see which parameters are used where. I think this is a problem with the material editor.

Furthermore, I am wondering how many people would edit the material if the nodes were organized. I think it would be good to add a function after this MaterialFunction, like M_VrmMToonBaseOpaque.

In the future I would like to organize this using a NamedReroutes node. However, currently I cannot use this node for supporting older UE4.

Thanks.

Master-Dinochan commented 2 years ago

Well thanks for answer.

Just to clarify, there is many advantages of using multiple modules, with this approach there is much faster compiling and editing times, when modifying and saving the material logic.

The needed parameters can be also categorized per material function, besides it's also much faster to open and navigate through small modules, they are separated into logical categories, it does not loads the editor as a big material.

And also what do you mean by supporting older UE4? Material functions should work fine in any newer engine versions, this is made in 4.24.3 But yes, it won't work in versions older than 4.24.3

We wanted to know once we will decently polish the code, if we can post here the materials for the download, for anyone who needs just the editable materials setup? or there is a better place to do so?

Since you are the author of the original code, we should ask you.

ruyo commented 2 years ago

Yes, I understand the advantages of modularization. However, I think there is a problem with finding and accessing material parameters. If there is a problem with a particular parameter, how do you access the relevant part? Do you do a full text search every time? Since it is an inefficient process, I have not modularized them.

This reduces the readability of the nodes. But since I haven't heard any requests to customize this node, I don't feel it's a particularly big issue. It is possible to use it like M_VrmMToonBaseOpaque.

The NamedReroutes node I am thinking of using for organizing is valid since UE4.27. So I am considering support for older UE4.

You may post your materials here. You may also publish them on Epic's Dev Community if you can post a link to github. It might be more useful for many people.

Thanks!

Master-Dinochan commented 2 years ago

Hello again, we finished the material organization and cleanup, also thank you again for all the great work. Later we will also post the material to the Epic Community as you advised.

Here are the download links. VRM Shader Only Link - https://bit.ly/3MuZCpk VRM Shader 4.24+ Project Link - https://bit.ly/3PzQvFY

We also made a quick video by including all the links in the description, with the mention of you and your plugin, please check if everything is fine.

https://www.youtube.com/watch?v=DcrUOoBlY7I