-
Notifications
You must be signed in to change notification settings - Fork 0
/
honkai3rd.vmt
260 lines (224 loc) · 12.9 KB
/
honkai3rd.vmt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
"VertexLitGeneric"
{
//////////////////////////////////////////////////////////////////////////////////
// Version 1.10.1
// Honkai Impact 3rd preset by Debiddo
// $basetexture RGBA channels with Alpha as $color2 modulator
// $phongexponenttexture RGBA with Alpha as $rimlightmask 1 modulator
// there no need for $bumpmap (avoid use) unless for $EnvMap
// $detail RGB for HDR tonemap
// $emissiveblendenabled for glow effects
//////////////////////////////////////////////////////////////////////////////////
$model "1" // this texture is made for models, and not menu
$nodecal "0" // allow decals by default
$nocull "0" // render just the frontside, set one to also render the "inside" of the mesh
$surfaceprop "flesh" // control the decal and sound on hit; Buggy in gmod since 2018
$additive "0" // much like $translucent but ignore light
$translucent "0" // the true gradient
$alphatest "0" // set on/off $basetexture Alpha channel as transparency
$allowalphatocoverage "1" // Control AntiAliasing for alphatest
//$alphatestreference ".05" // threshold to when $alphatest is usable. Alpha transparency clip point (Almost incompatible with everything)
$basealphaenvmapmask "0" // use $basetexture Alpha channel as $envmaskmap. // NOTE: Only when no $bumpmap is present
$normalmapalphaenvmapmask "0" // use $bumpmap Alpha channel as $envmaskmap // NOTE: Not work with $basemapalphaphongmask 1 or $basemapluminancephongmask 1
$basemapluminancephongmask "1" // use luminance of the $basetexture as phong mask // BUG: Don't work for GMod
$basemapalphaphongmask "0" // $basetexture Alpha channel as phong mask
// $color and $color2 toggle
$allowdiffusemodulation "1" // allow $color / $color2 tint
$blendtintbybasealpha "0" // 1 = use $basetexture Alpha channel as $color2 mask
$blendtintcoloroverbase "0" // where to tint. 0 is under $basetexture. 1 is over the $basetexture (float 0 to 1)
$ambientocclusion "0" // does see to do nothing
$diffuseexp "1" // l4d2 diffuse exponent
$halflambert "0" // halflambert phong shading
$phongdisablehalflambert "1" // force disable halflambert, use with $halflambert 0
//////////////////////////////////////////////////////////////////////////////////
// Enable / Disable tilling
//////////////////////////////////////////////////////////////////////////////////
$ClampS "1" // Clamp S/X texture coordinates by default
$ClampT "1" // Clamp T/Y texture coordinates by default
$ClampU "0" // Clamp U/Z texture coordinates by default
//////////////////////////////////////////////////////////////////////////////////
// Textures
// the basic is $BaseTexture
// all other parameters are for optimizations and use a single material
// and a trade-off of optimizations by use more memory
//////////////////////////////////////////////////////////////////////////////////
$basetexture "vgui/white" // Diffuse or Albedo texture
//$bumpmap "dev/flat_normal" // Bump/Normal map and by default Alpha Channel is phong mask
//$phongexponenttexture "shared/lightwarp_white" // phong modulator, Red channel is exponent; Green channel as $phongalbedotint modulator; Blue channel unused; Alpha channel is for $rimlightmask 1
$lightwarptexture "shared/lightwarp_honkai3rd" // is like an diffuse color ramp
//$phongwarptexture "models/ministrider/mini_iridescence" // is like an phong color ramp
//$envmapmask "shared/generic_base" // $envmap mask modulator. Wont work with $bumpmap
//////////////////////////////////////////////////////////////////////////////////
// Color modulation
//
// $color is unsupported by models unless is Left 4 Dead or Left 4 Dead 2
// they can use $color and $color2 at same time to do different things,
// it's awesome for NPR and HDR tonemap
//
// I strong reccomend use vectors to write colors because is more precisse and will be
// color corrected by the tonemap system automatically when needed
//////////////////////////////////////////////////////////////////////////////////
//$color " [ .9 .9 .9 ] " // used to tint the Albedo, " { 255 255 255 } " default
$color2 " [ .85 .85 .85 ] " // used to tint the Albedo. " { 255 255 255 } " default
//////////////////////////////////////////////////////////////////////////////////
// Phong
// Phong is a old specular method it's good use just a small amount for a dry skin
// it computes by a exponent that is driven by a additive $phongboot and exponencial $phongexponent
// the fresnel is same as the every fresnel, that can be boosted by $phongfresnelranges
//////////////////////////////////////////////////////////////////////////////////
$phong "1" // enable phong, set zero to disable all phong and rimlight at same time
$forcephong "1" // force phong enabled even on lowend cards
$phongboost "1" // multiply phong by this value
$phongalbedotint "1" // use the $basetexture's RGB as tint value per textel
//$phongtint " { 83 85 122 } " // uncomment if you need a solid phong color and $phongalbedotint is 0
$phongalbedoboost "1" // for SFM, multiply the $phongexponenttexture Green channel by this value // NOTE: Disabled if $detail is present see: https://github.com/Facepunch/garrysmod-issues/issues/5557
//$phongexponent "10" // for override the default $phongexponenttexture's Red Channel
//$phongexponent2 "10" // for CS:GO compatibles, used in specific light sources
$phongexponentfactor "1" // multiply the $phongexponenttexture red channel by this value
$phongfresnelranges " [ 0 .256 .512 ] " // XYZ fresnel values, you can use any float values
//////////////////////////////////////////////////////////////////////////////////
// Rim Light
//////////////////////////////////////////////////////////////////////////////////
$rimlight "1" // rimlight enabled
$rimmask "1" // use $phongexponenttexture Alpha Channel as mask
$rimlightboost ".8" // multiply the rimlight by this value
$rimlightexponent "3" // multiply the rimlight fresnel by this value
//////////////////////////////////////////////////////////////////////////////////
// Env Map
// Envmap / Reflections, is recommended use a mask
//////////////////////////////////////////////////////////////////////////////////
//$envmap "env_cubemap" // The Envirovment texture. "env_cubemap" for auto. Change to make static.
//$envmapcontrast "0" // how much is multply by color*color . 0 is the "natural" value
$envmapfresnel "1" // Multiply Fresnel Envirovment by this value
//$envmaplightscale "1" // determine how much is tinted by an light source and Cubemap
$noenvmapmip "1" // disable MipMap for Cubemaps
$envmaptint " [ 1 1 1 ] " // {RGB} or [vector] values to tune EnvMap
//$envmapfresnelminmaxexp " [ 0 1 2 ] " // Override the Min, Max and Exponent Fresnel values (not compatible with $bumpmap)
$EnvMapReference ".99" // EnvMap reference used for modulate $envmaptint
//////////////////////////////////////////////////////////////////////////////////
// Detail Texture
//
// Mental Notes:
// Use with caution
// Source2013: If you use on one model's vmt, all other materials of the same mdl file should use,
// or your model will become brighter than expected at $body and $model qc parameters.
//////////////////////////////////////////////////////////////////////////////////
//$detail "shared/lightwarp_black" // here the magic, we boost the $basetexture with $detail // NOTE: Breaks $phongalbedoboost
$detailscale "1" // do not scale, and use the original size
$detailblendmode "5" // set "0" to use as decal (finetune hdr) || "5" to use as "$selfillum".
$detailblendfactor "1" // multiply the $detail by this value. like: how much the effect is in use.
//////////////////////////////////////////////////////////////////////////////////
// Emissive Blend
// NOTE: Use with caution since it double the amount of tringles being draw
//////////////////////////////////////////////////////////////////////////////////
//"GPU>=2" // necessary to avoid make the model even more expensive for no good reason
//{
// $emissiveblendenabled "1" // Since this is a game breaking change. It is disabled by default
//}
$emissiveblendbasetexture "vgui/white" // The trick is use te $BaseTexture here
$emissiveblendtexture "vgui/white" // this modulate how much effect. Note that use $BaseTexture may result into a mismatch into effect strenght but for a few cases archive a really good effect
$emissiveblendflowtexture "vgui/white" // unless you'll make animated effect leave as "vgui/white"
$emissiveblendtint " [ .33 .33 .33 ] " // how much of this effect should be tinted over the $BaseTexture " [ .1 .1 .1 ] "
$EmissiveStrength ".11" // the strength of $emissiveblendtexture ( clamped between 0.000 ~ 1.000 )
$emissiveblendstrength ".1" // This is the actual strenght for Emissive effect, however it'll be over writen by $EmissiveStrength value
$emissiveblendscrollvector " [ 0 0 ] " // X Y animation scroll speed
//////////////////////////////////////////////////////////////////////////////////
// Proxie Parameters
//////////////////////////////////////////////////////////////////////////////////
// cache Light
$Lighting ".5"
// addiive boost the character ilumination by this ammount (default: 1)
$LightingBoost ".972" // It uses median of the most "real world" albedo value, Snow. As (R+G+B)/3
// clamp light for $color NOT $color2 and avoid make the model complete dark without when $emissiveblendenabled "1"
// TODO: write a dynamic warp and solve the clamp waste amount
$MinLighting ".8"
$MaxLighting ".972"
// just store a simpler variable for pupil light modulation
// it behave like a ramp smoother for dark/light ambients
// appear that .073 is our Open/Brighter magic number and 0.4 our Close/Darkener magic number
$PupilOpenRate ".073" // referece values: 1.1 (fast) || .3 (slower)
$PupilCloseRate ".4" // referece values: 1.1 (fast) || .3 (slower)
// Store some dummy color variables, Don't touch it
$zero ".0"
$one "1.0"
$clr ".0"
$dummy ".0"
$Half ".5"
$Quarter ".25"
$LightingHalf ".0"
$LightingQuarter ".0"
$LightingWarped ".0"
$MinEmissive ".0"
//////////////////////////////////////////////////////////////////////////////////
// Proxies
// Proxies are like code the VMT to have dynamic behaviours
//////////////////////////////////////////////////////////////////////////////////
Proxies {
Pupil {
TextureVar $basetexture // try get luminance from lightwarp
TextureFrameNumVar $dummy // as the name says just store this number for no reason
PupilCloseRate $PupilOpenRate
PupilOpenRate $PupilCloseRate
}
Multiply {
srcVar1 $Half
srcVar2 $Lighting
resultVar $LightingHalf
}
Subtract {
srcVar1 $LightingBoost
srcVar2 $LightingHalf
resultVar $clr
}
// We don't need Clamp, since EmissiveBlend is our "clamp", this is a safier method if $emissiveblendenabled "0"
Clamp {
min $MinLighting
max $MaxLighting
srcVar1 $clr
resultVar $color2
}
// Emissive is supposed to take a small, but important role by default
Multiply {
srcVar1 $EmissiveStrength
srcVar2 $EmissiveStrength
resultVar $MinEmissive
}
Multiply {
srcVar1 $Lighting // Uses Raw value from $Lighting
srcVar2 $EmissiveStrength // Our base Strength for Emissive effect
resultVar $emissiveblendstrength // Send the modulation to EmissiveBlendStrength
}
Clamp {
min $MinEmissive
max $MaxLighting
srcVar1 $emissiveblendstrength
resultVar $emissiveblendstrength
}
// creatre quarter light to modulate EnvMapLight
Multiply {
srcVar1 $Quarter
srcVar2 $LightingHalf
resultVar $LightingQuarter
}
// Normalize 0 .. 1
//Clamp {
// min $zero
// max $one
// srcVar1 $LightingQuarter
// resultVar $LightingQuarter
//}
// Note: WarpMinMax don't exist in L4D2
WrapMinMax {
minVal $zero
maxVal $one
srcVar1 $Lighting
resultVar $LightingWarped
}
// EnvMap here is lying for when required
Multiply {
srcVar1 $LightingQuarter // Re uses half-lighting
srcVar2 $EnvMapReference // Our base Strength for EnvMap effect
resultVar $envmaptint // Send the modulation to $envmaptint
}
}
}