REDxEYE / SourceIO

SourceIO is an Blender(3.4+) addon for importing source engine textures/models/maps
https://discord.gg/XJvhzaXZf3
MIT License
644 stars 59 forks source link

Source1 Material Loader Overhaul #287

Closed hisprofile closed 7 months ago

hisprofile commented 7 months ago

General

Self-shadowing bump maps

Code to convert ss-bump maps to normal maps has been implemented, courtesy of rob5300

WorldVertexTransition

Two-layer detail

Support for one or more detail layers have been added

Loading SS bump maps

Now calls to load and convert ss bump maps if any

BlendModulateTexture

Now loads $blendmodulatetexture's to add detail to blending between two textures, using a texture instead of a linear blend

New

Old

DecalModulate

Proper implentation

Instead of using a pBSDF and plugging in the texture, the texture is now set to Non-Color, scaled by two and plugged into a Transparent BSDF for a proper implementation.

New

Old

LightMappedGeneric

Support for detail

Support for one or more detail layers have been added

Loading SS bump maps

Now calls to load and convert ss bump maps if any

New

Old

detail.py

Support for two layer detail

A new function was created to handle the second detail layer, if any. Called by self.handle_detail2

New (dz_sirocco)

Old

utils/texture_utils.py

Proper reusing of textures

Texture paths as posix are now saved as a custom property. When calling check_texture_cache, it will go through all images and check if an image has the same path. If true, then reuse.

BlenderVertexLitGeneric

$DetailBlendMode0

Proper implementation. Detail textures are scaled by two and then multiplied onto albedo

Removed default envmap

The default envmap messed with creating asset previews for objects. Instead, an input for an envmap mask has been created on VertexLitGeneric, and a new node group was added to map out the environment map.

New

Old

Suggestions

Store skin groups as material bpy.data.materials instead of strings. This works with a dictionary as a custom property and is better to use when exchanging skins.