Page 1 of 3

[WIP] GTAV: Lights

Posted: Sat Jul 09, 2016 1:32 pm
by Oleg
GTAV: Lights (work in progress)

A support for exporting lights into GTA models have been added. To the moment the only model files confirmed to support exported lights are .yft files. Original game models have lights in .ydr too, but these have not yet been confirmed to get exported properly.
gta_lights_01.jpg
You can import any model with lights and copy pre-configured light into your scene. Lights come up with some parameters in used-defined options window and are equipped with default parameters if these are missing (light created in ZModeler with no extra parameters).

As this is a "work in progress" update, I would like to get reports on what effect different parameters produce to your observation. I've tested some of them to the moment, so can't give a full list with explanation. Here's a screenshot of parameters box in current release. These are a subject to test and probably refine for better usability.
gta_lights_02.jpg
Power = the strength of light (two values control the strength on light, it's up to you to test light behavior with different values). Probably range-specific or an attenuation-specific at low/far range.
Flags = a set of bit-flags to switch on/off various features. ranging from 1 to 32 inclusive. To the moment known are:
#8 = blurred shadow (in combination with #9 only)
#9 = enable shadow;
TOD = time of day activation. E.g. 0, 2-5, 18-23 (0 = from 00:00 to 01:00; 2-5 = from 02:00 to 06:00, and from 18:00 to 24:00)
ShadowBlur = blur of shadows (any value from 0 = no blur, up to 255 = fully blurred shadows)
Subtype = unknown, probably insignificant; may be corona-specific;
Color3 = unknown, seems to have no effect;
Params1 = unknown set of parameters;
Corona = corona settings; seems to be [power, size, unknwon, hdr multiplier]; suggest your meaning for these values if you find something;
Shadow = offset to shadow-rendering point. allows to move light into some object and shift shadow rendering point out of this object to prevent artifacts. For example, streelight bulbs light-source is behind bulb glass cover, and this shift value allows to render shadow without bulb glass cover being dropping shadow (just like there is no such on the way of light emitted from bulb).


Feel free to mess with original game files import/export and report your observations (whether some features stop working or something get missing or messed). For example, i haven't tested flashing lights in any way.

Note, the filter update is marked "Beta", so you need to enable "Install beta updates" in Settings->General->Network to get this version downloaded. I'll keep it in beta stage for a while as there are some important things unresolved yet.

Re: [WIP] GTAV: Lights

Posted: Sat Jul 09, 2016 9:57 pm
by _Vlad_
Awesome! I will try now!

Re: [WIP] GTAV: Lights

Posted: Sat Jul 09, 2016 10:11 pm
by _Vlad_
should be used user denefined option on the material or mesh? because i imported buffalo2, as on you screen, (beta updates enabled,and downloaded and installed, zm restarted) and i cannot find these parameters at lightmessive material

Re: [WIP] GTAV: Lights

Posted: Sun Jul 10, 2016 12:40 am
by Oleg
these are not materials, these are light object. Create\Light. then Properties.

Light is linked to hierarchy under associated part, configured and exported. You can take preconfigured lights from street-light illumination objects x64h.rpf\levels\gta5\props\roadside\v_traffic_lights.rpf

the image with buffalo is an example of attaching light to the vehicle. It does not work as headlights (e.g. turning on/off or breaking headlights will not give light on/off). Also, these attached lights turns on always, even when engine is off. I suspect some specific settings could be related to turning lights on/off - probably by exploring a police helicopter with light onboard (is there such a model?)

I've explored just few light sources, so my view of light info is very inaccurate to the moment.

Also, I've noticed some upgrade parts (hei_mph_carstair_lamps4.ydr) with build-in lights, so it could be possible to make similar upgrades. Unfortunately, I can't test these upgrades in game as of low game progress - these features are not available or not reachable on map.

Tried to attach some light to the weapon model with no result. the only result I've got is a weapon model completely missing. need some original .ydr files (preferable, weapon) to explore for some inspiration. it could be nice to create glowing alien weapons mod or something like that.

Re: [WIP] GTAV: Lights

Posted: Sun Jul 10, 2016 12:50 am
by TomcattersVF31
Oleg wrote:these are not materials, these are light object. Create\Light. then Properties.

Light is linked to hierarchy under associated part, configured and exported. You can take preconfigured lights from street-light illumination objects x64h.rpf\levels\gta5\props\roadside\v_traffic_lights.rpf

the image with buffalo is an example of attaching light to the vehicle. It does not work as headlights (e.g. turning on/off or breaking headlights will not give light on/off). Also, these attached lights turns on always, even when engine is off. I suspect some specific settings could be related to turning lights on/off - probably by exploring a police helicopter with light onboard (is there such a model?)

I've explored just few light sources, so my view of light info is very inaccurate to the moment.

Also, I've noticed some upgrade parts (hei_mph_carstair_lamps4.ydr) with build-in lights, so it could be possible to make similar upgrades. Unfortunately, I can't test these upgrades in game as of low game progress - these features are not available or not reachable on map.

Tried to attach some light to the weapon model with no result. the only result I've got is a weapon model completely missing. need some original .ydr files (preferable, weapon) to explore for some inspiration. it could be nice to create glowing alien weapons mod or something like that.

I know that the Annihilator and Buzzard have a red light in the rear cabin which is not linked to any dummy... Not sure if that is something you're looking for. Anyway, I'll try this out ASAP, this could come in really handy.


Edit
Not sure what I am doing wrong here, but I only get these settings upon import:
lights.jpg

Re: [WIP] GTAV: Lights

Posted: Sun Jul 10, 2016 12:23 pm
by _cp_
@Oleg
It's my 100% save game, put it to Documents\Rockstar Games\GTA V\Profiles\*profilenumber*
https://dl.dropboxusercontent.com/u/868 ... /SGTA50001

Re: [WIP] GTAV: Lights

Posted: Mon Jul 11, 2016 1:04 pm
by Oleg
TomcattersVF31 wrote:I know that the Annihilator and Buzzard have a red light in the rear cabin which is not linked to any dummy...
unfortunately, these are not light objects. may be some light is mounted there via vehicle meta script.

Re: [WIP] GTAV: Lights

Posted: Tue Jul 12, 2016 6:01 am
by _Vlad_
im found ydr with light in it , it's located in x64l.rpf\levels\gta5\_cityw\airport_01\ap1_02.rpf\ap1_02_text1.ydr
Image
it's an airport sign
Image
Image

Re: [WIP] GTAV: Lights

Posted: Tue Jul 12, 2016 6:31 am
by _Vlad_
Ater editing in zm ( i removed santos), light worked in game.

Re: [WIP] GTAV: Lights

Posted: Tue Jul 12, 2016 10:33 am
by Oleg
I'm trying to attach a light to a weapon YDR model, but none of attempts succeed.

Re: [WIP] GTAV: Lights

Posted: Wed Jul 13, 2016 1:28 am
by _cp_
[s]Did you check a flashlight attachment?[/s]
Flashlight do not have any lights parameters.

Re: [WIP] GTAV: Lights

Posted: Wed Jul 13, 2016 1:31 am
by Oleg
nope, where is it? I've tried "molotov" and "flare" weapons, but these are not equipped with light sources.

Re: [WIP] GTAV: Lights

Posted: Thu Jul 14, 2016 9:31 am
by _cp_
Looks like a search light is added externally, maybe in definiton file.

Re: [WIP] GTAV: Lights

Posted: Thu Jul 14, 2016 9:47 am
by Oleg
too bad. I've expected blaster and plasma weapons mod already. )

Re: [WIP] GTAV: Lights

Posted: Sat Jul 16, 2016 4:47 am
by TomcattersVF31
Okay, so I have managed to succesfully implement lights on an aircraft mod... But for gods sake, it does not work on a boat. I have been copying the lights of my plane mod, imported default lights... None worked on the boat. Can anybody else perhaps test this? Standard boat with a single light or something?

Re: [WIP] GTAV: Lights

Posted: Sat Jul 16, 2016 4:55 am
by Oleg
feels like the model should toggle "lights compatible" option somewhere in a script, as original models that had lights work fine with modded lights and those that had no lights in it does not seem to enable lights from an exported model.

Re: [WIP] GTAV: Lights

Posted: Mon Aug 01, 2016 3:12 pm
by TomcattersVF31
It's me once again. I can't seem to figure out how to reduce the size of the spotlights... Perhaps someoe has a solution or idea

I have tried:

a)Properties: Scale XYZ

b) Lights Configuration: Range (Perhaps that's the value, but it would always reset to it's previous value after clicking OK and apply)

c)Power and Corona settings in User defined options


The problem is that the lights should stay inside of the interior and not shine through the fuselage as shown below on the wings. (They do not shine through the windows but through the fuselage really)

Image

Re: [WIP] GTAV: Lights

Posted: Tue Aug 02, 2016 1:18 am
by Oleg
switch light to manipulators level ('5' hotkey) and change range/target manipulator position relative to light source center point.

Re: [WIP] GTAV: Lights

Posted: Tue Aug 02, 2016 2:32 pm
by lunchxbles
Was able to export lights onto ydr files using Zmodeler. Added the streetlamp light from gta v to my vice city streetlamp model Image

Re: [WIP] GTAV: Lights

Posted: Thu Aug 04, 2016 2:13 am
by dkmods
Is it possible to apply vehicle light IDs [4,11,etc] to these lights in vertices level so it can be toggled on or off like vehicle lights ??

Re: [WIP] GTAV: Lights

Posted: Thu Aug 04, 2016 11:25 am
by Oleg
unfortunately, seems like it's not possible.

Re: [WIP] GTAV: Lights

Posted: Sun Sep 04, 2016 3:26 pm
by tall70
Molotov has light source, I remember I was adjusting light sphere size and strength for it somewhere in projectile settings and it worked, it made larger area lit by it while flying close to ground.

I never noticed this was added can't wait to try this for boats and buses, even for interior lighting possibly as I have used street lights on gta4 boat.

Re: [WIP] GTAV: Lights

Posted: Wed Nov 16, 2016 4:07 pm
by tall70
Please, do you have any idea how to adjust sphere size for Omni light type? Power first number is strength, second number is attenuation and I was hoping to reduce distance with it for interior light inside of the bus, because Shadows flag 9 or both 9 and 8 are flickering on and off from certain angles of view. Sometimes Shadows disappear for quite a while and then they come back again, with shadows off light goes through everything all the way on the road. I know it's in development stage, I was just hoping for any update.

I also tested All Flags 0 - 32 hoping some of them are going to be affecting vehicles. Few Flags turned light off, not affected by any vehicle light while driving.

flag 13 is volumetric fog,

But unfortunately I couldn't find any relation to vehicle functions using any flag. I'm planning to test subtype subtype and parameters numbers in future

Re: [WIP] GTAV: Lights

Posted: Thu Nov 17, 2016 6:28 am
by Oleg
sphere size of omni light is affected by its "Range" value. you can either set it manually in properties or drag the range manipulator point of the object after switching it to manipulators level.

Re: [WIP] GTAV: Lights

Posted: Thu Nov 17, 2016 10:46 am
by tall70
Do you mean Properties/Configuration/Range? Because that i tried the first thing and it changed sphere size in ZM, if that's what circle around dummy when selected represents, but not in game... I'll try manipulators

Also what are tho correct names for each lights in ZM hierarchy? I didn't see it in directions above and i just assumed light 0, light 1, etc, same as for gta4. It works this way, but now i see in some YDR files that devs named them Light #1, Light #2. Since i have Shadow issues i wanna be sure about all recommended details. Thank you

Another thing i forgot to mention TOD works nicely, except i had to set 0-5, 21-24 to make it come ON at 9pm and OFF at "6am", for some reason it's hour offset in morning.

EDIT: no luck
i tried manipulators as well with same result...all 3 lights are about 0.5 range

here it's in ZM

Image

and here is with and without attenuation

Image

I didn't use shadows so it's easy to see how far light goes