LensFlare element
- Last UpdatedDec 06, 2023
- 1 minute read
Just as with geometry animations, lens flares are exported in .mwx from 3D Studio Max using a dummy user buffer.
Code example
This is a code example of lens flare with a dummy user buffer.
$LensFlare
{
iVersion = 1
szTexture = lensflare01.tga
fShowMul = 2.5
fHideMul = 2.5
iRefWidth = 1024
iRefHeight = 512
$Flare
{
fWhere = 1
fScale = 0.6
v2Pos = 512 0
v2Size = 256 256
}
$Flare
{
fWhere = 1
fScale = 0.6
v2Pos = 0 0
v2Size = 512 512
}
}
Each flare is drawn inside the texture atlas defined in the child element <texture> and is placed in a point in space on the ideal vector between the viewer position and the light source position, so that a <where> value of 1.0 corresponds to the light source position itself.
For more information, see Lens Flare (FBX).
Code example in MWX
This code would appear in .mwx format like this.
<LensFlare name="fileName|dummyName" version="1">
<translation value="-66.253494 84.680115 67.387802"/>
<texture value="lensflare01.tga"/>
<showMul value="2.5"/>
<hideMul value="2.5"/>
<refWidth value="1024"/>
<refHeight value="512"/>
<flares>
<flare>
<where value="1.0"/>
<scale value="0.6"/>
<posX value="512"/>
<posY value="0"/>
<width value="256"/>
<height value="256"/>
</flare>
<flare>
<where value="1.0"/>
<scale value="0.6"/>
<posX value="0"/>
<posY value="0"/>
<width value="512"/>
<height value="512"/>
</flare>
</flares>
</LensFlare>