Add fail-safe mode if running on a platform that doesn't support disassembling shaders (some versions of Wine seem to support it, others not): still allow inspecting and editing the parts that don't require disassemblies, only disable the parts that do ;
Rearrange some of the data from "Further Content" into new sections "Shader Resources" and "Shader Selection".
Materials tab
Color Sets
Add a header, that is unfolded by default, but allows folding the entire section ;
Add a "Dyeable" check box that turns a non-dyeable color set into a dyeable one and conversely ;
Add a crosshair "button" that, on hover, attempts to make the corresponding row blink on your character, weapons, fashion accessory, minion and/or mount ;
Make the Gloss Strength slider non-linear (by hand instead of using ImGui's logarithmic slider flag because it behaves badly when min and max are too far away) ;
Make the Paste All Rows button disabled when the file is read-only ;
Improve small things on most fields (bound checks, formatting, …) ;
Remove the dye columns entirely when the color set is not dyeable ;
Assume, for some purposes, that there is at most one color set with rows, as the client's structures do not allow for more ;
See also "Live Preview" and "Shaders".
Live Preview
Add a live preview system on materials:
When opening a material file, it attempts to bind to instances of this file on the local player, including weapons, fashion accessory, minion and/or mount ;
Shader Flags (and the checkboxes for parts of this field) will be reflected in real time ;
Sampler Flags (and the new sub-fields for parts of this field) will be reflected in real time ;
Color Set will be reflected in real time – Selecting a preview dye will apply it on the live preview ;
Material Constants will be reflected in real time ;
Ending the editing session (by choosing another material, or closing the editor window) will revert the material to its state before the editing began ;
Making the changes permanent still requires a save and redraw/rezone/… ;
Known issue: it seems that, in some cases, ending the editing session after saving and redrawing can turn the material into some combination of the before and the after, stable but looking wrong – Redrawing/rezoning/… again fixes it for good. (should be fixed by 5346abaadf34171d81a0525f16e44d1437eb2a9b)
Samplers and Textures
Add a header, that is unfolded by default, but allows folding the entire section ;
Make the texture rows unfoldable: unfolding them will show the Texture and Sampler Flags ;
Add a checkbox for the only useful bit of the Texture Flags (namely, the -- prefix on DX11) ;
Add clearer fields for the known useful bits of the Sampler Flags (UV Address Mode, LoD Bias, Min LoD) ;
Give a default path to all added textures, that points to an actual vanilla texture, to avoid crashes due to path-less textures ;
See also "Live Preview", "Shaders" and "Dev-Kit Files".
Shaders
Rearrange the fields into their own section ;
Replace the Shader Package free text field by a list box:
The box gives choices that are pulled from the EXE ;
Some shader packages are hidden from this list because they cause issues, and they don't seem to be intended for use in materials ;
More choices will be dynamically pulled from the current collection and mod by looking at file redirections that start with shader/sm5/shpk/ ;
Rework the algorithm that determines which shaders are actually gonna be used depending on shader keys: the new algorithm gives an authoritative result ;
Treat the material as invalid if the shaders cannot be determined for sure (which indicate a combination of shader keys that can result in game crashes) ;
Automatically add and remove color set, sampler/texture pairs, shader keys and material constants depending on the needs of the selected shaders – Consequently, the buttons to add and remove them by hand have been removed, thereby preventing crashes due to missing samplers for the selected shader ;
See also "Dev-Kit Files".
Material Constants
Rearrange the fields into their own section ;
Add various editor components that can display and edit constants in several ways (floats, integers, colors, enums) ;
See also "Live Preview", "Shaders" and "Dev-Kit Files".
Dev-Kit Files
Add a system where JSON files can be installed to provide editing context:
Example: MDK.zip – This is a PMP, GitHub doesn't allow non-well-known extensions ;
Two paths will be looked up: penumbra/shpk_devkit/{ShPk name}.json (for example, for character.shpk, …/character.json) and penumbra/shpk_devkit/_base.json ;
These files can provide user-friendly labels and :information_source: tooltips for shader keys (and their values), textures/samplers, constants (and their values, in the case of enums) ;
They can provide a shader comment that will be displayed below the list of selected shaders, for example to explain what the shader set is usually for, or its vertex paint semantics ;
They can provide more sensible default texture paths for specific samplers ;
They can provide configuration for constants (slices, show/hide, type, editor component settings, enum values) ;
They can group related constants together ;
If both files exist and contain data about the same element, the ShPk-specific one takes precedence ;
All the data elements (except the shader keys themselves) have access to the shader key values, to be able to provide better shader-specific context (for example, in skin.shpk, lip-specific constants are only relevant for the face shaders).
See also https://github.com/Ottermandias/OtterGui/pull/3 and https://github.com/Ottermandias/Penumbra.GameData/pull/1.
Shaders tab
Materials tab
Color Sets
Live Preview
Known issue: it seems that, in some cases, ending the editing session after saving and redrawing can turn the material into some combination of the before and the after, stable but looking wrong – Redrawing/rezoning/… again fixes it for good.(should be fixed by 5346abaadf34171d81a0525f16e44d1437eb2a9b)Samplers and Textures
--
prefix on DX11) ;Shaders
shader/sm5/shpk/
;Material Constants
Dev-Kit Files
penumbra/shpk_devkit/{ShPk name}.json
(for example, forcharacter.shpk
,…/character.json
) andpenumbra/shpk_devkit/_base.json
;skin.shpk
, lip-specific constants are only relevant for the face shaders).