Env lensflare: Difference between revisions
MyGamepedia (talk | contribs) (Added issue that was found by some user in BMBS, hope that people learn from other people's mistakes) |
MyGamepedia (talk | contribs) No edit summary |
||
Line 191: | Line 191: | ||
| [[File: 3DSKYFLAREBUG.gif|.gif | frame | left | 225px | Example with rocket flare (the rocket is in 3D Skybox).]] | | [[File: 3DSKYFLAREBUG.gif|.gif | frame | left | 225px | Example with rocket flare (the rocket is in 3D Skybox).]] | ||
|} | |} | ||
====Sun flare render through [[3D Skybox]] objects==== | |||
Unlike {{ent|env_sun}} sun flare render through any object pasted in [[3D Skybox]] environment. Keep in mind this before you will create [[3D Skybox]]. | |||
{| border=0 cellspacing=0 cellpadding=0 | |||
| [[File: FLARESKYBUG1.png | thumb | left | 710px | Clear example (the missiles is [[3D Skybox]] objects) ]] | |||
| [[File: BSFLARESKYBUG1.png | thumb | left | 710px | In bs_c3m2b level from [[Black Mesa: Blue Shift]]. Here sun behind clif, so, player should not see it technically (this is what happen with {{ent|env_sun}} here)]] | |||
|} | |||
== See Also == | == See Also == | ||
* {{ent|newLight_Point}} | * {{ent|newLight_Point}} |
Revision as of 05:38, 11 October 2023

env_lensflare
is an e0 available in Black Mesa. It creates a
lens flare that can be used to represent bright light sources.
Keyvalues
- Name (targetname) <string>
- The name that other entities refer to this entity by.
- Parent (parentname) <targetname>
- The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
- Pitch Yaw Roll (Y Z X) (angles) <angle>
- This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
- File (FlareFile) <string>
- Optional - file defining the lens flare. Note: Hammer's parameters overwrite the file's parameters.
- Distance attenuation (FlareAttenuation) <float>
- Distance where lensflare will be invisible. 0.0 if not attenuation with distance
- Flare Type (FlareType) <choices>
- Normal: normal lens flare (Pitch,Yaw,Roll not used) ------ Sun Flare: set the same Pitch,Yaw,Roll that the one from the sun light_env. That will define the position of the sun. the actual position of this entity is not used.
- 0: Normal
- 1: Sun Flare

- Appearance (FlareStyle) <choices>
- Template:Light appearances
- Size of Glow Proxy Geometry. (GlowProxySize) <float>
- Size of the glow to be rendered for visibility testing. Must be larger than the distance from the sprite center to empty space. So if this glow is inside geometry (like a light bulb), set this value to be bigger than the bulb's radius. Any time a sphere of this radius would be visible (poking through any nearby geometry), the glow will be rendered.

- Flare 01 texture (Flare01_texture) to Flare 20 texture (Flare20_texture) <string>
- image of the lens - if empty the flare doesn't exist
- Flare 01 parameters (Flare01_params) to Flare 20 parameters (Flare20_params) <string>
- parameters - example : DISK 1.0 10 10
See below for more details.
- Flare 01 intensity (Flare01_intensity) to Flare 20 intensity (Flare20_intensity) <vector>
- intensity of the flare - example : 1.0 1.0 1.0
Sets scale of intensity in three independent numbers, used number depends on the player's camera deviation.
- First number sets when player look at entity center.
- Second number sets when player camera have slight deviation.
- Third number sets when player look far away from entity center.
|
- Flare 01 sizes (Flare01_sizes) to Flare 20 sizes (Flare20_sizes) <vector>
- intensity of the flare - example : 1.0 1.0 1.0
Sets scale of size in three independent numbers, used number depends on the player's camera deviation.
- First number sets when player look at entity center.
- Second number sets when player camera have slight deviation.
- Third number sets when player look far away from entity center.

|
- Flare 01 color (Flare01_color) to Flare 20 color (Flare20_color) <color255>
- color factor of the texture - example : 255 255 255
Inputs
- ColorRedValue
- Sets the red color channel's value (0 - 255).

- ColorGreenValue
- Sets the green color channel's value (0 - 255).

- ColorBlueValue
- Sets the blue color channel's value (0 - 255).

- HideLensFlare
- Hide the lensflare. Won't be drawn until the 'ShowLensFlare' input is received.
- ShowLensFlare
- Show the lensflare.
- ToggleLensFlare
- Toggle the lensflare between hidden and shown.
Outputs
Flags
- Start on : [1]
- Play once : [2]
Lens Flare Properties
An individual env_lensflare can support up to 20 flares. Each flare have different properties that can be customized.
Texture
The texture property sets the material used by the flare. It is a path to a VMT file relative to the materials
folder, without the file extension. Common flare materials are located in the effects/lensflare/
folder. Any material can be used as a lens flare, but flare materials should preferably use UnlitGeneric and be $additive.
Parameters
The parameters property controls the appearance of the flare. Parameters take the following form:
TYPE parameters
The following lens flare types can be used:
DISK
A screen space flare that gets stronger when the player looks directly at the env_lensflare, and weaker as the player looks away. It takes three parameters.
The first number - how strong a image will move away from screen center. With 1 it will attached to screen center. If 0 - will stay at env_lensflare center. Negative number will mirror effect that do positive number.
The second number - distort a image along the axis Y. Doesn't work with negative numbers.
The third number - distort a image along the axis X. Doesn't work with negative numbers.
|
BOW
An effect that uses an image and distorts it between center of screen and env_lensflare center. It takes one parameter. Doesn't work with negative numbers.
The first number - change a picture scale.
|
CLA
This effect looks like copy of DISK. It use same parameters.
|
DISKH
An effect that uses an image and moves it along the X axis. It takes four parameter.
The first number - how strong the image will move away from screen center along the axis X. If number is 0 - it will stand at env_lensflare center. With 1 it will attached to screen center. Negative number will mirror effect that do positive number.
The second number - distort the image along the axis X. Doesn't work with negative numbers.
The third number - distort the image along the axis Y. Doesn't work with negative numbers.
The fourth number - change position of a image along the axis Y. If positive number - be higher, if negative number - be lower.
|
RAY
An effect that uses an image and scale it. It takes two parameter. Doesn't work with negative numbers.
The first number - distort the image along the axis Y.
The second number - distort the image along the axis X and Z.
|
Issues
Lens flares render behind viewmodel and not vice versa
Not a bug, but this is not what you expect from real life, was fixed in Half-Life 2: Inhuman.
File:RENDERUNDERVIEWMODELBUG.gif Black Mesa |
File:INHUMANFLARE.gif Half-Life 2: Inhuman |
Sun flare incorrect work with point_viewcontrol
Sun flare change position in sky when player move, this affects to what show point_viewcontrol when it's enabled. If you want to see in your background level sun flare - place player on needed position. If your point_viewcontrol moves - attach player to it.
File:PointViewControlFlareBug.gif Showcase of problem in background level of Black Mesa: Black Ops - Restored |
User can disable lens flares and see defect
In graphics settings user can turn off all flares, keep in mind this to escape situations like in the picture. Add sprites or corresponding skins, paint sun on your skybox if don't plan to use newLight_Dir.
Lens flare incorrect work with func_monitor
func_monitor can display lens flares, but this work not like you can expect. Disable flares or replace them to sprites when player can see monitor.
File:MONITORFLAREBUG.gif What happen in monitor. |
3D Skybox buggy show flares
Don't use env_lensflare in your 3D skyboxes, this work very buggy.
File:3DSKYFLAREBUG.gif Example with rocket flare (the rocket is in 3D Skybox). |
Sun flare render through 3D Skybox objects
Unlike env_sun sun flare render through any object pasted in 3D Skybox environment. Keep in mind this before you will create 3D Skybox.
![]() Clear example (the missiles is 3D Skybox objects) |
![]() In bs_c3m2b level from Black Mesa: Blue Shift. Here sun behind clif, so, player should not see it technically (this is what happen with env_sun here) |
See Also
- newLight_Point
- newLight_Dir
- Lighting
- Adding Light
- Intermediate Lighting
- Advanced Lighting
- env_sprite
- BlackMesa XenEngine: Part2 – How a Frame is Rendered (page from Black Mesa developer about new graphics features)