You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should try to build an editor tool to auto-generate the basic outline of a metadata-styling material based on the metadata of tiles currently visible in the editor. The following steps would be needed:
A way to report unique metadata schema classes of currently visible tiles from a tileset.
For each selected, unique metadata schema class, users should be able to select specific properties that they want access to in the material.
This selection will be named and a material layer can be generated that resolves all the required property values into variables. This generated shader would sample the feature id texture / feature attribute to get the feature id and then use the feature id to index into the needed encoded property arrays to get the needed property values. The initially requested property values will now be ready to use in shader variables of the appropriate types.
Users can then edit the generated material layer with custom styling logic using the requested variables. The material layer would then be added to the tileset's custom material, with a key like "Metadata".
From what I can tell, so far this seems achievable. But this would only allow for a single styling of the metadata for an entire tileset. In reality we may have heterogeneous metadata throughout a tileset and wish (or be compelled) to style parts of the tileset differently from others. Additionally, with complicated effects like reflection, displacement, and translucency that could potentially be driven by metadata, it may be best to only apply these effects on tiles that need them. So here's a further extension of the above idea to enable that:
Different combinations of schema classes can be used to generate different materials, the schema to material mappings can exist in an atlas of sorts. Later when loading tiles, when a particular combination of metadata classes appear together, the corresponding material can be chosen and instantiated from the atlas.
Combining this material atlas idea with the existing material layers system may be a bit awkward, since each material in the atlas will need all the other same non-metadata-related material layers. Maybe we can resolve that with another automatic editor-time step that adds each auto-generated metadata layer onto a copy of a base material with existing non-metadata layers, before inserting into the metadata material atlas.
Can be built as part of #698 or as a separate PR.
We should try to build an editor tool to auto-generate the basic outline of a metadata-styling material based on the metadata of tiles currently visible in the editor. The following steps would be needed:
From what I can tell, so far this seems achievable. But this would only allow for a single styling of the metadata for an entire tileset. In reality we may have heterogeneous metadata throughout a tileset and wish (or be compelled) to style parts of the tileset differently from others. Additionally, with complicated effects like reflection, displacement, and translucency that could potentially be driven by metadata, it may be best to only apply these effects on tiles that need them. So here's a further extension of the above idea to enable that:
Reference for creating materials from C++:
https://isaratech.com/ue4-programmatically-create-a-new-material-and-inner-nodes/
CC: @kring what do you think? We can discuss more offline and update this issue.
The text was updated successfully, but these errors were encountered: