mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +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
|
|
@ -767,6 +767,21 @@ Var* ShaderFeatureHLSL::getWsView( Var *wsPosition, MultiLine *meta )
|
|||
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,
|
||||
MultiLine *meta,
|
||||
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
|
||||
}
|
||||
|
||||
Var* wsNormal = (Var*)LangElement::find("wsNormal");
|
||||
Var* normal = (Var*)LangElement::find("normal");
|
||||
if (!normal)
|
||||
{
|
||||
normal = new Var("normal", "float3");
|
||||
meta->addStatement(new GenOp(" @;\r\n\n", new DecOp(normal)));
|
||||
|
||||
Var* wsNormal = (Var*)LangElement::find("wsNormal");
|
||||
|
||||
if (!fd.features[MFT_NormalMap])
|
||||
{
|
||||
Var* worldToTangent = getInWorldToTangent(componentList);
|
||||
meta->addStatement(new GenOp(" @ = normalize(mul(@,float3(0,0,1.0f)));\r\n\n", normal, worldToTangent));
|
||||
if (!wsNormal)
|
||||
wsNormal = getInWorldNormal(componentList);
|
||||
|
||||
meta->addStatement(new GenOp(" @ = normalize( @ );\r\n\n", normal, wsNormal));
|
||||
}
|
||||
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
|
||||
// the world space normal to the pixel shader ourselves.
|
||||
//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 );
|
||||
outNormal->setName( "wsNormal" );
|
||||
|
|
@ -2180,7 +2199,7 @@ void RTLightingFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
// Transform the normal to world space.
|
||||
meta->addStatement( new GenOp( " @ = mul( @, float4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) );
|
||||
}*/
|
||||
}
|
||||
|
||||
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
|
||||
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ public:
|
|||
|
||||
Var* getSurface(Vector<ShaderComponent*>& componentList, MultiLine* meta, const MaterialFeatureData& fd);
|
||||
|
||||
Var* getInWorldNormal(Vector<ShaderComponent*>& componentList);
|
||||
|
||||
// ShaderFeature
|
||||
Var* getVertTexCoord( const String &name );
|
||||
LangElement* setupTexSpaceMat( Vector<ShaderComponent*> &componentList, Var **texSpaceMat );
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ function sceneLightingComplete()
|
|||
%probeCount = getWordCount(%probeIds);
|
||||
|
||||
$pref::ReflectionProbes::CurrentLevelPath = filePath($Client::MissionFile) @ "/" @ fileBase($Client::MissionFile) @ "/probes/";
|
||||
ProbeBin.processProbes();
|
||||
//ProbeBin.processProbes();
|
||||
|
||||
onPhaseComplete("STARTING MISSION");
|
||||
|
||||
|
|
|
|||
|
|
@ -330,10 +330,6 @@ function ESettingsWindow::getNavEditorSettings(%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.addSettingsField("WorldEditor/Render/renderObjHandle", "Object Icons", "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.
|
||||
%defaultLevelFile = EditorSettings.value( "WorldEditor/newLevelFile" );
|
||||
|
||||
%startupMode = EditorSettings.value("WorldEditor/startupMode", "Blank Level");
|
||||
if(%startupMode $= "Blank Level")
|
||||
{
|
||||
EditorNewLevel(%defaultLevelFile);
|
||||
}
|
||||
else if(%startupMode $= "Last Open Level")
|
||||
{
|
||||
%lastLevel = EditorSettings.value("WorldEditor/lastEditedLevel", "");
|
||||
|
||||
if(%lastLevel $= "")
|
||||
{
|
||||
EditorNewLevel(%defaultLevelFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorOpenMission(%lastLevel);
|
||||
}
|
||||
}
|
||||
EditorNewLevel(%defaultLevelFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -435,6 +435,9 @@ function EditorOpenMission(%levelAsset)
|
|||
|
||||
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)
|
||||
|
|
@ -605,8 +608,6 @@ function EditorUnmount()
|
|||
//------------------------------------------------------------------------
|
||||
function updateRecentLevelsListing()
|
||||
{
|
||||
RecentLevelsPopupMenu.clearItems();
|
||||
|
||||
%recentLevels = EditorSettings.value("WorldEditor/recentLevelsList");
|
||||
%recentCount = getTokenCount(%recentLevels, ",");
|
||||
|
||||
|
|
@ -614,8 +615,11 @@ function updateRecentLevelsListing()
|
|||
{
|
||||
%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…
Reference in a new issue