30 Avril 2024 à 10:44:44

Nouvelles:

Teamspeak 3 OFCRA
IP : ts.ofcra.org
Mot de passe : mineisbiggerthanyours
Discord: https://discord.gg/bWtGS7N


/!\ L'OFCRA RECRUTE /!\


setPiPEffect

Démarré par Prax, 28 Août 2015 à 12:54:41

« précédent - suivant »

0 Membres et 1 Invité sur ce sujet

Prax

Yop, encore moi.

J'ai besoin d'avoir une vue en NVG. Si je comprends bien (rien n'est moins sûr), "setPiPEffect" devrait pouvoir m'aider.

Citation de: BISSets Render Target's visual effect (Picture-in-Picture).

0: Normal -[0]
1: Night Vision - [1]
2: Thermal - [2]
3: Color Correction - [3, enabled, brightness, contrast, offset, blend [r,g,b,a], lerp [r,g,b,a], rgb [r,g,b,a]]
4: Mirror - [4] <currently not working>
5: Chromatic Aberration - [5, enabled, powerx, powery, (bool) aspectCorrection] <currently not working>
6: Film Grain - [6, enabled, intensity, sharpness, grainsize, intensityx1, intensityx2, (bool) monochromatic]
7: Thermal Inverted [7]

J'ai ça:

fnc_RENDER = {

_monitor=(_this select 0);
_name=(_this select 1);
_cam=(_this select 2);
_visionMode=(_this select 3);

_cam camCommit 1;
_cam cameraEffect ["INTERNAL", "BACK",_name];
_name setPiPEffect [_visionMode, 1, 0.8, 1, 0.1, [0.3, 0.3, 0.3, -0.1], [1.0, 0.0, 1.0, 1.0], [0, 0, 0, 0]];
_monitor setObjectTextureglobal  [0,(format ["#(argb,256,256,1)r2t(%1,1.0)",_name])];
};


Est_ce qu'il y a quelque chose la dedans pour moi?

Merci




Belmont

#1
Le PiP, c'est utilisé notamment pour les écrans des véhicules au sein d'un environnement 3d, comme la caméra de recul sur le 4x4 US. Ça ne sert donc qu'aux écrans/rétroviseurs.

HS

Prax

Citation de: Belmont le 28 Août 2015 à 13:03:05
Le PiP, c'est utilisé notamment pour les écrans des véhicules au sein d'un environnement 3d, comme la caméra de recul sur le 4x4 US. Ça ne sert donc qu'aux écrans/rétroviseurs.


Arthyc

Tu veux avoir une vue NV dans quelles conditions? Voir comme si tu portais des JVN sans en porter réellement?


Prax

#4
Sur un écran en pip.

En fait j'en ai deux actuellement: un en vision FLIR et l'autre en vision normale.
Ce que je veux c'est un vision nocturne et un FLIR.

La commande setPiPEffect est bien concernée car si je change

_name setPiPEffect [_visionMode, 1, 0.8, 1, 0.1, [0.3, 0.3, 0.3, -0.1], [1.0, 0.0, 1.0, 1.0], [0,0,0,0]];

par

_name setPiPEffect [1]

J'ai bien la NVG. Par contre ça affecte mes deux écrans, et je n'arrive pas à localiser celui qui m'intéresse dans le code. 

Edit: le script complet:

private ["_cameraCount","_debug","_monitor"];
_monitor = (_this select 0);
_units = (_this select 1);

removeAllActions _monitor;

_debug = false;

sleep 0.1;

_cameraCount = server getvariable "CAMCOUNT";

if (isnil "_cameraCount")
then {
_cameraCount = 0;server setvariable ["CAMCOUNT",_cameraCount,true];
};

{
if (isnil "_x") then {} else {
if (isNull _x) then {} else{
_cameraCount=_cameraCount+1;server setvariable ["CAMCOUNT",_cameraCount,true];

_uniqueName=format ["<t color=""#E4FB44"">" + ("LIVE FEED : %1") + "</t>",name _x];
_monitor addAction [_uniqueName, "call fnc_PROCESS_LIVE",[_x,_debug],0,false,true,"","_target distance

_this < 3.5"];

_uniqueName=format ["<t color=""#84EFF2"">" + ("SATELLITE : %1") + "</t>",name _x];
_monitor addAction [_uniqueName, "call fnc_PROCESS_SATT",[_x,_debug],0,false,true,"","_target

distance _this < 3.5"];

_x setvariable ["LIVEid",_cameraCount,true];
};};
}foreach _units;


if (_debug) then {_sidechatHint = format["Total Cam count: %1", _cameraCount];PAPABEAR sideChat

_sidechatHint;GlobalSideChat = _sidechatHint; publicVariable "GlobalSideChat";};


fnc_PROCESS_LIVE = {

private ["_name","_cam","_debug","_class","_newClass","_arguments"];
_monitor=(_this select 0);
_arguments=(_this select 3);
_unit=_arguments select 0;
_debug=_arguments select 1;

_monitor setObjectTextureglobal [0,"LFC\standby.jpg"];
SLEEP 0.6;

_cam=_unit getVariable "LIVECAM";

if (isnil "_cam")
then {
_cam = "camera" camCreate getpos _unit;
_unit setvariable ["LIVECAM",_cam,true];
0=[_cam,_debug] call fnc_RESET;
}else{
if (isnull _cam)
then {
_cam = "camera" camCreate getpos

_unit;
_unit setvariable

["LIVECAM",_cam,true];
0=[_cam,_debug] call fnc_RESET;
};
};

_class = typeOf (vehicle _unit);
//copyToClipboard (format ["%1",_class]);
switch (_class) do {
case "B_Heli_Transport_01_F": {_cam attachto [(vehicle _unit),[-

0.3,5.5,-0.3], "neck"];};
case "B_Heli_Transport_01_camo_F": {_cam attachto [(vehicle

_unit),[-0.3,5.5,-0.3], "neck"];};
case "B_Heli_Light_01_Armed_F": {_cam attachto [(vehicle _unit),

[-0.3,1.7,0.5], "neck"];};
case "B_Heli_Light_01_F": {_cam attachto [(vehicle _unit),[-

0.3,1.7,0.5], "neck"];};
case "B_Heli_Attack_01_F": {_cam attachto [(vehicle _unit),[-

0.1,1.7,0.5], "neck"];};

case "B_Truck_01_mover_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};
case "B_Truck_01_box_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};
case "B_Truck_01_transport_F": {_cam attachto [(vehicle _unit),

[-0.3,3.2,0.5], "neck"];};
case "B_Truck_01_covered_F": {_cam attachto [(vehicle _unit),[-

0.3,3.8,0], "neck"];};

case "B_MRAP_01_F": {_cam attachto [(vehicle _unit),[-0.4,-

1.3,0.2], "neck"];};
case "B_MRAP_01_gmg_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};
case "B_MRAP_01_hmg_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};

case "B_Quadbike_01_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};

case "B_APC_Wheeled_01_cannon_F": {_cam attachto [(vehicle

_unit),[0,0.15,0], "neck"];};
case "B_APC_Tracked_01_AA_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "B_APC_Tracked_01_rcws_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "B_MBT_01_cannon_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "B_MBT_01_arty_F": {_cam attachto [(vehicle _unit),

[0,0.15,-0.3], "neck"];};
case "B_MBT_01_mlrs_F": {_cam attachto [(vehicle _unit),

[0,0.15,0.4], "neck"];};

case "B_Boat_Transport_01_F": {_cam attachto [(vehicle _unit),

[0.3,0.15,0], "neck"];};
case "B_Lifeboat": {_cam attachto [(vehicle _unit),[0,0.15,-0.3],

"neck"];};
case "B_Boat_Armed_01_minigun_F": {_cam attachto [(vehicle

_unit),[-0.5,0.15,0.4], "neck"];};

case "B_SDV_01_F": {_cam attachto [(vehicle _unit),[0.3,0.6,-

0.8], "neck"];};

case "B_APC_Tracked_01_CRV_F": {_cam attachto [(vehicle _unit),

[0.3,0.6,-0.8], "neck"];};
case "B_Truck_01_ammo_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};
case "B_Truck_01_fuel_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};
case "B_Truck_01_medical_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};
case "B_Truck_01_Repair_F": {_cam attachto [(vehicle _unit),[-

0.3,3.2,0.5], "neck"];};

case "I_Plane_Fighter_03_AA_F": {_cam attachto [(vehicle _unit),

[0,2.7,-0.3], "neck"];};
case "I_Plane_Fighter_03_CAS_F": {_cam attachto [(vehicle

_unit),[0,2.7,-0.3], "neck"];};
case "I_Heli_Transport_02_F": {_cam attachto [(vehicle _unit),[-

0.5,6,-1], "neck"];};
case "I_Heli_light_03_F": {_cam attachto [(vehicle _unit),[-

0.3,4,0.3], "neck"];};
case "I_Heli_light_03_unarmed_F": {_cam attachto [(vehicle

_unit),[-0.3,4,0.1], "neck"];};

case "I_APC_Wheeled_03_cannon_F": {_cam attachto [(vehicle

_unit),[0,0.15,0], "neck"];};
case "I_APC_tracked_03_cannon_F": {_cam attachto [(vehicle

_unit),[0,1,0], "neck"];};
case "I_MBT_03_cannon_F": {_cam attachto [(vehicle _unit),[-

0.7,0.15,0], "neck"];};

case "I_Quadbike_01_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "I_MRAP_03_F": {_cam attachto [(vehicle _unit),[0,1,0],

"neck"];};
case "I_MRAP_03_gmg_F": {_cam attachto [(vehicle _unit),[0,1,0],

"neck"];};
case "I_MRAP_03_hmg_F": {_cam attachto [(vehicle _unit),[0,1,0],

"neck"];};
case "I_Truck_02_transport_F": {_cam attachto [(vehicle _unit),

[-0.5,3,0], "neck"];};
case "I_Truck_02_covered_F": {_cam attachto [(vehicle _unit),[-

0.5,3,0], "neck"];};

case "I_Boat_Armed_01_minigun_F": {_cam attachto [(vehicle

_unit),[-0.5,0.15,0.4], "neck"];};
case "I_Boat_Transport_01_F": {_cam attachto [(vehicle _unit),

[0,-0.4,0], "neck"];};

case "I_SDV_01_F": {_cam attachto [(vehicle _unit),[0.3,0.6,-

0.8], "neck"];};

case "I_Truck_02_ammo_F": {_cam attachto [(vehicle _unit),[-

0.5,3,0], "neck"];};
case "I_Truck_02_fuel_F": {_cam attachto [(vehicle _unit),[-

0.5,3,0], "neck"];};
case "I_Truck_02_medical_F": {_cam attachto [(vehicle _unit),[-

0.5,3,0], "neck"];};
case "I_Truck_02_box_F": {_cam attachto [(vehicle _unit),[-

0.5,3,0], "neck"];};

case "O_Heli_Attack_02_F": {_cam attachto [(vehicle _unit),

[0,3,0.5], "neck"];};
case "O_Heli_Attack_02_black_F": {_cam attachto [(vehicle

_unit),[0,3,0.5], "neck"];};
case "O_Heli_Light_02_F": {_cam attachto [(vehicle _unit),[-

0.4,3.3,-0.2], "neck"];};
case "O_Heli_Light_02_unarmed_F": {_cam attachto [(vehicle

_unit),[-0.4,3.3,-0.2], "neck"];};

case "O_MBT_02_arty_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "O_APC_Tracked_02_cannon_F": {_cam attachto [(vehicle

_unit),[0,0.15,0], "neck"];};
case "O_APC_Wheeled_02_rcws_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "O_MBT_02_cannon_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "O_APC_Tracked_02_AA_F": {_cam attachto [(vehicle _unit),

[0,0.15,-0.3], "neck"];};

case "O_MRAP_02_F": {_cam attachto [(vehicle _unit),[0,-0.5,0],

"neck"];};
case "O_MRAP_02_gmg_F": {_cam attachto [(vehicle _unit),[0,-

0.5,-0.3], "neck"];};
case "O_MRAP_02_hmg_F": {_cam attachto [(vehicle _unit),[0,-

0.5,-0.3], "neck"];};
case "O_Quadbike_01_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "O_Truck_02_transport_F": {_cam attachto [(vehicle _unit),

[-0.5,3,0], "neck"];};
case "O_Truck_02_covered_F": {_cam attachto [(vehicle _unit),[-

0.5,3,0], "neck"];};

case "O_Boat_Transport_01_F": {_cam attachto [(vehicle _unit),

[0.3,0.15,0], "neck"];};
case "O_Lifeboat": {_cam attachto [(vehicle _unit),[0,0.15,-0.3],

"neck"];};
case "O_Boat_Armed_01_minigun_F": {_cam attachto [(vehicle

_unit),[-0.5,0.15,0.4], "neck"];};

case "O_SDV_01_F": {_cam attachto [(vehicle _unit),[0.3,0.6,-

0.8], "neck"];};

case "O_Truck_02_Ammo_F": {_cam attachto [(vehicle _unit),[-

0.5,1.7,0], "neck"];};
case "O_Truck_02_fuel_F": {_cam attachto [(vehicle _unit),[-

0.5,1.7,0], "neck"];};
case "O_Truck_02_medical_F": {_cam attachto [(vehicle _unit),[-

0.5,3,0], "neck"];};
case "O_Truck_02_box_F": {_cam attachto [(vehicle _unit),[-

0.5,1.7,0], "neck"];};

case "C_Hatchback_01_F": {_cam attachto [(vehicle _unit),[-

0.3,0.15,0], "neck"];};
case "C_Hatchback_01_sport_F": {_cam attachto [(vehicle _unit),

[-0.3,0.15,0], "neck"];};
case "C_Offroad_01_F": {_cam attachto [(vehicle _unit),[-

0.3,0.3,0.2], "neck"];};
case "C_Quadbike_01_F": {_cam attachto [(vehicle _unit),

[0,0.15,0], "neck"];};
case "C_SUV_01_F": {_cam attachto [(vehicle _unit),[-

0.3,0.15,0.2], "neck"];};
case "C_Van_01_transport_F": {_cam attachto [(vehicle _unit),[-

0.4,0.4,0.3], "neck"];};
case "C_Van_01_box_F": {_cam attachto [(vehicle _unit),[-

0.4,0.4,0.3], "neck"];};

case "C_Boat_Civil_01_F": {_cam attachto [(vehicle _unit),

[0.3,0,0.3], "neck"];};
case "C_Boat_Civil_01_police_F": {_cam attachto [(vehicle

_unit),[0.3,0,0.3], "neck"];};
case "C_Boat_Civil_01_rescue_F": {_cam attachto [(vehicle

_unit),[0.3,0,0.3], "neck"];};
case "C_Rubberboat": {_cam attachto [(vehicle _unit),[0.3,0,0.3],

"neck"];};

case "C_Van_01_fuel_F": {_cam attachto [(vehicle _unit),[-

0.4,0.4,0.3], "neck"];};

   default
{
_cam attachto [_unit,[0,0.35,0], "neck"];
};
};


_cam camSetFov 0.8;
_id = _unit getvariable "LIVEid";
_name=format ["rendertarget%1",_id];
0=[_monitor,_name,_cam,0] call fnc_RENDER;


_class = typeOf (vehicle _unit);

while {true} do {
sleep 1;
_NeWclass = typeOf (vehicle _unit);

if (!(_NeWclass == _class))
exitwith {
0= [_monitor,0,0,_arguments] call fnc_PROCESS_LIVE;
};
};
};



fnc_PROCESS_SATT = {

private ["_name","_cam","_debug"];
_monitor=(_this select 0);
_arguments=(_this select 3);
_unit=_arguments select 0;
_debug=_arguments select 1;

_monitor setObjectTextureglobal [0,"LFC\standby.jpg"];
SLEEP 0.6;

_cam=_unit getVariable "SATTCAM";
if (isnil "_cam")
then {
_cam = "camera" camCreate [(getpos _unit select 0), (getpos _unit select 1),

(getpos _unit select 2) + 300];
_unit setvariable ["SATTCAM",_cam,true];
0=[_cam,_debug] call fnc_RESET;
}else{
if (isnull _cam)
then {
_cam = "camera" camCreate [(getpos _unit select

0), (getpos _unit select 1), (getpos _unit select 2) + 300];
_unit setvariable ["SATTCAM",_cam,true];
0=[_cam,_debug] call fnc_RESET;
};
};
[_cam,_unit] spawn {
private ["_cam","_unit"];
_cam = (_this select 0);
_unit =(_this select 1);
while {!(isnull _cam) || alive _unit} do {

_cam setpos [(getpos _unit select 0), (getpos _unit select 1), (getpos _unit select 2) + 300];


sleep 0.1;
};
};

_cam camSetFov 0.2;
_cam setVectorDirAndUp [[0,0,-1],[0,1,0]];
_id = _unit getvariable "LIVEid";
_name=format ["rendertargetsat%1",_id];
0=[_monitor,_name,_cam,2] call fnc_RENDER;
};




fnc_RESET = {
private ["_conCurrentCams"];
_cam=(_this select 0);
_debug=(_this select 1);
_conCurrentCams=server getvariable "CONCURRENTCAMS";

if (isnil "_conCurrentCams")
then {
_conCurrentCams = [];server setvariable ["CONCURRENTCAMS",_conCurrentCams,true];
};

_conCurrentCams=_conCurrentCams + [_cam];server setvariable ["CONCURRENTCAMS",_conCurrentCams,true];

if (_debug) then {_sidechatHint = format["Concurrent cam Count: %1",count _conCurrentCams];PAPABEAR sideChat

_sidechatHint;GlobalSideChat = _sidechatHint; publicVariable "GlobalSideChat";};

if (count _conCurrentCams > 4)
then {
{
_x cameraEffect ["TERMINATE", "BACK"];
camDestroy _x;
_monitor setObjectTextureglobal [0,"LFC\standby.jpg"];
}foreach _conCurrentCams;

_conCurrentCams=[];server setvariable

["CONCURRENTCAMS",_conCurrentCams,true];

if (_debug) then {_sidechatHint = format["Deleted CONCURRENTCAMS: %1",count _conCurrentCams];PAPABEAR sideChat

_sidechatHint;GlobalSideChat = _sidechatHint; publicVariable "GlobalSideChat";};
};
};


fnc_RENDER = {

monitor=(_this select 0);
_name=(_this select 1);
_cam=(_this select 2);
_visionMode=(_this select 3);

_cam camCommit 1;
_cam cameraEffect ["INTERNAL", "BACK",_name];
_name setPiPEffect [_visionMode, 1, 0.8, 1, 0.1, [0.3, 0.3, 0.3, -0.1], [1.0, 0.0, 1.0, 1.0], [0,0,0,0]];
_monitor setObjectTextureglobal  [0,(format ["#(argb,256,256,1)r2t(%1,1.0)",_name])];
};



Zombi

Tu appelles le script en lui fournissant deux paramètres :
- L'écran sur lequel afficher l'image
- Les sources (unités, véhicules, objets sur lesquels une caméra sera fixée et diffusera l'image sur l'écran)

Donc si ça marche c'est que tu appelles le script une fois pour chaque écran.

Montre nous comment tu appelles les scripts, les paramètres que tu mets etc...

Belmont : Tu as pas compris la question... le PiP permet d'afficher une image provenant d'une source. Contrairement au simple setTexture, on ne va pas simplement afficher un image paa fixe mais une image venant d'une caméra (et donc un film puisque la caméra va fournir une source vidéo).

Prax

#6
Citation de: ZombiMontre nous comment tu appelles les scripts, les paramètres que tu mets etc...

Alors:

-1 H invisible appelé SERVER
-2 Gus appelés h1 et h2
-2 moniteurs appelés ECRAN1 et ECRAN2

Dans l'init.sqf":

null = [[ECRAN1],["h1"]] execVM "LFC\feedInit.sqf";
null = [[ECRAN2],["h2"]] execVM "LFC\feedInit.sqf";


le feedinit.sqf en question:

waitUntil {!isnull player};
private ["_feedArray","_MonitorName","_array","_newArray"];

_monitorArray=(_this select 0);
_monitorHDD=_monitorArray select 0;
_array=(_this select 1);
_MonitorName= format ["%1",_monitorHDD];

   _newArray=[];

{
    if (isNil _x) then {
}else{
       _call = format ["%1",_x];
call (compile _call);
_newArray=_newArray+[call(compile _call)];
};
} forEach _array;

_feedArray=server getvariable _MonitorName;

if (isnil "_feedArray")
then {
_feedArray=[];
{
if (isnil "_x") then {}else{_feedArray=_feedArray + [_x]; };
}foreach _newArray;

server setvariable [_MonitorName,_feedArray,true];
};

player setvariable ["MonName",_MonitorName];


{
    if (isNil _x) then {
}else{
       _call = format ["%1",_x];
call (compile _call);
_newArray=_newArray+[call(compile _call)];
};
} forEach _array;

waituntil {!isnil "_MonitorName"};
_feedArray=server getvariable _MonitorName;

if ((player in _newArray)and !(player in _feedArray)) then {

_feedArray=_feedArray +[player];
server setvariable [_MonitorName,_feedArray,true];
};

_feedArray=server getvariable _MonitorName;

if (!isserver || !isdedicated)
then {
{
null = [_x,_feedArray,server] execVM "LFC\livefeed.sqf";
_x setObjectTexture [0,'#(argb,8,8,3)color(0,0,1,1)'];
_x allowdamage false;
_x enablesimulation false;
}foreach _monitorArray;
};

{
_x setvariable ["MonName",_MonitorName];
_x setvariable ["MonitorArray",_monitorArray];

if (isplayer _x)
then {

_x addEventHandler ["Respawn","CALL fnc_PLAYER_KILLED"];

}else{

_x addmpEventHandler ["MPkilled","CALL fnc_AI_KILLED"];

};

}foreach _feedArray;



fnc_AI_KILLED={

_unit = _this select 0;
_corpse = _this select 1;

_MonitorName=_unit getvariable "MonName";
_monitorArray=_unit getvariable "MonitorArray";


_feedArray=server getvariable _MonitorName;
_feedArray=_feedArray -[_unit];

server setvariable [_MonitorName,_feedArray,true];

};


fnc_PLAYER_KILLED={

_unit = _this select 0;
_corpse = _this select 1;

_MonitorName=_unit getvariable "MonName";
_monitorArray=_unit getvariable "MonitorArray";


_feedArray=server getvariable _MonitorName;
_feedArray=_feedArray -[_corpse];
_feedArray=_feedArray +[_unit];

_feedArray=_feedArray call BIS_fnc_arrayShuffle;

server setvariable [_MonitorName,_feedArray,true];

};


[_monitorArray,_MonitorName] spawn {

private ["_monitorArray","_MonitorName"];

_monitorArray=(_this select 0);
_MonitorName=(_this select 1);

while {true} do {

_feedArray=server getvariable _MonitorName;
_oldArray = format ["%1",_feedArray];

sleep 5;

_feedArray=server getvariable _MonitorName;
_newArray = format ["%1",_feedArray];

if (_newArray != _oldArray || (count _feedArray) <= 1) then{
{
null = [_x,_feedArray] execVM "LFC\livefeed.sqf";
}foreach _monitorArray;
};
};
};




Prax

Problème résolu. Merci à Zombi aka SQFMaster.