Hello again. This thing is back on my task list again. And I want to figure it out. But to be honest, I am not sure how to achieve it.
So I will explain it a bit further.
I created a platform where you can upload your own model, and you can choose if you want to work with StandardMaterials or PBR Materials. So basically each material on the model can be one of two.
So in the case of PBR Materials you can work with the inputs (something similar as on Sketchfab). So you can add Albedo texture, Bump…etc. That part is simple enough as I only need to add the texture path to the proper inputs. But in the case of Roughness that’s not possible. So as mentioned above, I want to somehow create ORM texture.
There are several issues (except the one where I don’t know how to do it xD).
You can see on image that I have inputs for all of those textures, which should affect the model in real-time (some delay is okay, but effectively when user uploads a textures, the model should be affected).
You touched on the NME here, and that sounds like good idea, but I am not sure how to merge these textures into one image, and then connect it to the metallicTexture channel of the PBR Material.
Even if I do that, how to make it somewhat real-time? For example, if I input only AO map, what should I do with the roughness and metallic (just leave them as black?). On any change on the maps composition from the user, I need to update the final ORM map. If the user hits save after he is satisfied, then the map is saved as jpg/png on the storage. So basically, I am thinking that I need to somehow render and update the map on the canvas for example, and use the url data from the canvas as preview on the model, and on save button I can download and store that data into some format.
So basically, I cannot just use NME and create everything and use that shader on the model. I need to get image and use it as input into one map channel (metallicTexture) of the existing shader (PBR).
Any ideas and explanations would be helpful, as I am kinda stuck on this.