Blender VertexLitGeneric: Difference between revisions
m (update to v2.0 added support for rimlight and lightwarptexture) |
(update to 3.0 of the tool brings VMTgen + minor tweaks to other areas) |
||
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]] | ||
{{blender}} '''BlenderVertexLitGeneric''' allows creation of VMT-type materials within [[Blender]]. Specifically the [[VertexLitGeneric]] shader for models. | {{blender}} '''BlenderVertexLitGeneric''' 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 | |||
{{todo|Add Usage section, point out differences, add references from other pages and clean up this page}} | |||
{{todo|Add Usage section, point out differences and | |||
== Features == | == Features == | ||
* basetexture | |||
* | * bumpmap | ||
* | * envmap, with options | ||
* | * phong, with options | ||
* | * alphatest, with options | ||
* | * selfillum | ||
* | |||
* rimlight | * rimlight | ||
* lightwarptexture | * 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 | |||
; <code>BVLG = bpy.data.texts["BVLG_VMTgen.py"].as_module()</code> | |||
you can now use the following commands: | |||
BVLG.VMTgen(mat, cdmaterials, folder, mode) | |||
:; <code>mat</code> | |||
:: the name of the material to be compiled | |||
:; <code>cdmaterials</code> | |||
:: the prefix path for textures, assumed to be the same as defined in the object's [[QC]] | |||
:; <code>folder</code> | |||
:: the folder in which compiled VMTs are placed. <code>//export/</code> by default | |||
:; <code>mode</code> | |||
:: "name" if mat is a string with the name of the material, "data" if it is the python material data : <code>bpy.data.materials[]</code>. "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. | |||
{{note|having an invalid or leaving empty the $basetexture socket will not load a $basetexture in the compiled VMT whereas a blank or invalid $bumpmap will automatically load <code>/dev/normal_blank</code> if needed by phong}} | |||
BVLG.AutoVMTgen(cdmaterials, folder, mode) | |||
:; <code>cdmaterials</code> | |||
:: the prefix path for textures, assumed to be the same as defined in the object's [[QC]] | |||
:; <code>folder</code> | |||
:: the folder in which compiled VMTs are placed. <code>//export/</code> by default | |||
:; <code>mode</code> | |||
:: "name" if mat is a string with the name of the material, "data" if it is the python material data : <code>bpy.data.materials[]</code>. "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 == | == Installation == | ||
# [http://www.blender.org/download/ Install Blender 2.80 or later.] Or [steam://rungameid/365670 Install from Steam] (AppID: 365670) | # [http://www.blender.org/download/ Install Blender 2.80 or later.] Or [steam://rungameid/365670 Install from Steam] (AppID: 365670) | ||
# [https://github.com/syborg64/BlenderVertexLitGeneric Download the file on GitHub.] | # [https://github.com/syborg64/BlenderVertexLitGeneric Download the file on GitHub.] | ||
# open the .blend | # open the .blend library file | ||
# File->Defaults->Save Startup File | # File->Defaults->Save Startup File | ||
== See also == | == See also == | ||
* [[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 | * [[VertexLitGeneric]], the shader this tool recreates | ||
* [[Blender Source Tools]] for import/export of SMD/DMX files | * [[Blender Source Tools]] for import/export of SMD/DMX files | ||
[[Category:Blender]] [[Category:Material_System]] [[Category:Shaders]] [[Category:Third Party Tools]] | [[Category:Blender]] [[Category:Material_System]] [[Category:Shaders]] [[Category:Third Party Tools]] |
Revision as of 17:54, 14 March 2021
BlenderVertexLitGeneric 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
- Blender Source Tools for import/export of SMD/DMX files