Blender VertexLitGeneric: Difference between revisions
(update to 3.0 of the tool brings VMTgen + minor tweaks to other areas) |
m (Added "Shader Name" tmpl) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
[[File:Blender-combineusingVertexLitGeneric.JPG|thumb|The hl2 combine soldier using BlenderVertexLitGeneric]] | [[File:Blender-combineusingVertexLitGeneric.JPG|thumb|The hl2 combine soldier using BlenderVertexLitGeneric]] | ||
{{ | {{blendervertexlit|4.1}} allows real time creation of [[VMT]]-type materials within [[Blender]]. Specifically the {{Shader_Name|VertexLitGeneric}} shader for models. | ||
it also comes with an experimental VMT compiler named VMTgen | it also comes with an experimental VMT compiler named VMTgen | ||
Line 68: | Line 68: | ||
* [[Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type|Materials for models]] | * [[Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type|Materials for models]] | ||
* [[VertexLitGeneric]], the shader this tool recreates | * [[VertexLitGeneric]], the shader this tool recreates | ||
* [https://git.sr.ht/~b5327157/tf2-blender/tree/HEAD/VertexLitGeneric.md VertexLitGeneric OSL], an alternative Blender shader for the Cycles ray-tracing engine | |||
* [[Blender Source Tools]] for import/export of SMD/DMX files | * [[Blender Source Tools]] for import/export of SMD/DMX files | ||
{{sdktools|0}} | |||
[[Category:Blender]] [[Category:Material_System]] [[Category:Shaders]] [[Category:Third Party Tools]] | [[Category:Blender]] [[Category:Material_System]] [[Category:Shaders]] [[Category:Third Party Tools]] |
Latest revision as of 08:43, 13 May 2025
Blender VertexLitGeneric allows real time creation of VMT-type materials within Blender. Specifically the
VertexLitGeneric
shader for models.
it also comes with an experimental VMT compiler named VMTgen
Features
- basetexture
- bumpmap
- envmap, with options
- phong, with options
- alphatest, with options
- selfillum
- rimlight
- lightwarptexture
VMTgen
VMTgen is a command working with BVLG to automatically compile a VMT from the current setup
it exports a file for each material, automatically naming the file with the name of the blender material it is derived from, and places them in a specified folder (//export/) by default
a cdmaterials string must be specified, and texture paths are assumed to be cdmaterials + name of the texture with the extension removed.
Usage:
to use VMTgen, open up a python console or head to the scripting workspacethen activate the script with
BVLG = bpy.data.texts["BVLG_VMTgen.py"].as_module()
you can now use the following commands:
BVLG.VMTgen(mat, cdmaterials, folder, mode)
mat
- the name of the material to be compiled
cdmaterials
- the prefix path for textures, assumed to be the same as defined in the object's QC
folder
- the folder in which compiled VMTs are placed.
//export/
by default mode
- "name" if mat is a string with the name of the material, "data" if it is the python material data :
bpy.data.materials[]
. "name" by default
- to compile a single material
- An invalid setup may give unexpected results. a VMT will be generated as long as there is a VertexLitGeneric node directly connected to the material output
- It must strictly comply with the way BVLG is intended: node links can only be in sockets marked [texture] and must be directly tied to a texture.

/dev/normal_blank
if needed by phongBVLG.AutoVMTgen(cdmaterials, folder, mode)
cdmaterials
- the prefix path for textures, assumed to be the same as defined in the object's QC
folder
- the folder in which compiled VMTs are placed.
//export/
by default mode
- "name" if mat is a string with the name of the material, "data" if it is the python material data :
bpy.data.materials[]
. "name" by default
- to compile all materials with a suitable Node setup
- the tool will cycle through all materials loaded in the blender file, but only attempt to compile those that have a VertexLitGeneric node present
limitations
- VMTgen currently only supports leftward propagation of BVLG nodes. Simply put, lightwarp and alphatest are completely ignored.
- Due to inaccuracies in BVLG, the compiled material may look different to the one seen in blender. I can only apologize until these inaccuracies are fixed.
- Anything more complicated than a direct texture or field has not been implemented, so even if it seems obviously feasible it just won't work any other way, yet.
- Textures and VMT files still have to be manually placed in the correct folders.
Installation
- Install Blender 2.80 or later. Or Install from Steam (AppID: 365670)
- Download the file on GitHub.
- open the .blend library file
- File->Defaults->Save Startup File
See also
- Materials for models
- VertexLitGeneric, the shader this tool recreates
- VertexLitGeneric OSL, an alternative Blender shader for the Cycles ray-tracing engine
- Blender Source Tools for import/export of SMD/DMX files
|