mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-01 17:37:13 +00:00
feat(ugc): opt-in metal and glow shader groups in made models
Player models are multishader (RenderComponent shader 100): the client wraps each NiLODNode and draws it with the mapShaders id in its name. With shader_metal, shader_brushed or shader_glow set, the opaque bricks are split by look into S<id>_Metal_Model, S<id>_Brushed_Model and S<id>_Glow_Model beside S01_Opaque_Model and S01_Alpha_Model, each with every LOD level. Metal is LU Toolbox's metallic colors plus Materials.xml types (shinySteel; brushedSteel and matteSteel for brushed), glow its glow colors. Glow shapes get an emissive material (glow_emissive) and their plain color, not the baked one. Transparent glow stays in S01_Alpha. All off by default, which writes the same bytes as before (tested). Not how live looked; models already made change only when made again. The icon renderer reads the groups back by tag and draws glow at its plain color and metal with a tinted reflection and highlight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,19 +26,20 @@ namespace UgcBricks {
|
||||
std::vector<uint32_t> indices;
|
||||
};
|
||||
|
||||
// An LDD material: sRGB color and opacity, 0-255
|
||||
// An LDD material: sRGB color and opacity, 0-255, and its MaterialType (shinyPlastic, shinySteel, glitter, ...)
|
||||
struct Material {
|
||||
uint8_t r{ 160 };
|
||||
uint8_t g{ 160 };
|
||||
uint8_t b{ 160 };
|
||||
uint8_t a{ 255 };
|
||||
std::string type;
|
||||
bool Transparent() const { return a < 255; }
|
||||
};
|
||||
|
||||
// A .g file ("10GB" magic, counts, positions, normals, texture coordinates for decorated parts, indices)
|
||||
std::optional<Geometry> ParseGeometry(std::string_view data);
|
||||
|
||||
// Materials.xml: MatID -> color
|
||||
// Materials.xml: MatID -> color and type
|
||||
std::map<uint32_t, Material> ParseMaterials(std::string_view xml);
|
||||
|
||||
// A file from a zip archive (stored or deflated), matched without regard to case; nullopt when it isn't there
|
||||
|
||||
Reference in New Issue
Block a user