Implemented proper ScriptAsset execution on load

Implemented script dependency handling
Added test-case of script dependency handling in ExampleModule
Cleanup of redundant getSceneCount calls
Properly get scene count in callGamemodeFunction
Remove unneeded TODO comment in shaders
Converted onMissionEnded gamemode func call to use callGameModeFunction function
Convert ExampleGameMode to be container-object based, and updated callGamemodeFunction to handle that
Correct import settings typoe so image suffixes are read correctly
Largely fixed companion image scanning when importing images and streamlined image-material interop during import preprocessing
Added handling for reading in PBR maps and creating a composite image + asset
Added WIP of Cubemap asset, and editing integration with a standalone cubemap editor
Added ability to create new Cubemap asset in Asset Browser
This commit is contained in:
Areloch 2019-09-13 00:27:48 -05:00
parent 52fcbecb9f
commit 889115f45e
31 changed files with 1335 additions and 756 deletions

View file

@ -148,8 +148,6 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
%entity.notify("onClientConnect", %client);
}
%activeSceneCount = getSceneCount();
%hasGameMode = callGamemodeFunction("onClientEnterGame", %client);
//if that also failed, just spawn a camera

View file

@ -123,6 +123,8 @@ function loadMissionStage2()
// Make the MissionCleanup group the place where all new objects will automatically be added.
$instantGroup = MissionCleanup;
%hasGameMode = callGamemodeFunction("onCreateGame");
// Construct MOD paths
pathOnMissionLoadDone();
@ -135,8 +137,6 @@ function loadMissionStage2()
ClientGroup.getObject(%clientIndex).loadMission();
// Go ahead and launch the game
%activeSceneCount = getSceneCount();
%hasGameMode = callGamemodeFunction("onMissionStart");
}
@ -148,8 +148,6 @@ function endMission()
echo("*** ENDING MISSION");
// Inform the game code we're done.
%activeSceneCount = getSceneCount();
%hasGameMode = callGamemodeFunction("onMissionEnded");
// Inform the clients
@ -181,7 +179,5 @@ function resetMission()
clearServerPaths();
// Inform the game code we're resetting.
%activeSceneCount = getSceneCount();
%hasGameMode = callGamemodeFunction("onMissionReset", %client);
}

View file

@ -267,35 +267,7 @@ function onServerDestroyed()
echo("*** ENDING MISSION");
// Inform the game code we're done.
%activeSceneCount = getSceneCount();
%hasGameMode = 0;
for(%i=0; %i < %activeSceneCount; %i++)
{
if(getScene(%i).gameModeName !$= "")
{
//if the scene defines a game mode, go ahead and envoke it here
if(isMethod(getScene(%i).gameModeName, "onMissionEnded"))
{
eval(getScene(%i).gameModeName @ "::onMissionEnded();" );
%hasGameMode = 1;
}
}
}
//if none of our scenes have gamemodes, we need to kick off a default
if(%hasGameMode == 0)
{
%defaultModeName = ProjectSettings.value("Gameplay/GameModes/defaultModeName");
if(%defaultModeName !$= "")
{
if(isMethod(%defaultModeName, "onMissionEnded"))
{
eval(%defaultModeName @ "::onMissionEnded();" );
%hasGameMode = 1;
}
}
}
%hasGameMode = callGamemodeFunction("onMissionEnded");
// Inform the clients
for( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) {

View file

@ -129,7 +129,7 @@ Surface createSurface(vec4 normDepth, sampler2D colorBuffer, sampler2D matInfoBu
vec4 gbuffer2 = texture(matInfoBuffer, uv);
surface.depth = normDepth.a;
surface.P = wsEyePos + wsEyeRay * surface.depth;
surface.N = tMul(invView, vec4(normDepth.xyz,0)).xyz; //TODO move t3d to use WS normals
surface.N = tMul(invView, vec4(normDepth.xyz,0)).xyz;
surface.V = normalize(wsEyePos - surface.P);
surface.baseColor = gbuffer1;
const float minRoughness=1e-4;
@ -148,7 +148,7 @@ Surface createForwardSurface(vec4 baseColor, vec4 normal, vec4 pbrProperties, in
surface.depth = 0;
surface.P = wsPosition;
surface.N = tMul(invView, vec4(normal.xyz,0)).xyz; //TODO move t3d to use WS normals
surface.N = tMul(invView, vec4(normal.xyz,0)).xyz;
surface.V = normalize(wsEyePos - surface.P);
surface.baseColor = baseColor;
const float minRoughness=1e-4;

View file

@ -108,7 +108,7 @@ inline Surface createSurface(float4 gbuffer0, TORQUE_SAMPLER2D(gbufferTex1), TOR
surface.depth = gbuffer0.a;
surface.P = wsEyePos + wsEyeRay * surface.depth;
surface.N = mul(invView, float4(gbuffer0.xyz,0)).xyz; //TODO move t3d to use WS normals
surface.N = mul(invView, float4(gbuffer0.xyz,0)).xyz;
surface.V = normalize(wsEyePos - surface.P);
surface.baseColor = gbuffer1;
const float minRoughness=1e-4;

View file

@ -3,18 +3,29 @@ function callGamemodeFunction(%gameModeFuncName, %data)
if(%data !$= "")
%data = "\""@%data@"\"";
%activeSceneCount = getSceneCount();
%hasGameMode = 0;
for(%i=0; %i < %activeSceneCount; %i++)
{
if(getScene(%i).gameModeName !$= "")
%gamemodeName = getScene(%i).gameModeName;
if(%gamemodeName !$= "")
{
//if the scene defines a game mode, go ahead and envoke it here
if(isMethod(getScene(%i).gameModeName, %gameModeFuncName))
if(isObject(%gamemodeName) && %gamemodeName.isMethod(%gameModeFuncName))
{
eval(getScene(%i).gameModeName @ "::"@%gameModeFuncName@"("@%data@");" );
eval(%gamemodeName @ "."@%gameModeFuncName@"("@%data@");" );
%hasGameMode = 1;
}
else
{
//if we don't have an object, attempt the static call
if(isMethod(%gamemodeName, %gameModeFuncName))
{
eval(%gamemodeName @ "::"@%gameModeFuncName@"("@%data@");" );
%hasGameMode = 1;
}
}
}
}
@ -24,11 +35,19 @@ function callGamemodeFunction(%gameModeFuncName, %data)
%defaultModeName = ProjectSettings.value("Gameplay/GameModes/defaultModeName");
if(%defaultModeName !$= "")
{
if(isMethod(%defaultModeName, %gameModeFuncName))
if(isObject(%defaultModeName) && %defaultModeName.isMethod(%gameModeFuncName))
{
eval(%defaultModeName @ "::"@%gameModeFuncName@"("@%data@");" );
eval(%defaultModeName @ "."@%gameModeFuncName@"("@%data@");" );
%hasGameMode = 1;
}
else
{
if(isMethod(%defaultModeName, %gameModeFuncName))
{
eval(%defaultModeName @ "::"@%gameModeFuncName@"("@%data@");" );
%hasGameMode = 1;
}
}
}
}