Difference between revisions of "Light (RW Section)"
(Created page with "{{RW Section|Light|0x0012}} '''Light''' is a section used in DFF files as child of a Clump section. It is normally accompanied by a St...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{RW Section|Light| | + | {{RW Section |
+ | | NAME = Light | ||
+ | | VENDORNAME = Criterion Games | ||
+ | | MODULENAME = Core | ||
+ | | MODULEID = 000000 | ||
+ | | IDENTIFIER = 12 | ||
+ | | PARENTS = [[Clump (RW Section)|Clump]] | ||
+ | | CHILDREN = [[Struct (RW Section)|Struct]] | ||
+ | }} | ||
− | '''Light''' is a section used in [[model file|DFF files]] as child of a [[Clump (RW Section)|Clump]] section. It is normally accompanied by a [[Struct (RW Section)|Struct]] section. A light section defines a single light source that can be attached to a [[Frame (RW Section)|Frame]]. | + | '''Light''' is a section used in [[model file|DFF files]] as child of a [[Clump (RW Section)|Clump]] section. It is normally accompanied by a [[Struct (RW Section)|Struct]] section. A light section defines a single light source that can be attached to a [[Frame List (RW Section)|Frame]]. |
Note that lights in Renderware are actual real-time lights, which are not used or supported in GTA. However, this section does occur in some of the files, shipped alongside different GTA versions. | Note that lights in Renderware are actual real-time lights, which are not used or supported in GTA. However, this section does occur in some of the files, shipped alongside different GTA versions. | ||
Line 7: | Line 15: | ||
Instead of using real-time lights, GTA fakes lightning in different ways: | Instead of using real-time lights, GTA fakes lightning in different ways: | ||
− | + | * Coronas and light cones are just textures that are projected onto the surface below them. Typically they are created within a [[2d Effect (RW Section)|2dfx]] extension, which is a custom extension created by R* in order to fake lights. | |
− | + | * The player model or vehicle model is not affected by shadows and direct light immision, e.g. they get darker if they are not in the light and brighter if they are. In GTA San Andreas those effects are faked by a lightning value, defined inside [[Collision File]]s. | |
== Structure == | == Structure == | ||
Line 37: | Line 45: | ||
== See also == | == See also == | ||
− | + | ||
− | * [[ | + | * [[Frame List (RW Section)|Frame List]] |
* [[Frame (RW Section)|Frame]] | * [[Frame (RW Section)|Frame]] | ||
* [[2d Effect (RW Section)|2d Effect]] | * [[2d Effect (RW Section)|2d Effect]] | ||
− | {{N|SA|VC}} | + | {{N|SA|VC|3}} |
− |
Latest revision as of 11:50, 11 September 2020
Light | |
---|---|
RenderWare Stream Section | |
Vendor | Criterion Games |
Module | Core |
Module ID | 0x000000
|
Identifier | 0x12
|
Chunk ID | 0x00000012
|
Versions | All |
Hierarchy | |
Parents: Clump | |
Children: Struct | |
Extensions: None | |
File Format |
Light is a section used in DFF files as child of a Clump section. It is normally accompanied by a Struct section. A light section defines a single light source that can be attached to a Frame.
Note that lights in Renderware are actual real-time lights, which are not used or supported in GTA. However, this section does occur in some of the files, shipped alongside different GTA versions.
Instead of using real-time lights, GTA fakes lightning in different ways:
- Coronas and light cones are just textures that are projected onto the surface below them. Typically they are created within a 2dfx extension, which is a custom extension created by R* in order to fake lights.
- The player model or vehicle model is not affected by shadows and direct light immision, e.g. they get darker if they are not in the light and brighter if they are. In GTA San Andreas those effects are faked by a lightning value, defined inside Collision Files.
Structure
The section itself typically does not contain any content. All information about the light source are stored within a Struct section, directly following the light section header. This structure contains the following information:
4b - DWORD - Frame Index 4b - FLOAT - Radius 4b - FLOAT - Red 4b - FLOAT - Green 4b - FLOAT - Blue 4b - FLOAT - Direction Angle (1-cos(alpha)) 2b - UINT16 - Flags 2b - UINT16 - Type
The flags describe the complexity of the casted light of the light source.
0x01 - rwLIGHTSCENE - Lights all the atomics of the object. 0x02 - rwLIGHTWORLD - Lights the entire world.
There are also different types of light sources.
0x01 - rpLIGHTDIRECTIONAL - Directional light source 0x02 - rpLIGHTAMBIENT - Ambient light source 0x80 - rpLIGHTPOINT - Point light source 0x81 - rpLIGHTSPOT - Spotlight 0x82 - rpLIGHTSPOTSOFT - Spotlight, soft edges