mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Removed redundant 'load last edited level' startup mode to editor.
Fixed recent levels open command behavior Includes rextimmy's vertex WS normal logic in HLS shadergen
This commit is contained in:
parent
62fabf6894
commit
c74b669f5e
6 changed files with 36 additions and 32 deletions
|
|
@ -767,6 +767,21 @@ Var* ShaderFeatureHLSL::getWsView( Var *wsPosition, MultiLine *meta )
|
||||||
return wsView;
|
return wsView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Var* ShaderFeatureHLSL::getInWorldNormal(Vector<ShaderComponent*>& componentList)
|
||||||
|
{
|
||||||
|
Var* wsNormal = (Var*)LangElement::find("wsNormal");
|
||||||
|
if (!wsNormal)
|
||||||
|
{
|
||||||
|
ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
|
||||||
|
wsNormal = connectComp->getElement(RT_TEXCOORD);
|
||||||
|
wsNormal->setName("wsNormal");
|
||||||
|
wsNormal->setStructName("IN");
|
||||||
|
wsNormal->setType("float3");
|
||||||
|
}
|
||||||
|
|
||||||
|
return wsNormal;
|
||||||
|
}
|
||||||
|
|
||||||
Var* ShaderFeatureHLSL::addOutDetailTexCoord( Vector<ShaderComponent*> &componentList,
|
Var* ShaderFeatureHLSL::addOutDetailTexCoord( Vector<ShaderComponent*> &componentList,
|
||||||
MultiLine *meta,
|
MultiLine *meta,
|
||||||
bool useTexAnim,
|
bool useTexAnim,
|
||||||
|
|
@ -853,20 +868,24 @@ Var* ShaderFeatureHLSL::getSurface(Vector<ShaderComponent*>& componentList, Mult
|
||||||
meta->addStatement(new GenOp(" @ = float4(0.0,1.0,@,@);\r\n", colorDecl, smoothness, metalness)); //reconstruct matinfo, no ao darkening
|
meta->addStatement(new GenOp(" @ = float4(0.0,1.0,@,@);\r\n", colorDecl, smoothness, metalness)); //reconstruct matinfo, no ao darkening
|
||||||
}
|
}
|
||||||
|
|
||||||
Var* wsNormal = (Var*)LangElement::find("wsNormal");
|
|
||||||
Var* normal = (Var*)LangElement::find("normal");
|
Var* normal = (Var*)LangElement::find("normal");
|
||||||
if (!normal)
|
if (!normal)
|
||||||
{
|
{
|
||||||
normal = new Var("normal", "float3");
|
normal = new Var("normal", "float3");
|
||||||
meta->addStatement(new GenOp(" @;\r\n\n", new DecOp(normal)));
|
meta->addStatement(new GenOp(" @;\r\n\n", new DecOp(normal)));
|
||||||
|
|
||||||
|
Var* wsNormal = (Var*)LangElement::find("wsNormal");
|
||||||
|
|
||||||
if (!fd.features[MFT_NormalMap])
|
if (!fd.features[MFT_NormalMap])
|
||||||
{
|
{
|
||||||
Var* worldToTangent = getInWorldToTangent(componentList);
|
if (!wsNormal)
|
||||||
meta->addStatement(new GenOp(" @ = normalize(mul(@,float3(0,0,1.0f)));\r\n\n", normal, worldToTangent));
|
wsNormal = getInWorldNormal(componentList);
|
||||||
|
|
||||||
|
meta->addStatement(new GenOp(" @ = normalize( @ );\r\n\n", normal, wsNormal));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
meta->addStatement(new GenOp(" @ = normalize( half3( @ ) );\r\n", normal, wsNormal));
|
meta->addStatement(new GenOp(" @ = normalize( @ );\r\n", normal, wsNormal));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2168,7 +2187,7 @@ void RTLightingFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||||
// If there isn't a normal map then we need to pass
|
// If there isn't a normal map then we need to pass
|
||||||
// the world space normal to the pixel shader ourselves.
|
// the world space normal to the pixel shader ourselves.
|
||||||
//Temporarily disabled while we figure out how to better handle normals without a normal map
|
//Temporarily disabled while we figure out how to better handle normals without a normal map
|
||||||
/* if ( !fd.features[MFT_NormalMap] )
|
if ( !fd.features[MFT_NormalMap] )
|
||||||
{
|
{
|
||||||
Var *outNormal = connectComp->getElement( RT_TEXCOORD );
|
Var *outNormal = connectComp->getElement( RT_TEXCOORD );
|
||||||
outNormal->setName( "wsNormal" );
|
outNormal->setName( "wsNormal" );
|
||||||
|
|
@ -2180,7 +2199,7 @@ void RTLightingFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||||
|
|
||||||
// Transform the normal to world space.
|
// Transform the normal to world space.
|
||||||
meta->addStatement( new GenOp( " @ = mul( @, float4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) );
|
meta->addStatement( new GenOp( " @ = mul( @, float4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) );
|
||||||
}*/
|
}
|
||||||
|
|
||||||
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
|
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,8 @@ public:
|
||||||
|
|
||||||
Var* getSurface(Vector<ShaderComponent*>& componentList, MultiLine* meta, const MaterialFeatureData& fd);
|
Var* getSurface(Vector<ShaderComponent*>& componentList, MultiLine* meta, const MaterialFeatureData& fd);
|
||||||
|
|
||||||
|
Var* getInWorldNormal(Vector<ShaderComponent*>& componentList);
|
||||||
|
|
||||||
// ShaderFeature
|
// ShaderFeature
|
||||||
Var* getVertTexCoord( const String &name );
|
Var* getVertTexCoord( const String &name );
|
||||||
LangElement* setupTexSpaceMat( Vector<ShaderComponent*> &componentList, Var **texSpaceMat );
|
LangElement* setupTexSpaceMat( Vector<ShaderComponent*> &componentList, Var **texSpaceMat );
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ function sceneLightingComplete()
|
||||||
%probeCount = getWordCount(%probeIds);
|
%probeCount = getWordCount(%probeIds);
|
||||||
|
|
||||||
$pref::ReflectionProbes::CurrentLevelPath = filePath($Client::MissionFile) @ "/" @ fileBase($Client::MissionFile) @ "/probes/";
|
$pref::ReflectionProbes::CurrentLevelPath = filePath($Client::MissionFile) @ "/" @ fileBase($Client::MissionFile) @ "/probes/";
|
||||||
ProbeBin.processProbes();
|
//ProbeBin.processProbes();
|
||||||
|
|
||||||
onPhaseComplete("STARTING MISSION");
|
onPhaseComplete("STARTING MISSION");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -330,10 +330,6 @@ function ESettingsWindow::getNavEditorSettings(%this)
|
||||||
|
|
||||||
function ESettingsWindow::getSceneEditorSettings(%this)
|
function ESettingsWindow::getSceneEditorSettings(%this)
|
||||||
{
|
{
|
||||||
SettingsInspector.startGroup("Startup");
|
|
||||||
SettingsInspector.addSettingsField("WorldEditor/startupMode", "Startup Mode", "list", "", "Blank Level,Last Open Level");
|
|
||||||
SettingsInspector.endGroup();
|
|
||||||
|
|
||||||
SettingsInspector.startGroup("Render");
|
SettingsInspector.startGroup("Render");
|
||||||
SettingsInspector.addSettingsField("WorldEditor/Render/renderObjHandle", "Object Icons", "bool", "");
|
SettingsInspector.addSettingsField("WorldEditor/Render/renderObjHandle", "Object Icons", "bool", "");
|
||||||
SettingsInspector.addSettingsField("WorldEditor/Render/renderObjText", "Object Text", "bool", "");
|
SettingsInspector.addSettingsField("WorldEditor/Render/renderObjText", "Object Text", "bool", "");
|
||||||
|
|
|
||||||
|
|
@ -275,24 +275,7 @@ function fastLoadWorldEdit(%val)
|
||||||
// Flag saying, when level is chosen, launch it with the editor open.
|
// Flag saying, when level is chosen, launch it with the editor open.
|
||||||
%defaultLevelFile = EditorSettings.value( "WorldEditor/newLevelFile" );
|
%defaultLevelFile = EditorSettings.value( "WorldEditor/newLevelFile" );
|
||||||
|
|
||||||
%startupMode = EditorSettings.value("WorldEditor/startupMode", "Blank Level");
|
EditorNewLevel(%defaultLevelFile);
|
||||||
if(%startupMode $= "Blank Level")
|
|
||||||
{
|
|
||||||
EditorNewLevel(%defaultLevelFile);
|
|
||||||
}
|
|
||||||
else if(%startupMode $= "Last Open Level")
|
|
||||||
{
|
|
||||||
%lastLevel = EditorSettings.value("WorldEditor/lastEditedLevel", "");
|
|
||||||
|
|
||||||
if(%lastLevel $= "")
|
|
||||||
{
|
|
||||||
EditorNewLevel(%defaultLevelFile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EditorOpenMission(%lastLevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,9 @@ function EditorOpenMission(%levelAsset)
|
||||||
|
|
||||||
popInstantGroup();
|
popInstantGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If we've opened a valid level, clear the saveAs tag as it's not really applicable now
|
||||||
|
EditorGui.saveAs = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditorOpenSceneAppend(%levelAsset)
|
function EditorOpenSceneAppend(%levelAsset)
|
||||||
|
|
@ -605,8 +608,6 @@ function EditorUnmount()
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
function updateRecentLevelsListing()
|
function updateRecentLevelsListing()
|
||||||
{
|
{
|
||||||
RecentLevelsPopupMenu.clearItems();
|
|
||||||
|
|
||||||
%recentLevels = EditorSettings.value("WorldEditor/recentLevelsList");
|
%recentLevels = EditorSettings.value("WorldEditor/recentLevelsList");
|
||||||
%recentCount = getTokenCount(%recentLevels, ",");
|
%recentCount = getTokenCount(%recentLevels, ",");
|
||||||
|
|
||||||
|
|
@ -614,8 +615,11 @@ function updateRecentLevelsListing()
|
||||||
{
|
{
|
||||||
%recentEntry = getToken(%recentLevels, ",", %i);
|
%recentEntry = getToken(%recentLevels, ",", %i);
|
||||||
|
|
||||||
RecentLevelsPopupMenu.insertItem(%i, %recentEntry, "", "schedule(1,0, \"EditorOpenMission\", " @ %recentEntry @ ");");
|
%command = "schedule(32,0, \"EditorOpenMission\", \"" @ %recentEntry @ "\");";
|
||||||
|
RecentLevelsPopupMenu.item[%i] = %recentEntry TAB "" TAB %command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RecentLevelsPopupMenu.reloadItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue