StjerneIdioten / I3D-Blender-Addon

Rewriting the I3D blender addon from scratch and adding long-sought community features
GNU General Public License v3.0
66 stars 18 forks source link

Explicit texture properties for use with custom shaders #41

Closed kbrandwijk closed 4 years ago

kbrandwijk commented 4 years ago

Is your feature request related to a problem? Please describe. It's impossible to effectively export materials that use a different shader in Blender than Principled.

Describe the solution you'd like Ideally, I'd like to be able to manually specify the texture paths specifically for export. Can be part of #3 to be able to specify this. That way, if I use a custom shader, the exporter wouldn't try to 'find' the textures in the shader, but just use whatever I specify. I took inspiration for this FR from the SCS tools, where there's also a custom shader, but at the same time custom property fields for the standard texture properties (albedo, specular, normal).

Describe alternatives you've considered

Additional context image In the screenshot, you see both the shader selection (similar), the material attributes (things similar to bump depth, albedo color etc. in GE in the material panel, and the textures.

StjerneIdioten commented 4 years ago

I am probably not gonna add support for anything but the Principled BSDF(anytime soon at least), since in the end whatever you chose inside of blender has to be converted into something that GE understands (Which isn't much)

What you might be missing (Which is due to my lack of documentation) is that it is actually already possible to specify an Albedo, Normal and Gloss texture that gets exported into i3d along with the model data. You have to use a BSDF and setup your nodes tree in the following way:

image The glossmap node is wrong in this picture, the following is how it should really be setup. It checks the shader tree for that specific node name and exports the image texture.

image

Most of it is fairly obvious, the only "weird" thing is that you need to rename a SeparateRGB node into "Glossmap". The reason for this is that this gives you an oppertunity to feed the 3 different layers of the glossmap into the BSDF, to sort of see what it looks like in blender, while still being able to export it as one file for use in GE.

And for the whole shader selection thing I am currently working on getting that up and running so you are able to essentially do whatever you are able to do inside of GE itself, but just in blender. Which is both setting shader variation, properties and textures.

ssnd292 commented 4 years ago

Why would you want that? Theres no use in exporting other shaders than Principled BSDF? As @StjerneIdioten already showed you can export the maps already and they come out fine.

This also works with textures from the /data folder

kbrandwijk commented 4 years ago

There definitely is a use case to want that ssnd292. You can use any shader in GE you want, so there's plenty of scenarios for wanting a different shader in Blender (for starters, I'll have the buildingShader and vehicleShader from GE into Blender soon to make things look the same in Blender). But I also use a variety of custom shaders in GE that have different properties.

That's besides the point though. The only thing I wondered was getting 3 explicit properties for the textures. If you want to use the Principled shader, and specify them like that, that's fine, all I'm looking for is a way to be able able to explicitly set my textures and (custom) shader properties in Blender, instead of having to do it on every export in GE. Just a flat key/value dictionary is all you'd need for that.

StjerneIdioten commented 4 years ago

And I am currently working on exactly that, except it is not just gonna be a "flat key/value dictionary" but something a bit more elaborate that hopefully makes it easier for the user as well. I am gonna close this issue though and direct any further discussion to the already existing issue #3 that is quite similar.