mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Force proper update of box probe when attenuation changes
Fixed multiple case sensitivity issues Adds GL ARB check for cubemap arrays for certain cases where the driver only supports the extension, not as core Fixes undeeded namespace declaration in an inline operator function Cleaned up/reordered some modules default in the data dir WIP of Das Boot test map Begun refactoring visualizer tools Added default cloud and water textures to core/rendering so water and cloud objects work correctly Added default Fog_Cube mesh so volumetric fog works correctly
This commit is contained in:
parent
142da31156
commit
e916d14440
697 changed files with 11775 additions and 7072 deletions
|
|
@ -1,55 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<AssetImportSettings>
|
||||
<Group name="TestConfig">
|
||||
<Group name="Images">
|
||||
<Setting name="PopulateMaterialMaps">1</Setting>
|
||||
<Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
|
||||
<Setting name="IsHDR">0</Setting>
|
||||
<Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
|
||||
<Setting name="SmoothnessTypeSuffixes">_SMOOTH,_SMOOTHNESS</Setting>
|
||||
<Setting name="Scaling">1.0</Setting>
|
||||
<Setting name="Compressed">1</Setting>
|
||||
<Setting name="ImageType">N/A</Setting>
|
||||
<Setting name="GenerateMaterialOnImport">1</Setting>
|
||||
<Setting name="UseMips">1</Setting>
|
||||
<Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
|
||||
<Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
|
||||
<Setting name="TextureFilteringMode">Bilinear</Setting>
|
||||
<Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
|
||||
<Setting name="DiffuseTypeSuffixes">_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL</Setting>
|
||||
</Group>
|
||||
<Group name="Animations">
|
||||
<Setting name="SeparateAnimations">1</Setting>
|
||||
<Setting name="ImportAnimations">1</Setting>
|
||||
</Group>
|
||||
<Group name="Collision">
|
||||
<Setting name="GenLOSCollisionType">CollisionMesh</Setting>
|
||||
<Setting name="CollisionMeshPrefix">Col</Setting>
|
||||
<Setting name="LOSCollisionMeshPrefix">LOS</Setting>
|
||||
<Setting name="GenerateCollisions">1</Setting>
|
||||
<Setting name="GenerateLOSCollisions">1</Setting>
|
||||
<Setting name="GenCollisionType">CollisionMesh</Setting>
|
||||
<Group name="Meshes">
|
||||
<Setting name="DoUpAxisOverride">0</Setting>
|
||||
<Setting name="IgnoreNodeScale">0</Setting>
|
||||
<Setting name="ScaleOverride">1</Setting>
|
||||
<Setting name="CollapseSubmeshes">0</Setting>
|
||||
<Setting name="AdjustCenter">0</Setting>
|
||||
<Setting name="AdjustFloor">0</Setting>
|
||||
<Setting name="UpAxisOverride">Z_AXIS</Setting>
|
||||
<Setting name="LODType">TrailingNumber</Setting>
|
||||
</Group>
|
||||
<Group name="Materials">
|
||||
<Setting name="UseExistingMaterials">1</Setting>
|
||||
<Setting name="UseDiffuseSuffixOnOriginImage">1</Setting>
|
||||
<Setting name="CreateComposites">1</Setting>
|
||||
<Setting name="ImportMaterials">1</Setting>
|
||||
<Setting name="CreateComposites">1</Setting>
|
||||
<Setting name="UseDiffuseSuffixOnOriginImage">1</Setting>
|
||||
<Setting name="UseExistingMaterials">1</Setting>
|
||||
<Setting name="IgnoreMaterials">ColorEffect*,</Setting>
|
||||
</Group>
|
||||
<Group name="Meshes">
|
||||
<Setting name="AdjustFloor">0</Setting>
|
||||
<Setting name="ScaleOverride">1</Setting>
|
||||
<Setting name="LODType">TrailingNumber</Setting>
|
||||
<Setting name="CollapseSubmeshes">0</Setting>
|
||||
<Setting name="IgnoreNodeScale">0</Setting>
|
||||
<Setting name="UpAxisOverride">Z_AXIS</Setting>
|
||||
<Setting name="AdjustCenter">0</Setting>
|
||||
<Setting name="DoUpAxisOverride">0</Setting>
|
||||
<Group name="Images">
|
||||
<Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
|
||||
<Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
|
||||
<Setting name="PopulateMaterialMaps">1</Setting>
|
||||
<Setting name="UseMips">1</Setting>
|
||||
<Setting name="Compressed">1</Setting>
|
||||
<Setting name="TextureFilteringMode">Bilinear</Setting>
|
||||
<Setting name="GenerateMaterialOnImport">1</Setting>
|
||||
<Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
|
||||
<Setting name="IsHDR">0</Setting>
|
||||
<Setting name="Scaling">1.0</Setting>
|
||||
<Setting name="DiffuseTypeSuffixes">_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor,</Setting>
|
||||
<Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
|
||||
<Setting name="ImageType">N/A</Setting>
|
||||
<Setting name="SmoothnessTypeSuffixes">_SMOOTH,_SMOOTHNESS</Setting>
|
||||
<Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
|
||||
</Group>
|
||||
<Group name="Collision">
|
||||
<Setting name="GenerateLOSCollisions">1</Setting>
|
||||
<Setting name="GenerateCollisions">1</Setting>
|
||||
<Setting name="LOSCollisionMeshPrefix">LOS</Setting>
|
||||
<Setting name="CollisionMeshPrefix">Col</Setting>
|
||||
<Setting name="GenCollisionType">CollisionMesh</Setting>
|
||||
<Setting name="GenLOSCollisionType">CollisionMesh</Setting>
|
||||
</Group>
|
||||
<Group name="Animations">
|
||||
<Setting name="ImportAnimations">1</Setting>
|
||||
<Setting name="SeparateAnimations">1</Setting>
|
||||
</Group>
|
||||
<Group name="Sounds">
|
||||
<Setting name="Compressed">0</Setting>
|
||||
<Setting name="PitchAdjust">1.0</Setting>
|
||||
<Setting name="Compressed">0</Setting>
|
||||
<Setting name="VolumeAdjust">1.0</Setting>
|
||||
</Group>
|
||||
<Group name="General">
|
||||
|
|
|
|||
|
|
@ -1194,6 +1194,8 @@ function EWorldEditor::onControlDropped( %this, %payload, %position )
|
|||
%newEntity.position = %pos;
|
||||
%newEntity-->MeshComponent.MeshAsset = %module @ ":" @ %asset;
|
||||
|
||||
%newEntity.dirtyGameObject = true; //because if we're specifically setting the mesh asset, it's dirty
|
||||
|
||||
getScene(0).add(%newEntity);
|
||||
|
||||
EWorldEditor.clearSelection();
|
||||
|
|
|
|||
|
|
@ -271,5 +271,5 @@ function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %posi
|
|||
//Inspector.refresh();
|
||||
}
|
||||
|
||||
EWorldEditor.isDirty= true;
|
||||
EWorldEditor.isDirty = true;
|
||||
}
|
||||
|
|
@ -2106,7 +2106,7 @@ function MaterialEditorGui::createNewMaterial( %this )
|
|||
%material = getUniqueName( "newMaterial" );
|
||||
new Material(%material)
|
||||
{
|
||||
diffuseMap[0] = "core/art/warnmat";
|
||||
diffuseMap[0] = "core/rendering/images/warnmat";
|
||||
mapTo = "unmapped_mat";
|
||||
parentGroup = RootGroup;
|
||||
};
|
||||
|
|
@ -2137,7 +2137,7 @@ function MaterialEditorGui::deleteMaterial( %this )
|
|||
%toMaterial = getUniqueName( "newMaterial" );
|
||||
new Material(%toMaterial)
|
||||
{
|
||||
diffuseMap[0] = "core/art/warnmat";
|
||||
diffuseMap[0] = "core/rendering/images/warnmat";
|
||||
mapTo = "unmapped_mat";
|
||||
parentGroup = RootGroup;
|
||||
};
|
||||
|
|
@ -2155,7 +2155,7 @@ function MaterialEditorGui::deleteMaterial( %this )
|
|||
%toMaterial = getUniqueName( "newMaterial" );
|
||||
new Material(%toMaterial)
|
||||
{
|
||||
diffuseMap[0] = "core/art/warnmat";
|
||||
diffuseMap[0] = "core/rendering/images/warnmat";
|
||||
mapTo = "unmapped_mat";
|
||||
parentGroup = RootGroup;
|
||||
};
|
||||
|
|
@ -2170,7 +2170,7 @@ function MaterialEditorGui::deleteMaterial( %this )
|
|||
%newMaterial = getUniqueName( "newMaterial" );
|
||||
new Material(%newMaterial)
|
||||
{
|
||||
diffuseMap[0] = "core/art/warnmat";
|
||||
diffuseMap[0] = "core/rendering/images/warnmat";
|
||||
mapTo = "unmapped_mat";
|
||||
parentGroup = RootGroup;
|
||||
};
|
||||
|
|
@ -2482,7 +2482,7 @@ function MaterialEditorGui::saveCompositeMap(%this)
|
|||
%dlg = new SaveFileDialog()
|
||||
{
|
||||
Filters = "png";
|
||||
DefaultPath = EditorSettings.value("art/shapes/textures");
|
||||
DefaultPath = EditorSettings.value("data/");
|
||||
ChangePath = false;
|
||||
OverwritePrompt = true;
|
||||
};
|
||||
|
|
|
|||
BIN
Templates/BaseGame/game/tools/resources/checkerboard.png
Normal file
BIN
Templates/BaseGame/game/tools/resources/checkerboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
|
|
@ -76,9 +76,9 @@ function RiverEditorGui::createRiver( %this )
|
|||
|
||||
baseColor = "45 108 171 255";
|
||||
|
||||
rippleTex = "art/water/ripple.dds";
|
||||
foamTex = "art/water/foam";
|
||||
depthGradientTex = "art/water/depthcolor_ramp";
|
||||
rippleTex = "core/rendering/images/ripple.dds";
|
||||
foamTex = "core/rendering/images/foam";
|
||||
depthGradientTex = "core/rendering/images/depthcolor_ramp";
|
||||
};
|
||||
|
||||
return %river;
|
||||
|
|
|
|||
|
|
@ -1,131 +1,175 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<EditorSettings>
|
||||
<Group name="ConvexEditor">
|
||||
<Setting name="materialName">Grid_512_Orange</Setting>
|
||||
</Group>
|
||||
<Group name="NavEditor">
|
||||
<Setting name="SpawnClass">AIPlayer</Setting>
|
||||
</Group>
|
||||
<Group name="WorldEditor">
|
||||
<Setting name="dropType">screenCenter</Setting>
|
||||
<Setting name="undoLimit">40</Setting>
|
||||
<Setting name="torsionPath">AssetWork_Debug.exe</Setting>
|
||||
<Setting name="orthoShowGrid">1</Setting>
|
||||
<Setting name="orthoFOV">50</Setting>
|
||||
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
|
||||
<Setting name="displayType">6</Setting>
|
||||
<Setting name="forceLoadDAE">0</Setting>
|
||||
<Group name="Theme">
|
||||
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
|
||||
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
|
||||
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
|
||||
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
|
||||
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
|
||||
</Group>
|
||||
<Group name="Grid">
|
||||
<Setting name="gridOriginColor">255 255 255 100</Setting>
|
||||
<Setting name="gridSize">1</Setting>
|
||||
<Setting name="gridColor">102 102 102 100</Setting>
|
||||
<Setting name="gridMinorColor">51 51 51 100</Setting>
|
||||
<Setting name="gridSnap">0</Setting>
|
||||
</Group>
|
||||
<Group name="Images">
|
||||
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
|
||||
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
|
||||
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
|
||||
</Group>
|
||||
<Group name="ObjectIcons">
|
||||
<Setting name="fadeIconsStartDist">8</Setting>
|
||||
<Setting name="fadeIcons">1</Setting>
|
||||
<Setting name="fadeIconsEndAlpha">0</Setting>
|
||||
<Setting name="fadeIconsStartAlpha">255</Setting>
|
||||
<Setting name="fadeIconsEndDist">20</Setting>
|
||||
</Group>
|
||||
<Group name="Render">
|
||||
<Setting name="showMousePopupInfo">1</Setting>
|
||||
<Setting name="renderObjText">1</Setting>
|
||||
<Setting name="renderObjHandle">1</Setting>
|
||||
<Setting name="renderPopupBackground">1</Setting>
|
||||
<Setting name="renderSelectionBox">1</Setting>
|
||||
</Group>
|
||||
<Group name="Tools">
|
||||
<Setting name="objectsUseBoxCenter">1</Setting>
|
||||
<Setting name="snapSoftSize">2</Setting>
|
||||
<Setting name="snapSoft">0</Setting>
|
||||
<Setting name="dropAtScreenCenterMax">100</Setting>
|
||||
<Setting name="dropAtScreenCenterScalar">1</Setting>
|
||||
<Setting name="boundingBoxCollision">0</Setting>
|
||||
<Setting name="snapGround">0</Setting>
|
||||
</Group>
|
||||
<Group name="Docs">
|
||||
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
|
||||
<Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
|
||||
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
|
||||
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
|
||||
</Group>
|
||||
<Group name="Color">
|
||||
<Setting name="objMouseOverColor">0 255 0 255</Setting>
|
||||
<Setting name="dragRectColor">255 255 0 255</Setting>
|
||||
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
|
||||
<Setting name="selectionBoxColor">255 255 0 255</Setting>
|
||||
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
|
||||
<Setting name="objSelectColor">255 0 0 255</Setting>
|
||||
<Setting name="objectTextColor">255 255 255 255</Setting>
|
||||
</Group>
|
||||
<Group name="RiverEditor">
|
||||
<Setting name="HoverNodeColor">255 255 255 255</Setting>
|
||||
<Setting name="DefaultWidth">10</Setting>
|
||||
<Setting name="DefaultDepth">5</Setting>
|
||||
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
|
||||
<Setting name="DefaultNormal">0 0 1</Setting>
|
||||
<Setting name="HoverSplineColor">255 0 0 255</Setting>
|
||||
</Group>
|
||||
<Group name="GuiEditor">
|
||||
<Setting name="lastPath">tools/gui</Setting>
|
||||
<Setting name="previewResolution">1024 768</Setting>
|
||||
<Group name="Rendering">
|
||||
<Setting name="drawGuides">1</Setting>
|
||||
<Setting name="drawBorderLines">1</Setting>
|
||||
<Setting name="lastPath">tools/gui</Setting>
|
||||
<Group name="Selection">
|
||||
<Setting name="fullBox">0</Setting>
|
||||
</Group>
|
||||
<Group name="EngineDevelopment">
|
||||
<Setting name="showEditorProfiles">0</Setting>
|
||||
<Setting name="showEditorGuis">0</Setting>
|
||||
<Setting name="toggleIntoEditor">0</Setting>
|
||||
</Group>
|
||||
<Group name="Snapping">
|
||||
<Setting name="snapToEdges">1</Setting>
|
||||
<Setting name="snapToCenters">1</Setting>
|
||||
<Setting name="snap2Grid">0</Setting>
|
||||
<Setting name="snap2GridSize">8</Setting>
|
||||
<Setting name="snapToCenters">1</Setting>
|
||||
<Setting name="snapToGuides">1</Setting>
|
||||
<Setting name="snapToEdges">1</Setting>
|
||||
<Setting name="snapToControls">1</Setting>
|
||||
<Setting name="snapToCanvas">1</Setting>
|
||||
<Setting name="snapToGuides">1</Setting>
|
||||
<Setting name="sensitivity">2</Setting>
|
||||
</Group>
|
||||
<Group name="Help">
|
||||
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
|
||||
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
|
||||
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
|
||||
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
|
||||
</Group>
|
||||
<Group name="Rendering">
|
||||
<Setting name="drawBorderLines">1</Setting>
|
||||
<Setting name="drawGuides">1</Setting>
|
||||
</Group>
|
||||
<Group name="Library">
|
||||
<Setting name="viewType">Categorized</Setting>
|
||||
</Group>
|
||||
<Group name="EngineDevelopment">
|
||||
<Setting name="showEditorGuis">0</Setting>
|
||||
<Setting name="showEditorProfiles">0</Setting>
|
||||
<Setting name="toggleIntoEditor">0</Setting>
|
||||
</Group>
|
||||
<Group name="WorldEditor">
|
||||
<Setting name="torsionPath">AssetWork_Debug.exe</Setting>
|
||||
<Setting name="displayType">6</Setting>
|
||||
<Setting name="forceLoadDAE">0</Setting>
|
||||
<Setting name="orthoShowGrid">1</Setting>
|
||||
<Setting name="orthoFOV">50</Setting>
|
||||
<Setting name="undoLimit">40</Setting>
|
||||
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
|
||||
<Setting name="dropType">screenCenter</Setting>
|
||||
<Group name="Render">
|
||||
<Setting name="renderPopupBackground">1</Setting>
|
||||
<Setting name="renderObjText">1</Setting>
|
||||
<Setting name="showMousePopupInfo">1</Setting>
|
||||
<Setting name="renderSelectionBox">1</Setting>
|
||||
<Setting name="renderObjHandle">1</Setting>
|
||||
</Group>
|
||||
<Group name="Selection">
|
||||
<Setting name="fullBox">0</Setting>
|
||||
<Group name="Color">
|
||||
<Setting name="selectionBoxColor">255 255 0 255</Setting>
|
||||
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
|
||||
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
|
||||
<Setting name="objMouseOverColor">0 255 0 255</Setting>
|
||||
<Setting name="dragRectColor">255 255 0 255</Setting>
|
||||
<Setting name="objSelectColor">255 0 0 255</Setting>
|
||||
<Setting name="objectTextColor">255 255 255 255</Setting>
|
||||
</Group>
|
||||
<Group name="Theme">
|
||||
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
|
||||
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
|
||||
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
|
||||
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
|
||||
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
|
||||
</Group>
|
||||
<Group name="Tools">
|
||||
<Setting name="dropAtScreenCenterMax">100</Setting>
|
||||
<Setting name="objectsUseBoxCenter">1</Setting>
|
||||
<Setting name="snapSoftSize">2</Setting>
|
||||
<Setting name="snapGround">0</Setting>
|
||||
<Setting name="snapSoft">0</Setting>
|
||||
<Setting name="boundingBoxCollision">0</Setting>
|
||||
<Setting name="dropAtScreenCenterScalar">1</Setting>
|
||||
</Group>
|
||||
<Group name="Grid">
|
||||
<Setting name="gridSnap">0</Setting>
|
||||
<Setting name="gridColor">102 102 102 100</Setting>
|
||||
<Setting name="gridOriginColor">255 255 255 100</Setting>
|
||||
<Setting name="gridMinorColor">51 51 51 100</Setting>
|
||||
<Setting name="gridSize">1</Setting>
|
||||
</Group>
|
||||
<Group name="Docs">
|
||||
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
|
||||
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
|
||||
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
|
||||
<Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
|
||||
</Group>
|
||||
<Group name="ObjectIcons">
|
||||
<Setting name="fadeIcons">1</Setting>
|
||||
<Setting name="fadeIconsStartDist">8</Setting>
|
||||
<Setting name="fadeIconsEndDist">20</Setting>
|
||||
<Setting name="fadeIconsStartAlpha">255</Setting>
|
||||
<Setting name="fadeIconsEndAlpha">0</Setting>
|
||||
</Group>
|
||||
<Group name="Images">
|
||||
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
|
||||
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
|
||||
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="TerrainEditor">
|
||||
<Setting name="currentAction">lowerHeight</Setting>
|
||||
<Group name="Brush">
|
||||
<Setting name="brushType">ellipse</Setting>
|
||||
<Setting name="brushSize">40 40</Setting>
|
||||
<Setting name="maxBrushSize">40 40</Setting>
|
||||
<Setting name="brushSoftness">1</Setting>
|
||||
<Setting name="brushPressure">1</Setting>
|
||||
</Group>
|
||||
<Group name="ActionValues">
|
||||
<Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
|
||||
<Setting name="adjustHeightVal">10</Setting>
|
||||
<Setting name="setHeightVal">100</Setting>
|
||||
<Setting name="scaleVal">1</Setting>
|
||||
<Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
|
||||
<Setting name="SlopeMinAngle">0</Setting>
|
||||
<Setting name="noiseFactor">1</Setting>
|
||||
<Setting name="softSelectRadius">50</Setting>
|
||||
<Setting name="smoothFactor">0.1</Setting>
|
||||
<Setting name="SlopeMaxAngle">90</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="AxisGizmo">
|
||||
<Setting name="rotationSnap">15</Setting>
|
||||
<Setting name="mouseRotateScalar">0.8</Setting>
|
||||
<Setting name="mouseScaleScalar">0.8</Setting>
|
||||
<Setting name="renderInfoText">1</Setting>
|
||||
<Setting name="renderWhenUsed">0</Setting>
|
||||
<Setting name="axisGizmoMaxScreenLen">100</Setting>
|
||||
<Setting name="snapRotations">0</Setting>
|
||||
<Group name="Grid">
|
||||
<Setting name="snapToGrid">0</Setting>
|
||||
<Setting name="gridSize">10 10 10</Setting>
|
||||
<Setting name="planeDim">500</Setting>
|
||||
<Setting name="renderPlaneHashes">0</Setting>
|
||||
<Setting name="renderPlane">0</Setting>
|
||||
<Setting name="gridColor">255 255 255 20</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="Theme">
|
||||
<Setting name="tabsHLColor">50 49 48 255</Setting>
|
||||
<Setting name="dividerLightColor">96 94 92 255</Setting>
|
||||
<Setting name="dividerMidColor">50 49 48 255</Setting>
|
||||
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
|
||||
<Setting name="dividerDarkColor">17 16 15 255</Setting>
|
||||
<Setting name="fieldTextColor">178 175 172 255</Setting>
|
||||
<Setting name="tabsColor">37 36 35 255</Setting>
|
||||
<Setting name="tabsSELColor">59 58 57 255</Setting>
|
||||
<Setting name="headerTextColor">236 234 232 255</Setting>
|
||||
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
|
||||
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
|
||||
<Setting name="tooltipTextColor">255 255 255 255</Setting>
|
||||
<Setting name="fieldBGColor">59 58 57 255</Setting>
|
||||
<Setting name="fieldTextSELColor">240 240 240 255</Setting>
|
||||
<Setting name="headerColor">50 49 48 255</Setting>
|
||||
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
|
||||
<Setting name="fieldBGSELColor">100 98 96 255</Setting>
|
||||
<Setting name="tooltipBGColor">43 43 43 255</Setting>
|
||||
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
|
||||
<Setting name="tooltipTextColor">255 255 255 255</Setting>
|
||||
<Setting name="dividerLightColor">96 94 92 255</Setting>
|
||||
<Setting name="fieldTextSELColor">240 240 240 255</Setting>
|
||||
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
|
||||
<Setting name="headerColor">50 49 48 255</Setting>
|
||||
<Setting name="tabsHLColor">50 49 48 255</Setting>
|
||||
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
|
||||
<Setting name="headerTextColor">236 234 232 255</Setting>
|
||||
<Setting name="dividerMidColor">50 49 48 255</Setting>
|
||||
<Setting name="tabsSELColor">59 58 57 255</Setting>
|
||||
<Setting name="tabsColor">37 36 35 255</Setting>
|
||||
<Setting name="fieldTextColor">178 175 172 255</Setting>
|
||||
<Setting name="fieldBGColor">59 58 57 255</Setting>
|
||||
<Setting name="dividerDarkColor">17 16 15 255</Setting>
|
||||
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
|
||||
</Group>
|
||||
<Group name="ConvexEditor">
|
||||
<Setting name="materialName">Grid_512_Orange</Setting>
|
||||
</Group>
|
||||
<Group name="LevelInformation">
|
||||
<Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
|
||||
|
|
@ -138,21 +182,7 @@
|
|||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="AxisGizmo">
|
||||
<Setting name="snapRotations">0</Setting>
|
||||
<Setting name="renderInfoText">1</Setting>
|
||||
<Setting name="rotationSnap">15</Setting>
|
||||
<Setting name="renderWhenUsed">0</Setting>
|
||||
<Setting name="mouseRotateScalar">0.8</Setting>
|
||||
<Setting name="axisGizmoMaxScreenLen">100</Setting>
|
||||
<Setting name="mouseScaleScalar">0.8</Setting>
|
||||
<Group name="Grid">
|
||||
<Setting name="renderPlane">0</Setting>
|
||||
<Setting name="gridSize">10 10 10</Setting>
|
||||
<Setting name="renderPlaneHashes">0</Setting>
|
||||
<Setting name="gridColor">255 255 255 20</Setting>
|
||||
<Setting name="snapToGrid">0</Setting>
|
||||
<Setting name="planeDim">500</Setting>
|
||||
</Group>
|
||||
<Group name="NavEditor">
|
||||
<Setting name="SpawnClass">AIPlayer</Setting>
|
||||
</Group>
|
||||
</EditorSettings>
|
||||
|
|
|
|||
|
|
@ -672,7 +672,7 @@ function ObjectBuilderGui::buildCloudLayer(%this)
|
|||
{
|
||||
OBObjectName.setValue( "" );
|
||||
%this.objectClassName = "CloudLayer";
|
||||
%this.addField( "texture", "TypeImageFilename", "Texture", "art/skies/clouds/clouds_normal_displacement" );
|
||||
%this.addField( "texture", "TypeImageFilename", "Texture", "core/rendering/images/clouds_normal_displacement" );
|
||||
%this.process();
|
||||
}
|
||||
|
||||
|
|
@ -684,9 +684,9 @@ function ObjectBuilderGui::buildBasicClouds(%this)
|
|||
|
||||
// This is a trick... any fields added after process won't show
|
||||
// up as controls, but will be applied to the created object.
|
||||
%this.addField( "texture[0]", "TypeImageFilename", "Texture", "art/skies/clouds/cloud1" );
|
||||
%this.addField( "texture[1]", "TypeImageFilename", "Texture", "art/skies/clouds/cloud2" );
|
||||
%this.addField( "texture[2]", "TypeImageFilename", "Texture", "art/skies/clouds/cloud3" );
|
||||
%this.addField( "texture[0]", "TypeImageFilename", "Texture", "core/rendering/images/cloud1" );
|
||||
%this.addField( "texture[1]", "TypeImageFilename", "Texture", "core/rendering/images/cloud2" );
|
||||
%this.addField( "texture[2]", "TypeImageFilename", "Texture", "core/rendering/images/cloud3" );
|
||||
}
|
||||
|
||||
function ObjectBuilderGui::checkExists( %this, %classname )
|
||||
|
|
@ -797,9 +797,9 @@ function ObjectBuilderGui::addWaterObjectFields(%this)
|
|||
%this.addField("waveSpeed[2]", "TypeFloat", "Wave Speed", "1");
|
||||
%this.addField("overallWaveMagnitude", "TypeFloat", "Overall Wave Magnitude", "1.0");
|
||||
|
||||
%this.addField("rippleTex", "TypeImageFilename", "Ripple Texture", "art/water/ripple" );
|
||||
%this.addField("depthGradientTex", "TypeImageFilename", "Depth Gradient Texture", "art/water/depthcolor_ramp" );
|
||||
%this.addField("foamTex", "TypeImageFilename", "Foam Texture", "art/water/foam" );
|
||||
%this.addField("rippleTex", "TypeImageFilename", "Ripple Texture", "core/rendering/images/ripple" );
|
||||
%this.addField("depthGradientTex", "TypeImageFilename", "Depth Gradient Texture", "core/rendering/images/depthcolor_ramp" );
|
||||
%this.addField("foamTex", "TypeImageFilename", "Foam Texture", "core/rendering/images/foam" );
|
||||
}
|
||||
|
||||
function ObjectBuilderGui::buildWaterBlock(%this)
|
||||
|
|
@ -1002,7 +1002,7 @@ function ObjectBuilderGui::buildVolumetricFog(%this)
|
|||
{
|
||||
// Change this if you want to default to another Folder
|
||||
// Otherwise every time you want to add a Fog you will go this.
|
||||
%defShape = "/art/environment/Fog_Cube.dts";
|
||||
%defShape = "core/rendering/shapes/Fog_Cube.DAE";
|
||||
%this.lastPath=getMainDotCsDir() @ %defShape;
|
||||
OBObjectName.setValue( "" );
|
||||
%this.objectClassName = "VolumetricFog";
|
||||
|
|
|
|||
|
|
@ -59,15 +59,16 @@ function initializeWorldEditor()
|
|||
exec("./scripts/editorRender.ed.cs");
|
||||
exec("./scripts/editorPlugin.ed.cs");
|
||||
exec("./scripts/EditorChooseLevelGui.ed.cs");
|
||||
exec("./scripts/visibilityLayer.ed.cs");
|
||||
exec("./scripts/cameraBookmarks.ed.cs");
|
||||
exec("./scripts/ManageSFXParametersWindow.ed.cs");
|
||||
exec("./scripts/AddFMODProjectDlg.ed.cs");
|
||||
exec("./scripts/SelectObjectsWindow.ed.cs");
|
||||
exec("./scripts/cameraCommands.ed.cs");
|
||||
exec("./scripts/lightViz.cs");
|
||||
exec("./scripts/shadowViz.cs");
|
||||
exec("./scripts/probeBake.ed.cs");
|
||||
exec("./scripts/visibility/visibilityLayer.ed.cs");
|
||||
exec("./scripts/visibility/lightViz.cs");
|
||||
exec("./scripts/visibility/shadowViz.cs");
|
||||
exec("./scripts/visibility/miscViz.cs");
|
||||
|
||||
// Load Custom Editors
|
||||
loadDirectory(expandFilename("./scripts/editors"));
|
||||
|
|
@ -106,8 +107,10 @@ function initializeWorldEditor()
|
|||
editorGui = EWorldEditor;
|
||||
};
|
||||
|
||||
setupEditorVisibilityMenu();
|
||||
|
||||
// Expose stock visibility/debug options.
|
||||
EVisibility.addOption( "Render: Zones", "$Zone::isRenderable", "" );
|
||||
/*EVisibility.addOption( "Render: Zones", "$Zone::isRenderable", "" );
|
||||
EVisibility.addOption( "Render: Portals", "$Portal::isRenderable", "" );
|
||||
EVisibility.addOption( "Render: Occlusion Volumes", "$OcclusionVolume::isRenderable", "" );
|
||||
EVisibility.addOption( "Render: Triggers", "$Trigger::renderTriggers", "" );
|
||||
|
|
@ -148,7 +151,7 @@ function initializeWorldEditor()
|
|||
EVisibility.addOption( "Colorblindness: Tritanopia", "$CBV_Tritanopia", "toggleColorBlindnessViz" );
|
||||
EVisibility.addOption( "Colorblindness: Tritanomaly", "$CBV_Tritanomaly", "toggleColorBlindnessViz" );
|
||||
EVisibility.addOption( "Colorblindness: Achromatopsia", "$CBV_Achromatopsia", "toggleColorBlindnessViz" );
|
||||
EVisibility.addOption( "Colorblindness: Achromatomaly", "$CBV_Achromatomaly", "toggleColorBlindnessViz" );
|
||||
EVisibility.addOption( "Colorblindness: Achromatomaly", "$CBV_Achromatomaly", "toggleColorBlindnessViz" );*/
|
||||
}
|
||||
|
||||
function destroyWorldEditor()
|
||||
|
|
|
|||
|
|
@ -1311,17 +1311,7 @@ function CameraTypesDropdownToggle()
|
|||
|
||||
function VisibilityDropdownToggle()
|
||||
{
|
||||
if ( EVisibility.visible )
|
||||
{
|
||||
EVisibility.setVisible(false);
|
||||
visibilityToggleBtn.setStateOn(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
EVisibility.setVisible(true);
|
||||
visibilityToggleBtn.setStateOn(1);
|
||||
EVisibility.setExtent("200 540");
|
||||
}
|
||||
EditorVisibilityOptions.showPopup(Canvas);
|
||||
}
|
||||
|
||||
function CameraTypesDropdownDecoy::onMouseLeave()
|
||||
|
|
|
|||
|
|
@ -1,118 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//Using calculations and values provided by Alan Zucconi
|
||||
// www.alanzucconi.com
|
||||
|
||||
#include "../../../../core/rendering/shaders/shaderModelAutoGen.hlsl"
|
||||
#include "../../../../core/rendering/shaders/postFX/postFx.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(backBufferTex,0);
|
||||
|
||||
uniform float mode;
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float4 imageColor = TORQUE_TEX2D( backBufferTex, IN.uv0 );
|
||||
|
||||
if(mode == 0)
|
||||
{
|
||||
return imageColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
float3 R = imageColor.r;
|
||||
float3 G = imageColor.g;
|
||||
float3 B = imageColor.b;
|
||||
|
||||
if(mode == 1) // Protanopia
|
||||
{
|
||||
R = float3(0.56667, 0.43333, 0);
|
||||
G = float3(0.55833, 0.44167, 0);
|
||||
B = float3(0, 0.24167, 0.75833);
|
||||
}
|
||||
else if(mode == 2) // Protanomaly
|
||||
{
|
||||
R = float3(0.81667, 0.18333, 0);
|
||||
G = float3(0.33333, 0.66667, 0);
|
||||
B = float3(0, 0.125, 0.875);
|
||||
}
|
||||
else if(mode == 3) // Deuteranopia
|
||||
{
|
||||
R = float3(0.625, 0.375, 0);
|
||||
G = float3(0.70, 0.30, 0);
|
||||
B = float3(0, 0.30, 0.70);
|
||||
}
|
||||
else if(mode == 4) // Deuteranomaly
|
||||
{
|
||||
R = float3(0.80, 0.20, 0);
|
||||
G = float3(0.25833, 0.74167, 0);
|
||||
B = float3(0, 0.14167, 0.85833);
|
||||
}
|
||||
else if(mode == 5) // Tritanopia
|
||||
{
|
||||
R = float3(0.95, 0.05, 0);
|
||||
G = float3(0, 0.43333, 0.56667);
|
||||
B = float3(0, 0.475, 0.525);
|
||||
}
|
||||
else if(mode == 6) // Tritanomaly
|
||||
{
|
||||
R = float3(0.96667, 0.03333, 0);
|
||||
G = float3(0, 0.73333, 0.26667);
|
||||
B = float3(0, 0.18333, 0.81667);
|
||||
}
|
||||
else if(mode == 7) // Achromatopsia
|
||||
{
|
||||
R = float3(0.299, 0.587, 0.114);
|
||||
G = float3(0.299, 0.587, 0.114);
|
||||
B = float3(0.299, 0.587, 0.114);
|
||||
}
|
||||
else if(mode == 8) // Achromatomaly
|
||||
{
|
||||
R = float3(0.618, 0.32, 0.062);
|
||||
G = float3(0.163, 0.775, 0.062);
|
||||
B = float3(0.163, 0.320, 0.516);
|
||||
}
|
||||
|
||||
//First set
|
||||
float4 c = imageColor;
|
||||
|
||||
c.r = c.r * R[0] + c.g * R[1] + c.b * R[2];
|
||||
c.g = c.r * G[0] + c.g * G[1] + c.b * G[2];
|
||||
c.b = c.r * B[0] + c.g * B[1] + c.b * B[2];
|
||||
|
||||
float3 cb = c.rgb;
|
||||
|
||||
cb.r = c.r * R[0] + c.g * R[1] + c.b * R[2];
|
||||
cb.g = c.r * G[0] + c.g * G[1] + c.b * G[2];
|
||||
cb.b = c.r * B[0] + c.g * B[1] + c.b * B[2];
|
||||
|
||||
// Difference
|
||||
float3 diff = abs(c.rgb - cb);
|
||||
|
||||
float lum = c.r*.3 + c.g*.59 + c.b*.11;
|
||||
float3 bw = float3(lum, lum, lum);
|
||||
|
||||
// return float4(lerp(bw, float3(1, 0, 0), saturate((diff.r + diff.g + diff.b) / 3)), c.a);
|
||||
return float4(c.rgb,1);
|
||||
}
|
||||
}
|
||||
|
|
@ -361,80 +361,3 @@ function toggleBackbufferViz( %enable )
|
|||
}
|
||||
}
|
||||
|
||||
function toggleColorBlindnessViz( %enable )
|
||||
{
|
||||
if ( %enable $= "" )
|
||||
{
|
||||
$CBV_Protanopia = ColorBlindnessVisualize.isEnabled() ? false : true;
|
||||
ColorBlindnessVisualize.toggle();
|
||||
}
|
||||
else if ( %enable )
|
||||
ColorBlindnessVisualize.enable();
|
||||
else if ( !%enable )
|
||||
ColorBlindnessVisualize.disable();
|
||||
}
|
||||
|
||||
new ShaderData( ColorBlindnessVisualizeShader )
|
||||
{
|
||||
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
||||
DXPixelShaderFile = "tools/worldEditor/scripts/shaders/dbgColorBlindnessVisualizeP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "tools/worldEditor/scripts/shaders/dbgColorBlindnessVisualizeP.glsl";
|
||||
|
||||
samplerNames[0] = "$backBuffer";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
singleton PostEffect( ColorBlindnessVisualize )
|
||||
{
|
||||
isEnabled = false;
|
||||
allowReflectPass = false;
|
||||
renderTime = "PFXAfterBin";
|
||||
renderBin = "GlowBin";
|
||||
|
||||
shader = ColorBlindnessVisualizeShader;
|
||||
stateBlock = PFX_DefaultStateBlock;
|
||||
texture[0] = "$backBuffer";
|
||||
target = "$backBuffer";
|
||||
renderPriority = 10;
|
||||
};
|
||||
|
||||
function ColorBlindnessVisualize::setShaderConsts(%this)
|
||||
{
|
||||
%mode = 0;
|
||||
|
||||
if($CBV_Protanopia)
|
||||
%mode = 1;
|
||||
else if($CBV_Protanomaly)
|
||||
%mode = 2;
|
||||
else if($CBV_Deuteranopia)
|
||||
%mode = 3;
|
||||
else if($CBV_Deuteranomaly)
|
||||
%mode = 4;
|
||||
else if($CBV_Tritanopia)
|
||||
%mode = 5;
|
||||
else if($CBV_Tritanomaly)
|
||||
%mode = 6;
|
||||
else if($CBV_Achromatopsia)
|
||||
%mode = 7;
|
||||
else if($CBV_Achromatomaly)
|
||||
%mode = 8;
|
||||
|
||||
%this.setShaderConst("$mode", %mode);
|
||||
}
|
||||
|
||||
function ColorBlindnessVisualize::onEnabled( %this )
|
||||
{
|
||||
AL_NormalsVisualize.disable();
|
||||
AL_DepthVisualize.disable();
|
||||
AL_LightSpecularVisualize.disable();
|
||||
AL_LightColorVisualize.disable();
|
||||
$AL_NormalsVisualizeVar = false;
|
||||
$AL_DepthVisualizeVar = false;
|
||||
$AL_LightSpecularVisualizeVar = false;
|
||||
$AL_LightColorVisualizeVar = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,301 @@
|
|||
new GFXStateBlockData( Viz_DefaultVisualizeState )
|
||||
{
|
||||
/*alphaDefined = true;
|
||||
alphaTestEnable = true;
|
||||
alphaTestRef = 1;
|
||||
alphaTestFunc = GFXCmpGreaterEqual;
|
||||
|
||||
// Do a one to one blend.
|
||||
blendDefined = true;
|
||||
blendEnable = true;
|
||||
blendSrc = GFXBlendOne;
|
||||
blendDest = GFXBlendOne;
|
||||
|
||||
zDefined = true;
|
||||
zEnable = false;
|
||||
zWriteEnable = false;
|
||||
|
||||
samplersDefined = true;
|
||||
samplerStates[0] = SamplerClampPoint;
|
||||
samplerStates[1] = SamplerClampPoint;
|
||||
samplerStates[2] = SamplerClampPoint;
|
||||
samplerStates[3] = SamplerClampPoint;
|
||||
samplerStates[4] = SamplerClampLinear;
|
||||
samplerStates[5] = SamplerClampLinear;*/
|
||||
blendDefined = true;
|
||||
blendEnable = true;
|
||||
blendSrc = GFXBlendSrcAlpha;
|
||||
blendDest = GFXBlendInvSrcAlpha;
|
||||
|
||||
zDefined = true;
|
||||
zEnable = false;
|
||||
zWriteEnable = false;
|
||||
|
||||
samplersDefined = true;
|
||||
samplerStates[0] = SamplerClampPoint; // #deferred
|
||||
samplerStates[1] = SamplerClampPoint;
|
||||
samplerStates[2] = SamplerClampPoint;
|
||||
samplerStates[3] = SamplerClampLinear; // depthviz
|
||||
samplerStates[4] = SamplerClampLinear; // depthviz
|
||||
};
|
||||
|
||||
new ShaderData( Viz_TexelDensity )
|
||||
{
|
||||
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
||||
DXPixelShaderFile = "./shaders/Viz_TexelDensityP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "./shaders/Viz_TexelDensityP.glsl";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
singleton PostEffect( Viz_TexelDensityPFX )
|
||||
{
|
||||
shader = Viz_TexelDensity;
|
||||
stateBlock = AL_DefaultVisualizeState;
|
||||
texture[0] = "tools/resources/checkerboard";
|
||||
target = "$backBuffer";
|
||||
renderPriority = 9999;
|
||||
};
|
||||
|
||||
/// Toggles the visualization of the AL lighting specular power buffer.
|
||||
function toggleTexelDensityViz( %enable )
|
||||
{
|
||||
if ( %enable $= "" )
|
||||
{
|
||||
$Viz_TexelDensityVar = Viz_TexelDensityPFX.isEnabled() ? false : true;
|
||||
Viz_TexelDensityPFX.toggle();
|
||||
}
|
||||
else if ( %enable )
|
||||
{
|
||||
Viz_TexelDensityPFX.enable();
|
||||
}
|
||||
else if ( !%enable )
|
||||
{
|
||||
Viz_TexelDensityPFX.disable();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
new ShaderData( Viz_SurfaceProperties )
|
||||
{
|
||||
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
||||
DXPixelShaderFile = "./shaders/Viz_SurfacePropertiesP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "./shaders/Viz_SurfacePropertiesP.glsl";
|
||||
|
||||
samplerNames[0] = "deferredTex";
|
||||
samplerNames[1] = "colorBufferTex";
|
||||
samplerNames[2] = "matinfoTex";
|
||||
samplerNames[3] = "$backBuffer";
|
||||
samplerNames[4] = "glowBuffer";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
singleton PostEffect( Viz_SurfacePropertiesPFX )
|
||||
{
|
||||
shader = Viz_SurfaceProperties;
|
||||
stateBlock = Viz_DefaultVisualizeState;
|
||||
texture[0] = "#deferred";
|
||||
texture[1] = "#color";
|
||||
texture[2] = "#matinfo";
|
||||
texture[3] = "$backBuffer";
|
||||
texture[4] = "#glowbuffer";
|
||||
|
||||
target = "$backBuffer";
|
||||
renderPriority = 9999;
|
||||
};
|
||||
|
||||
/// Toggles the visualization of the AL lighting specular power buffer.
|
||||
function toggleSurfacePropertiesViz( %mode )
|
||||
{
|
||||
%previousMode = $Viz_SurfacePropertiesModeVar;
|
||||
|
||||
switch$ ( %mode )
|
||||
{
|
||||
case "BaseColor":
|
||||
$Viz_SurfacePropertiesModeVar = "0";
|
||||
case "Normal":
|
||||
$Viz_SurfacePropertiesModeVar = "1";
|
||||
case "AO":
|
||||
$Viz_SurfacePropertiesModeVar = "2";
|
||||
case "Roughness":
|
||||
$Viz_SurfacePropertiesModeVar = "3";
|
||||
case "Metalness":
|
||||
$Viz_SurfacePropertiesModeVar = "4";
|
||||
case "Depth":
|
||||
$Viz_SurfacePropertiesModeVar = "5";
|
||||
case "DiffuseColor":
|
||||
$Viz_SurfacePropertiesModeVar = "6";
|
||||
case "SpecularColor":
|
||||
$Viz_SurfacePropertiesModeVar = "7";
|
||||
case "MatFlag":
|
||||
$Viz_SurfacePropertiesModeVar = "8";
|
||||
case "WorldPos":
|
||||
$Viz_SurfacePropertiesModeVar = "9";
|
||||
case "ReflectionVector":
|
||||
$Viz_SurfacePropertiesModeVar = "10";
|
||||
case "Fresnel":
|
||||
$Viz_SurfacePropertiesModeVar = "11";
|
||||
case "Backbuffer":
|
||||
$Viz_SurfacePropertiesModeVar = "12";
|
||||
case "Glow":
|
||||
$Viz_SurfacePropertiesModeVar = "13";
|
||||
default:
|
||||
$Viz_SurfacePropertiesModeVar = "-1";
|
||||
}
|
||||
|
||||
//If the visualizer isn't enabled, we just flip it on
|
||||
if(!Viz_SurfacePropertiesPFX.isEnabled())
|
||||
{
|
||||
Viz_SurfacePropertiesPFX.enable();
|
||||
}
|
||||
else //if it's currently enabled, check if we clicked the same mode again. If so, disable. If not, just swap modes to the new one
|
||||
{
|
||||
if(%previousMode == $Viz_SurfacePropertiesModeVar)
|
||||
{
|
||||
$Viz_SurfacePropertiesModeVar = -1;
|
||||
Viz_SurfacePropertiesPFX.disable();
|
||||
}
|
||||
}
|
||||
|
||||
for(%i=0; %i < 14; %i++)
|
||||
{
|
||||
if(%i == $Viz_SurfacePropertiesModeVar)
|
||||
EVisibilityBufferVizOptions.checkItem(%i, true);
|
||||
else
|
||||
EVisibilityBufferVizOptions.checkItem(%i, false);
|
||||
}
|
||||
}
|
||||
|
||||
function Viz_SurfacePropertiesPFX::setShaderConsts(%this)
|
||||
{
|
||||
%this.setShaderConst("$mode", $Viz_SurfacePropertiesModeVar);
|
||||
}
|
||||
|
||||
function disableSurfacePropertiesViz()
|
||||
{
|
||||
Viz_SurfacePropertiesPFX.disable();
|
||||
$Viz_SurfacePropertiesModeVar = -1;
|
||||
|
||||
for(%i=0; %i < 14; %i++)
|
||||
{
|
||||
EVisibilityBufferVizOptions.checkItem(%i, false);
|
||||
}
|
||||
}
|
||||
|
||||
function Viz_SurfacePropertiesPFX::onEnabled( %this )
|
||||
{
|
||||
//Disable the buffer visualization
|
||||
disableColorblindnessViz();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
new ShaderData( Viz_ColorBlindness )
|
||||
{
|
||||
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
||||
DXPixelShaderFile = "./shaders/Viz_ColorblindnessP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "./shaders/Viz_ColorblindnessP.glsl";
|
||||
|
||||
samplerNames[0] = "$backBuffer";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
singleton PostEffect( Viz_ColorBlindnessPFX )
|
||||
{
|
||||
isEnabled = false;
|
||||
allowReflectPass = false;
|
||||
renderTime = "PFXAfterBin";
|
||||
renderBin = "GlowBin";
|
||||
|
||||
shader = Viz_ColorBlindness;
|
||||
stateBlock = PFX_DefaultStateBlock;
|
||||
texture[0] = "$backBuffer";
|
||||
|
||||
target = "$backBuffer";
|
||||
renderPriority = 10;
|
||||
};
|
||||
|
||||
function toggleColorblindnessViz( %mode )
|
||||
{
|
||||
%previousMode = $Viz_ColorblindnessModeVar;
|
||||
|
||||
switch$ ( %mode )
|
||||
{
|
||||
case "Protanopia":
|
||||
$Viz_ColorblindnessModeVar = "0";
|
||||
case "Protanomaly":
|
||||
$Viz_ColorblindnessModeVar = "1";
|
||||
case "Deuteranopia":
|
||||
$Viz_ColorblindnessModeVar = "2";
|
||||
case "Deuteranomaly":
|
||||
$Viz_ColorblindnessModeVar = "3";
|
||||
case "Tritanopia":
|
||||
$Viz_ColorblindnessModeVar = "4";
|
||||
case "Tritanomaly":
|
||||
$Viz_ColorblindnessModeVar = "5";
|
||||
case "Achromatopsia":
|
||||
$Viz_ColorblindnessModeVar = "6";
|
||||
case "Achromatomaly":
|
||||
$Viz_ColorblindnessModeVar = "7";
|
||||
default:
|
||||
$Viz_ColorblindnessModeVar = "-1";
|
||||
}
|
||||
|
||||
//If the visualizer isn't enabled, we just flip it on
|
||||
if(!Viz_ColorBlindnessPFX.isEnabled())
|
||||
{
|
||||
Viz_ColorBlindnessPFX.enable();
|
||||
}
|
||||
else //if it's currently enabled, check if we clicked the same mode again. If so, disable. If not, just swap modes to the new one
|
||||
{
|
||||
if(%previousMode == $Viz_ColorblindnessModeVar)
|
||||
{
|
||||
$Viz_ColorblindnessModeVar = -1;
|
||||
Viz_ColorBlindnessPFX.disable();
|
||||
}
|
||||
}
|
||||
|
||||
for(%i=0; %i < 8; %i++)
|
||||
{
|
||||
if(%i == $Viz_ColorblindnessModeVar)
|
||||
EVisibilityColorblindnessOptions.checkItem(%i, true);
|
||||
else
|
||||
EVisibilityColorblindnessOptions.checkItem(%i, false);
|
||||
}
|
||||
}
|
||||
|
||||
function Viz_ColorBlindnessPFX::setShaderConsts(%this)
|
||||
{
|
||||
%this.setShaderConst("$mode", $Viz_ColorblindnessModeVar);
|
||||
}
|
||||
|
||||
function disableColorblindnessViz()
|
||||
{
|
||||
Viz_ColorBlindnessPFX.disable();
|
||||
$Viz_ColorblindnessModeVar = -1;
|
||||
|
||||
for(%i=0; %i < 8; %i++)
|
||||
{
|
||||
EVisibilityColorblindnessOptions.checkItem(%i, false);
|
||||
}
|
||||
}
|
||||
|
||||
function Viz_ColorBlindnessPFX::onEnabled( %this )
|
||||
{
|
||||
//Disable the buffer visualization
|
||||
disableSurfacePropertiesViz();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
function toggleProbeVis(%mode)
|
||||
{
|
||||
$Probes::showAttenuation = 0;
|
||||
$Probes::showSpecularCubemaps = 0;
|
||||
$Probes::showDiffuseCubemaps = 0;
|
||||
$Probes::showProbeContrib = 0;
|
||||
|
||||
switch$(%mode)
|
||||
{
|
||||
case "Attenuation":
|
||||
$Probes::showAttenuation = 1;
|
||||
case "Contribution":
|
||||
$Probes::showProbeContrib = 1;
|
||||
case "Specular":
|
||||
$Probes::showSpecularCubemaps = 1;
|
||||
case "Diffuse":
|
||||
$Probes::showDiffuseCubemaps = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//Using calculations and values provided by Alan Zucconi
|
||||
// www.alanzucconi.com
|
||||
|
||||
#include "../../../../core/rendering/shaders/shaderModelAutoGen.hlsl"
|
||||
#include "../../../../core/rendering/shaders/postFX/postFx.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(backBufferTex,0);
|
||||
|
||||
uniform float mode;
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float4 imageColor = TORQUE_TEX2D( backBufferTex, IN.uv0 );
|
||||
|
||||
float3 R = imageColor.r;
|
||||
float3 G = imageColor.g;
|
||||
float3 B = imageColor.b;
|
||||
|
||||
if(mode == 0) // Protanopia
|
||||
{
|
||||
R = float3(0.56667, 0.43333, 0);
|
||||
G = float3(0.55833, 0.44167, 0);
|
||||
B = float3(0, 0.24167, 0.75833);
|
||||
}
|
||||
else if(mode == 1) // Protanomaly
|
||||
{
|
||||
R = float3(0.81667, 0.18333, 0);
|
||||
G = float3(0.33333, 0.66667, 0);
|
||||
B = float3(0, 0.125, 0.875);
|
||||
}
|
||||
else if(mode == 2) // Deuteranopia
|
||||
{
|
||||
R = float3(0.625, 0.375, 0);
|
||||
G = float3(0.70, 0.30, 0);
|
||||
B = float3(0, 0.30, 0.70);
|
||||
}
|
||||
else if(mode == 3) // Deuteranomaly
|
||||
{
|
||||
R = float3(0.80, 0.20, 0);
|
||||
G = float3(0.25833, 0.74167, 0);
|
||||
B = float3(0, 0.14167, 0.85833);
|
||||
}
|
||||
else if(mode == 4) // Tritanopia
|
||||
{
|
||||
R = float3(0.95, 0.05, 0);
|
||||
G = float3(0, 0.43333, 0.56667);
|
||||
B = float3(0, 0.475, 0.525);
|
||||
}
|
||||
else if(mode == 5) // Tritanomaly
|
||||
{
|
||||
R = float3(0.96667, 0.03333, 0);
|
||||
G = float3(0, 0.73333, 0.26667);
|
||||
B = float3(0, 0.18333, 0.81667);
|
||||
}
|
||||
else if(mode == 6) // Achromatopsia
|
||||
{
|
||||
R = float3(0.299, 0.587, 0.114);
|
||||
G = float3(0.299, 0.587, 0.114);
|
||||
B = float3(0.299, 0.587, 0.114);
|
||||
}
|
||||
else if(mode == 7) // Achromatomaly
|
||||
{
|
||||
R = float3(0.618, 0.32, 0.062);
|
||||
G = float3(0.163, 0.775, 0.062);
|
||||
B = float3(0.163, 0.320, 0.516);
|
||||
}
|
||||
|
||||
//First set
|
||||
float4 c = imageColor;
|
||||
|
||||
c.r = c.r * R[0] + c.g * R[1] + c.b * R[2];
|
||||
c.g = c.r * G[0] + c.g * G[1] + c.b * G[2];
|
||||
c.b = c.r * B[0] + c.g * B[1] + c.b * B[2];
|
||||
|
||||
float3 cb = c.rgb;
|
||||
|
||||
cb.r = c.r * R[0] + c.g * R[1] + c.b * R[2];
|
||||
cb.g = c.r * G[0] + c.g * G[1] + c.b * G[2];
|
||||
cb.b = c.r * B[0] + c.g * B[1] + c.b * B[2];
|
||||
|
||||
// Difference
|
||||
float3 diff = abs(c.rgb - cb);
|
||||
|
||||
float lum = c.r*.3 + c.g*.59 + c.b*.11;
|
||||
float3 bw = float3(lum, lum, lum);
|
||||
|
||||
// return float4(lerp(bw, float3(1, 0, 0), saturate((diff.r + diff.g + diff.b) / 3)), c.a);
|
||||
return float4(c.rgb,1);
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "../../../../core/rendering/shaders/postFX/postFx.hlsl"
|
||||
#include "../../../../core/rendering/shaders/shaderModel.hlsl"
|
||||
#include "../../../../core/rendering/shaders/shaderModelAutoGen.hlsl"
|
||||
#include "../../../../core/rendering/shaders/lighting.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(deferredBuffer, 0);
|
||||
TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 1);
|
||||
TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 2);
|
||||
TORQUE_UNIFORM_SAMPLER2D(backbufferTex, 3);
|
||||
TORQUE_UNIFORM_SAMPLER2D(glowBuffer, 4);
|
||||
|
||||
uniform float mode;
|
||||
uniform float3 eyePosWorld;
|
||||
uniform float4x4 cameraToWorld;
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
//unpack normal and linear depth
|
||||
float4 normDepth = TORQUE_DEFERRED_UNCONDITION(deferredBuffer, IN.uv0.xy);
|
||||
|
||||
//create surface
|
||||
Surface surface = createSurface(normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
|
||||
IN.uv0.xy, eyePosWorld, IN.wsEyeRay, cameraToWorld);
|
||||
|
||||
[branch]
|
||||
if(mode == 0)
|
||||
return float4(surface.baseColor.rgb,1);
|
||||
else if(mode == 1)
|
||||
return float4(surface.N.rgb,1);
|
||||
else if(mode == 2)
|
||||
return float4(surface.ao.rrr,1);
|
||||
else if(mode == 3)
|
||||
return float4(surface.roughness.rrr,1);
|
||||
else if(mode == 4)
|
||||
return float4(surface.metalness.rrr,1);
|
||||
else if(mode == 5)
|
||||
return float4(surface.depth.rrr,1);
|
||||
else if(mode == 6) //Diffuse Color
|
||||
return float4(surface.albedo.rgb,1);
|
||||
else if(mode == 7) //Specular Color
|
||||
{
|
||||
float3 specularColor = surface.baseColor.rgb * surface.ao;
|
||||
return float4(specularColor.rgb,1);
|
||||
}
|
||||
else if(mode == 8) //Mat Flags
|
||||
return float4(surface.matFlag.rrr,1);
|
||||
else if(mode == 9)
|
||||
return float4(surface.P.xyz,1);
|
||||
else if(mode == 10)
|
||||
return float4(surface.R.xyz,1);
|
||||
else if(mode == 11)
|
||||
return float4(surface.F.rgb,1);
|
||||
else if(mode == 12)
|
||||
float4(TORQUE_TEX2D( backbufferTex, IN.uv0 ).rgb, 1.0);
|
||||
else if(mode == 13)
|
||||
float4(TORQUE_TEX2D( glowBuffer, IN.uv0 ).rgb, 1.0);
|
||||
|
||||
return float4(0,0,0,1);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "../../../../core/rendering/shaders/postFX/postFx.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(checkerboard,0);
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
return float4(TORQUE_TEX2D( checkerboard, IN.uv0 ).rgb, 1.0);
|
||||
}
|
||||
|
|
@ -0,0 +1,420 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//Volumes Visibility
|
||||
//Zones
|
||||
//Portals
|
||||
//Occlusion
|
||||
//Triggers
|
||||
//Physical
|
||||
//Sound
|
||||
//Mission Area
|
||||
//Sound Space
|
||||
//Debug Rendering
|
||||
//Player Collision
|
||||
//Terrain
|
||||
//Decals
|
||||
//Bounding Boxes
|
||||
//Physics World
|
||||
//Wireframe
|
||||
//Frustum Lock
|
||||
//Disable Zone Culling
|
||||
//Disable Terrain Occlusion
|
||||
//Lighting
|
||||
//Lighting Modes
|
||||
//Lit
|
||||
//Unlit(Full render, no reflecitons or lights)
|
||||
//No Shadows
|
||||
//Detail Lighting(diffuse is a flat gray, otherwise normal lighting)
|
||||
//Lighting Only(diffuse is flat, no normal, otherwise normal lighting)
|
||||
//Reflections(flat normal, roughness 0)
|
||||
//Probes
|
||||
//Attenuation
|
||||
//Contribution
|
||||
//Diffuse Reflections
|
||||
//Specular Reflections
|
||||
//Lights
|
||||
//Light Frustums
|
||||
//Shadowmap Cascades
|
||||
//Buffer Viz
|
||||
//Base Color
|
||||
//Diffuse Color(Base + AO)
|
||||
//Material AO
|
||||
//Roughness
|
||||
//Depth
|
||||
//Specular Color(Base Color + metalness)
|
||||
//Metalness
|
||||
//Normal
|
||||
//Ambient Occlusion(posteffect)?
|
||||
//Backbuffer
|
||||
//Glow
|
||||
//Colorblindness
|
||||
//All of them
|
||||
//Class Visibility
|
||||
function setupEditorVisibilityMenu()
|
||||
{
|
||||
if(isObject(EditorVisibilityOptions))
|
||||
return;
|
||||
|
||||
%volumeVizpopup = new PopupMenu(EVisibilityVolumeOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Show Zones" TAB "" TAB "$Zone::isRenderable = !$Zone::isRenderable;";
|
||||
item[ 1 ] = "Show Portals" TAB "" TAB "$Portal::isRenderable = !$Portal::isRenderable;";
|
||||
item[ 2 ] = "Show Occlusion Volumes" TAB "" TAB "$OcclusionVolume::isRenderable = !$OcclusionVolume::isRenderable;";
|
||||
item[ 3 ] = "Show Triggers" TAB "" TAB "$Trigger::renderTriggers = !$Trigger::renderTriggers;";
|
||||
item[ 4 ] = "Show Physical Zones" TAB "" TAB "$PhysicalZone::renderZones = !$PhysicalZone::renderZones;";
|
||||
item[ 5 ] = "Show Sound Emitters" TAB "" TAB "$SFXEmitter::renderEmitters = !$SFXEmitter::renderEmitters;";
|
||||
item[ 6 ] = "Show Mission Area" TAB "" TAB "EWorldEditor.renderMissionArea = !EWorldEditor.renderMissionArea;";
|
||||
item[ 7 ] = "Show Sound Spaces" TAB "" TAB "$SFXSpace::isRenderable = !$SFXSpace::isRenderable;";
|
||||
};
|
||||
|
||||
EVisibility.addOption( "Debug Render: Player Collision", "$Player::renderCollision", "" );
|
||||
EVisibility.addOption( "Debug Render: Terrain", "TerrainBlock::debugRender", "" );
|
||||
EVisibility.addOption( "Debug Render: Decals", "$Decals::debugRender", "" );
|
||||
EVisibility.addOption( "Debug Render: Light Frustums", "$Light::renderLightFrustums", "" );
|
||||
EVisibility.addOption( "Debug Render: Bounding Boxes", "$Scene::renderBoundingBoxes", "" );
|
||||
EVisibility.addOption( "Debug Render: Physics World", "$PhysicsWorld::render", "togglePhysicsDebugViz" );
|
||||
|
||||
%debugRenderpopup = new PopupMenu(EVisibilityDebugRenderOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Show Player Collision" TAB "" TAB "";
|
||||
item[ 1 ] = "Show Terrain Debug" TAB "" TAB "";
|
||||
item[ 2 ] = "Show Decals Debug" TAB "" TAB "";
|
||||
item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "";
|
||||
item[ 4 ] = "Show Physics World" TAB "" TAB "";
|
||||
item[ 5 ] = "Show Player Collision" TAB "" TAB "";
|
||||
item[ 6 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();";
|
||||
};
|
||||
|
||||
//
|
||||
//Lighting stuff
|
||||
%lightingModepopup = new PopupMenu(EVisibilityLightingModesOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Lit" TAB "" TAB "";
|
||||
item[ 1 ] = "Unlit" TAB "" TAB "";
|
||||
item[ 2 ] = "No Shadows" TAB "" TAB "$Shadows::disable = !$Shadows::disable;";
|
||||
item[ 3 ] = "Detail Lighting" TAB "" TAB "";
|
||||
item[ 4 ] = "Lighting Only" TAB "" TAB "";
|
||||
item[ 5 ] = "Reflections Only" TAB "" TAB "";
|
||||
};
|
||||
|
||||
%lightspopup = new PopupMenu(EVisibilityLightsOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Show Light Frustums" TAB "" TAB "$Light::renderLightFrustums = !$Light::renderLightFrustums;";
|
||||
item[ 1 ] = "Show Shadowmap Cascades" TAB "" TAB "$AL::PSSMDebugRender = !$AL::PSSMDebugRender;";
|
||||
item[ 2 ] = "Show Specular Light" TAB "" TAB "";
|
||||
item[ 3 ] = "Show Diffuse Light" TAB "" TAB "";
|
||||
};
|
||||
|
||||
//
|
||||
//Probes
|
||||
%probespopup = new PopupMenu(EVisibilityProbesOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Show Probe Attenuation" TAB "" TAB "toggleProbeVis(\"Attenuation\");";
|
||||
item[ 1 ] = "Show Probe Contribution" TAB "" TAB "toggleProbeVis(\"Contribution\");";
|
||||
item[ 2 ] = "Show Probe Specular Reflections" TAB "" TAB "toggleProbeVis(\"Specular\");";
|
||||
item[ 3 ] = "Show Probe Diffuse Reflections" TAB "" TAB "toggleProbeVis(\"Diffuse\");";
|
||||
item[ 4 ] = "Enable Live Updates on Selected Probe" TAB "" TAB "";
|
||||
};
|
||||
|
||||
%lightingpopup = new PopupMenu(EVisibilityLightingOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Lighting Modes" TAB EVisibilityLightingModesOptions;
|
||||
item[ 1 ] = "Lights" TAB EVisibilityLightsOptions;
|
||||
item[ 2 ] = "Probes" TAB EVisibilityProbesOptions;
|
||||
};
|
||||
|
||||
//
|
||||
//Buffer Viz
|
||||
%bufferVizpopup = new PopupMenu(EVisibilityBufferVizOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Base Color" TAB "" TAB "toggleSurfacePropertiesViz(\"BaseColor\");";
|
||||
item[ 1 ] = "Normals" TAB "" TAB "toggleSurfacePropertiesViz(\"Normal\");";
|
||||
item[ 2 ] = "Material Ambient Occlusion" TAB "" TAB "toggleSurfacePropertiesViz(\"AO\");";
|
||||
item[ 3 ] = "Roughness" TAB "" TAB "toggleSurfacePropertiesViz(\"Roughness\");";
|
||||
item[ 4 ] = "Metalness" TAB "" TAB "toggleSurfacePropertiesViz(\"Metalness\");";
|
||||
item[ 5 ] = "Depth" TAB "" TAB "toggleSurfacePropertiesViz(\"Depth\");";
|
||||
|
||||
item[ 6 ] = "Diffuse Color" TAB "" TAB "toggleSurfacePropertiesViz(\"DiffuseColor\");";
|
||||
item[ 7 ] = "Specular Color" TAB "" TAB "toggleSurfacePropertiesViz(\"SpecularColor\");";
|
||||
item[ 8 ] = "Material Flags" TAB "" TAB "toggleSurfacePropertiesViz(\"MatFlag\");";
|
||||
|
||||
item[ 9 ] = "World Position" TAB "" TAB "toggleSurfacePropertiesViz(\"WorldPos\");";
|
||||
item[ 10 ] = "Reflection Vector" TAB "" TAB "toggleSurfacePropertiesViz(\"ReflectionVector\");";
|
||||
|
||||
item[ 11 ] = "Fresnel" TAB "" TAB "toggleSurfacePropertiesViz(\"Fresnel\");";
|
||||
|
||||
item[ 12 ] = "Backbuffer" TAB "" TAB "toggleSurfacePropertiesViz(\"Backbuffer\");";
|
||||
item[ 13 ] = "Glow" TAB "" TAB "toggleSurfacePropertiesViz(\"Glow\");";
|
||||
};
|
||||
|
||||
//
|
||||
//Colorblindness
|
||||
%colorblindpopup = new PopupMenu(EVisibilityColorblindnessOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Protanopia" TAB "" TAB "toggleColorblindnessViz(\"Protanopia\");";
|
||||
item[ 1 ] = "Protanomaly" TAB "" TAB "toggleColorblindnessViz(\"Protanomaly\");";
|
||||
item[ 2 ] = "Deuteranopia" TAB "" TAB "toggleColorblindnessViz(\"Deuteranopia\");";
|
||||
item[ 3 ] = "Deuteranomaly" TAB "" TAB "toggleColorblindnessViz(\"Deuteranomaly\");";
|
||||
item[ 4 ] = "Tritanopia" TAB "" TAB "toggleColorblindnessViz(\"Tritanopia\");";
|
||||
item[ 5 ] = "Tritanomaly" TAB "" TAB "toggleColorblindnessViz(\"Tritanomaly\");";
|
||||
item[ 6 ] = "Achromatopsia" TAB "" TAB "toggleColorblindnessViz(\"Achromatopsia\");";
|
||||
item[ 7 ] = "Achromatomaly" TAB "" TAB "toggleColorblindnessViz(\"Achromatomaly\");";
|
||||
};
|
||||
|
||||
//
|
||||
//Class Visibility
|
||||
%classVizpopup = new PopupMenu(EVisibilityClassVizOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
};
|
||||
|
||||
//addClassOptions(%classVizpopup);
|
||||
|
||||
//
|
||||
%popup = new PopupMenu(EditorVisibilityOptions)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorWorldMenu";
|
||||
|
||||
item[ 0 ] = "Volumes Visibility" TAB EVisibilityVolumeOptions;
|
||||
item[ 1 ] = "Debug Rendering" TAB EVisibilityDebugRenderOptions;
|
||||
item[ 2 ] = "-" TAB "" TAB "";
|
||||
item[ 3 ] = "Wireframe" TAB "" TAB "$gfx::wireframe = !$gfx::wireframe;";
|
||||
item[ 4 ] = "Frustum Lock" TAB "" TAB "$Scene::lockCull = !$Scene::lockCull;";
|
||||
item[ 5 ] = "Colorblindness" TAB EVisibilityColorblindnessOptions;
|
||||
item[ 6 ] = "-" TAB "" TAB "";
|
||||
item[ 7 ] = "Disable Zone Culling" TAB "" TAB "$Scene::disableZoneCulling = !$Scene::disableZoneCulling;";
|
||||
item[ 8 ] = "Disable Terrain Culling" TAB "" TAB "$Scene::disableTerrainOcclusion = !$Scene::disableTerrainOcclusion;";
|
||||
item[ 9 ] = "-" TAB "" TAB "";
|
||||
item[ 10 ] = "Lighting" TAB EVisibilityLightingOptions;
|
||||
item[ 11 ] = "Buffer Visualization" TAB EVisibilityBufferVizOptions;
|
||||
item[ 12 ] = "-" TAB "" TAB "";
|
||||
item[ 13 ] = "Class Visibility" TAB EVisibilityClassVizOptions;
|
||||
};
|
||||
}
|
||||
|
||||
function EVisibility::onWake( %this )
|
||||
{
|
||||
// Create the array if it
|
||||
// doesn't already exist.
|
||||
if ( !isObject( %this.array ) )
|
||||
%this.array = new ArrayObject();
|
||||
|
||||
// Create the array if it
|
||||
// doesn't already exist.
|
||||
if ( !isObject( %this.classArray ) )
|
||||
{
|
||||
%this.classArray = new ArrayObject();
|
||||
%this.addClassOptions();
|
||||
}
|
||||
|
||||
%this.updateOptions();
|
||||
|
||||
}
|
||||
|
||||
function EVisibility::updateOptions( %this )
|
||||
{
|
||||
// First clear the stack control.
|
||||
%this-->theVisOptionsList.clear();
|
||||
|
||||
// Go through all the
|
||||
// parameters in our array and
|
||||
// create a check box for each.
|
||||
for ( %i = 0; %i < %this.array.count(); %i++ )
|
||||
{
|
||||
%text = " " @ %this.array.getValue( %i );
|
||||
%val = %this.array.getKey( %i );
|
||||
%var = getWord( %val, 0 );
|
||||
%toggleFunction = getWord( %val, 1 );
|
||||
|
||||
%textLength = strlen( %text );
|
||||
|
||||
%cmd = "";
|
||||
if ( %toggleFunction !$= "" )
|
||||
%cmd = %toggleFunction @ "( $thisControl.getValue() );";
|
||||
|
||||
%checkBox = new GuiCheckBoxCtrl()
|
||||
{
|
||||
canSaveDynamicFields = "0";
|
||||
isContainer = "0";
|
||||
Profile = "ToolsGuiCheckBoxListProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "0 0";
|
||||
Extent = (%textLength * 4) @ " 18";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
Variable = %var;
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
text = %text;
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
useInactiveState = "0";
|
||||
Command = %cmd;
|
||||
};
|
||||
|
||||
%this-->theVisOptionsList.addGuiControl( %checkBox );
|
||||
}
|
||||
}
|
||||
|
||||
function EVisibility::addOption( %this, %text, %varName, %toggleFunction )
|
||||
{
|
||||
// Create the array if it
|
||||
// doesn't already exist.
|
||||
if ( !isObject( %this.array ) )
|
||||
%this.array = new ArrayObject();
|
||||
|
||||
%this.array.push_back( %varName @ " " @ %toggleFunction, %text );
|
||||
%this.array.uniqueKey();
|
||||
%this.array.sortd();
|
||||
%this.updateOptions();
|
||||
}
|
||||
|
||||
function EVisibility::addClassOptions( %this )
|
||||
{
|
||||
%visList = %this-->theClassVisList;
|
||||
%selList = %this-->theClassSelList;
|
||||
|
||||
// First clear the stack control.
|
||||
|
||||
%visList.clear();
|
||||
%selList.clear();
|
||||
|
||||
%classList = enumerateConsoleClasses( "SceneObject" );
|
||||
%classCount = getFieldCount( %classList );
|
||||
|
||||
for ( %i = 0; %i < %classCount; %i++ )
|
||||
{
|
||||
%className = getField( %classList, %i );
|
||||
%this.classArray.push_back( %className );
|
||||
}
|
||||
|
||||
// Remove duplicates and sort by key.
|
||||
%this.classArray.uniqueKey();
|
||||
%this.classArray.sortkd();
|
||||
|
||||
// Go through all the
|
||||
// parameters in our array and
|
||||
// create a check box for each.
|
||||
for ( %i = 0; %i < %this.classArray.count(); %i++ )
|
||||
{
|
||||
%class = %this.classArray.getKey( %i );
|
||||
|
||||
%visVar = "$" @ %class @ "::isRenderable";
|
||||
%selVar = "$" @ %class @ "::isSelectable";
|
||||
|
||||
%textLength = strlen( %class );
|
||||
%text = " " @ %class;
|
||||
|
||||
// Add visibility toggle.
|
||||
|
||||
%visCheckBox = new GuiCheckBoxCtrl()
|
||||
{
|
||||
canSaveDynamicFields = "0";
|
||||
isContainer = "0";
|
||||
Profile = "ToolsGuiCheckBoxListFlipedProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "0 0";
|
||||
Extent = (%textLength * 4) @ " 18";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
Variable = %visVar;
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
tooltip = "Show/hide all " @ %class @ " objects.";
|
||||
text = %text;
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
useInactiveState = "0";
|
||||
};
|
||||
|
||||
%visList.addGuiControl( %visCheckBox );
|
||||
|
||||
// Add selectability toggle.
|
||||
|
||||
%selCheckBox = new GuiCheckBoxCtrl()
|
||||
{
|
||||
canSaveDynamicFields = "0";
|
||||
isContainer = "0";
|
||||
Profile = "ToolsGuiCheckBoxListFlipedProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "0 0";
|
||||
Extent = (%textLength * 4) @ " 18";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
Variable = %selVar;
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
tooltip = "Enable/disable selection of all " @ %class @ " objects.";
|
||||
text = %text;
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
useInactiveState = "0";
|
||||
};
|
||||
|
||||
%selList.addGuiControl( %selCheckBox );
|
||||
}
|
||||
}
|
||||
|
||||
function togglePhysicsDebugViz( %enable )
|
||||
{
|
||||
if(physicsPluginPresent())
|
||||
{
|
||||
physicsDebugDraw(%enable);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function EVisibility::onWake( %this )
|
||||
{
|
||||
// Create the array if it
|
||||
// doesn't already exist.
|
||||
if ( !isObject( %this.array ) )
|
||||
%this.array = new ArrayObject();
|
||||
|
||||
// Create the array if it
|
||||
// doesn't already exist.
|
||||
if ( !isObject( %this.classArray ) )
|
||||
{
|
||||
%this.classArray = new ArrayObject();
|
||||
%this.addClassOptions();
|
||||
}
|
||||
|
||||
%this.updateOptions();
|
||||
|
||||
}
|
||||
|
||||
function EVisibility::updateOptions( %this )
|
||||
{
|
||||
// First clear the stack control.
|
||||
%this-->theVisOptionsList.clear();
|
||||
|
||||
// Go through all the
|
||||
// parameters in our array and
|
||||
// create a check box for each.
|
||||
for ( %i = 0; %i < %this.array.count(); %i++ )
|
||||
{
|
||||
%text = " " @ %this.array.getValue( %i );
|
||||
%val = %this.array.getKey( %i );
|
||||
%var = getWord( %val, 0 );
|
||||
%toggleFunction = getWord( %val, 1 );
|
||||
|
||||
%textLength = strlen( %text );
|
||||
|
||||
%cmd = "";
|
||||
if ( %toggleFunction !$= "" )
|
||||
%cmd = %toggleFunction @ "( $thisControl.getValue() );";
|
||||
|
||||
%checkBox = new GuiCheckBoxCtrl()
|
||||
{
|
||||
canSaveDynamicFields = "0";
|
||||
isContainer = "0";
|
||||
Profile = "ToolsGuiCheckBoxListProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "0 0";
|
||||
Extent = (%textLength * 4) @ " 18";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
Variable = %var;
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
text = %text;
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
useInactiveState = "0";
|
||||
Command = %cmd;
|
||||
};
|
||||
|
||||
%this-->theVisOptionsList.addGuiControl( %checkBox );
|
||||
}
|
||||
}
|
||||
|
||||
function EVisibility::addOption( %this, %text, %varName, %toggleFunction )
|
||||
{
|
||||
// Create the array if it
|
||||
// doesn't already exist.
|
||||
if ( !isObject( %this.array ) )
|
||||
%this.array = new ArrayObject();
|
||||
|
||||
%this.array.push_back( %varName @ " " @ %toggleFunction, %text );
|
||||
%this.array.uniqueKey();
|
||||
%this.array.sortd();
|
||||
%this.updateOptions();
|
||||
}
|
||||
|
||||
function EVisibility::addClassOptions( %this )
|
||||
{
|
||||
%visList = %this-->theClassVisList;
|
||||
%selList = %this-->theClassSelList;
|
||||
|
||||
// First clear the stack control.
|
||||
|
||||
%visList.clear();
|
||||
%selList.clear();
|
||||
|
||||
%classList = enumerateConsoleClasses( "SceneObject" );
|
||||
%classCount = getFieldCount( %classList );
|
||||
|
||||
for ( %i = 0; %i < %classCount; %i++ )
|
||||
{
|
||||
%className = getField( %classList, %i );
|
||||
%this.classArray.push_back( %className );
|
||||
}
|
||||
|
||||
// Remove duplicates and sort by key.
|
||||
%this.classArray.uniqueKey();
|
||||
%this.classArray.sortkd();
|
||||
|
||||
// Go through all the
|
||||
// parameters in our array and
|
||||
// create a check box for each.
|
||||
for ( %i = 0; %i < %this.classArray.count(); %i++ )
|
||||
{
|
||||
%class = %this.classArray.getKey( %i );
|
||||
|
||||
%visVar = "$" @ %class @ "::isRenderable";
|
||||
%selVar = "$" @ %class @ "::isSelectable";
|
||||
|
||||
%textLength = strlen( %class );
|
||||
%text = " " @ %class;
|
||||
|
||||
// Add visibility toggle.
|
||||
|
||||
%visCheckBox = new GuiCheckBoxCtrl()
|
||||
{
|
||||
canSaveDynamicFields = "0";
|
||||
isContainer = "0";
|
||||
Profile = "ToolsGuiCheckBoxListFlipedProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "0 0";
|
||||
Extent = (%textLength * 4) @ " 18";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
Variable = %visVar;
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
tooltip = "Show/hide all " @ %class @ " objects.";
|
||||
text = %text;
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
useInactiveState = "0";
|
||||
};
|
||||
|
||||
%visList.addGuiControl( %visCheckBox );
|
||||
|
||||
// Add selectability toggle.
|
||||
|
||||
%selCheckBox = new GuiCheckBoxCtrl()
|
||||
{
|
||||
canSaveDynamicFields = "0";
|
||||
isContainer = "0";
|
||||
Profile = "ToolsGuiCheckBoxListFlipedProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
Position = "0 0";
|
||||
Extent = (%textLength * 4) @ " 18";
|
||||
MinExtent = "8 2";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
Variable = %selVar;
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
tooltip = "Enable/disable selection of all " @ %class @ " objects.";
|
||||
text = %text;
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
useInactiveState = "0";
|
||||
};
|
||||
|
||||
%selList.addGuiControl( %selCheckBox );
|
||||
}
|
||||
}
|
||||
|
||||
function togglePhysicsDebugViz( %enable )
|
||||
{
|
||||
if(physicsPluginPresent())
|
||||
{
|
||||
physicsDebugDraw(%enable);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue