Adds ability to adjust padding to guiTextListCtrl's rows

ForcedMaterialMeshMgr tweaked to allow proper setting of override material
Ongoing WIP of update/fixing of options menus
WIP of expanded visualizers, including material complexity viz
Adds no-pie flag when compiling on linux with non-clang compilers
This commit is contained in:
Areloch 2019-09-06 00:00:17 -05:00
parent 9e1544880e
commit 52fcbecb9f
21 changed files with 912 additions and 487 deletions

View file

@ -1,179 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<EditorSettings>
<Group name="Theme">
<Setting name="fieldTextSELColor">240 240 240 255</Setting>
<Setting name="fieldBGSELColor">100 98 96 255</Setting>
<Setting name="dividerLightColor">96 94 92 255</Setting>
<Setting name="headerColor">50 49 48 255</Setting>
<Setting name="tabsSELColor">59 58 57 255</Setting>
<Setting name="tabsHLColor">50 49 48 255</Setting>
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
<Setting name="headerTextColor">236 234 232 255</Setting>
<Setting name="fieldBGColor">59 58 57 255</Setting>
<Setting name="tooltipBGColor">43 43 43 255</Setting>
<Setting name="fieldTextColor">178 175 172 255</Setting>
<Setting name="dividerMidColor">50 49 48 255</Setting>
<Setting name="dividerDarkColor">17 16 15 255</Setting>
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
<Setting name="tooltipTextColor">255 255 255 255</Setting>
<Setting name="tabsColor">37 36 35 255</Setting>
</Group>
<Group name="AxisGizmo">
<Setting name="axisGizmoMaxScreenLen">100</Setting>
<Setting name="snapRotations">0</Setting>
<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>
<Group name="Grid">
<Setting name="renderPlane">0</Setting>
<Setting name="gridColor">255 255 255 20</Setting>
<Setting name="planeDim">500</Setting>
<Setting name="renderPlaneHashes">0</Setting>
<Setting name="snapToGrid">0</Setting>
<Setting name="gridSize">10 10 10</Setting>
</Group>
</Group>
<Group name="WorldEditor">
<Setting name="undoLimit">40</Setting>
<Setting name="orthoFOV">50</Setting>
<Setting name="displayType">6</Setting>
<Setting name="forceLoadDAE">0</Setting>
<Setting name="orthoShowGrid">1</Setting>
<Setting name="torsionPath">AssetWork_Debug.exe</Setting>
<Setting name="dropType">screenCenter</Setting>
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
<Group name="Grid">
<Setting name="gridOriginColor">255 255 255 100</Setting>
<Setting name="gridColor">102 102 102 100</Setting>
<Setting name="gridSnap">0</Setting>
<Setting name="gridSize">1</Setting>
<Setting name="gridMinorColor">51 51 51 100</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="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
</Group>
<Group name="Color">
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
<Setting name="objMouseOverColor">0 255 0 255</Setting>
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
<Setting name="dragRectColor">255 255 0 255</Setting>
<Setting name="selectionBoxColor">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="windowTitleFontHLColor">255 255 255 255</Setting>
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
</Group>
<Group name="ObjectIcons">
<Setting name="fadeIconsEndDist">20</Setting>
<Setting name="fadeIconsStartAlpha">255</Setting>
<Setting name="fadeIconsEndAlpha">0</Setting>
<Setting name="fadeIcons">1</Setting>
<Setting name="fadeIconsStartDist">8</Setting>
</Group>
<Group name="Render">
<Setting name="showMousePopupInfo">1</Setting>
<Setting name="renderPopupBackground">1</Setting>
<Setting name="renderSelectionBox">1</Setting>
<Setting name="renderObjHandle">1</Setting>
<Setting name="renderObjText">1</Setting>
</Group>
<Group name="Tools">
<Setting name="snapGround">0</Setting>
<Setting name="snapSoft">0</Setting>
<Setting name="dropAtScreenCenterScalar">1</Setting>
<Setting name="boundingBoxCollision">0</Setting>
<Setting name="objectsUseBoxCenter">1</Setting>
<Setting name="dropAtScreenCenterMax">100</Setting>
<Setting name="snapSoftSize">2</Setting>
</Group>
<Group name="Images">
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
</Group>
</Group>
<Group name="GuiEditor">
<Setting name="lastPath">tools/gui</Setting>
<Setting name="previewResolution">1024 768</Setting>
<Group name="Rendering">
<Setting name="drawBorderLines">1</Setting>
<Setting name="drawGuides">1</Setting>
</Group>
<Group name="Help">
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
</Group>
<Group name="Snapping">
<Setting name="snapToGuides">1</Setting>
<Setting name="snapToControls">1</Setting>
<Setting name="snapToEdges">1</Setting>
<Setting name="snapToCanvas">1</Setting>
<Setting name="snapToCenters">1</Setting>
<Setting name="sensitivity">2</Setting>
<Setting name="snap2Grid">0</Setting>
<Setting name="snap2GridSize">8</Setting>
</Group>
<Group name="Selection">
<Setting name="fullBox">0</Setting>
</Group>
<Group name="EngineDevelopment">
<Setting name="toggleIntoEditor">0</Setting>
<Setting name="showEditorProfiles">0</Setting>
<Setting name="showEditorGuis">0</Setting>
</Group>
<Group name="Library">
<Setting name="viewType">Categorized</Setting>
</Group>
</Group>
<Group name="TerrainEditor">
<Setting name="currentAction">lowerHeight</Setting>
<Group name="ActionValues">
<Setting name="SlopeMinAngle">0</Setting>
<Setting name="noiseFactor">1</Setting>
<Setting name="setHeightVal">100</Setting>
<Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="scaleVal">1</Setting>
<Setting name="softSelectRadius">50</Setting>
<Setting name="smoothFactor">0.1</Setting>
<Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="adjustHeightVal">10</Setting>
<Setting name="SlopeMaxAngle">90</Setting>
</Group>
<Group name="Brush">
<Setting name="maxBrushSize">40 40</Setting>
<Setting name="brushSize">40 40</Setting>
<Setting name="brushType">ellipse</Setting>
<Setting name="brushPressure">1</Setting>
<Setting name="brushSoftness">1</Setting>
</Group>
</Group>
<Group name="RiverEditor">
<Setting name="DefaultNormal">0 0 1</Setting>
<Setting name="DefaultWidth">10</Setting>
<Setting name="HoverNodeColor">255 255 255 255</Setting>
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
<Setting name="DefaultDepth">5</Setting>
<Setting name="HoverSplineColor">255 0 0 255</Setting>
</Group>
<Group name="ConvexEditor">
<Setting name="materialName">Grid_512_Orange</Setting>
</Group>
<Group name="NavEditor">
<Setting name="SpawnClass">AIPlayer</Setting>
</Group>
<Group name="LevelInformation">
<Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
<Group name="levels">
@ -185,4 +11,178 @@
</Group>
</Group>
</Group>
<Group name="WorldEditor">
<Setting name="orthoFOV">50</Setting>
<Setting name="dropType">screenCenter</Setting>
<Setting name="torsionPath">AssetWork_Debug.exe</Setting>
<Setting name="forceLoadDAE">0</Setting>
<Setting name="orthoShowGrid">1</Setting>
<Setting name="undoLimit">40</Setting>
<Setting name="displayType">6</Setting>
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
<Group name="ObjectIcons">
<Setting name="fadeIconsEndAlpha">0</Setting>
<Setting name="fadeIcons">1</Setting>
<Setting name="fadeIconsStartDist">8</Setting>
<Setting name="fadeIconsEndDist">20</Setting>
<Setting name="fadeIconsStartAlpha">255</Setting>
</Group>
<Group name="Tools">
<Setting name="snapGround">0</Setting>
<Setting name="snapSoftSize">2</Setting>
<Setting name="dropAtScreenCenterMax">100</Setting>
<Setting name="objectsUseBoxCenter">1</Setting>
<Setting name="boundingBoxCollision">0</Setting>
<Setting name="snapSoft">0</Setting>
<Setting name="dropAtScreenCenterScalar">1</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="selectionBoxColor">255 255 0 255</Setting>
<Setting name="objMouseOverColor">0 255 0 255</Setting>
<Setting name="objSelectColor">255 0 0 255</Setting>
<Setting name="objectTextColor">255 255 255 255</Setting>
<Setting name="dragRectColor">255 255 0 255</Setting>
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
</Group>
<Group name="Images">
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
</Group>
<Group name="Grid">
<Setting name="gridColor">102 102 102 100</Setting>
<Setting name="gridSnap">0</Setting>
<Setting name="gridSize">1</Setting>
<Setting name="gridMinorColor">51 51 51 100</Setting>
<Setting name="gridOriginColor">255 255 255 100</Setting>
</Group>
<Group name="Render">
<Setting name="renderObjText">1</Setting>
<Setting name="renderObjHandle">1</Setting>
<Setting name="showMousePopupInfo">1</Setting>
<Setting name="renderSelectionBox">1</Setting>
<Setting name="renderPopupBackground">1</Setting>
</Group>
<Group name="Theme">
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
</Group>
</Group>
<Group name="GuiEditor">
<Setting name="previewResolution">1024 768</Setting>
<Setting name="lastPath">tools/gui</Setting>
<Group name="Snapping">
<Setting name="sensitivity">2</Setting>
<Setting name="snap2GridSize">8</Setting>
<Setting name="snap2Grid">0</Setting>
<Setting name="snapToControls">1</Setting>
<Setting name="snapToGuides">1</Setting>
<Setting name="snapToEdges">1</Setting>
<Setting name="snapToCenters">1</Setting>
<Setting name="snapToCanvas">1</Setting>
</Group>
<Group name="Library">
<Setting name="viewType">Categorized</Setting>
</Group>
<Group name="Help">
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
</Group>
<Group name="Rendering">
<Setting name="drawBorderLines">1</Setting>
<Setting name="drawGuides">1</Setting>
</Group>
<Group name="EngineDevelopment">
<Setting name="showEditorGuis">0</Setting>
<Setting name="toggleIntoEditor">0</Setting>
<Setting name="showEditorProfiles">0</Setting>
</Group>
<Group name="Selection">
<Setting name="fullBox">0</Setting>
</Group>
</Group>
<Group name="Theme">
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
<Setting name="tabsSELColor">59 58 57 255</Setting>
<Setting name="tabsHLColor">50 49 48 255</Setting>
<Setting name="dividerDarkColor">17 16 15 255</Setting>
<Setting name="fieldTextSELColor">240 240 240 255</Setting>
<Setting name="fieldBGColor">59 58 57 255</Setting>
<Setting name="dividerMidColor">50 49 48 255</Setting>
<Setting name="fieldTextColor">178 175 172 255</Setting>
<Setting name="tooltipBGColor">43 43 43 255</Setting>
<Setting name="tabsColor">37 36 35 255</Setting>
<Setting name="fieldBGSELColor">100 98 96 255</Setting>
<Setting name="headerColor">50 49 48 255</Setting>
<Setting name="tooltipTextColor">255 255 255 255</Setting>
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
<Setting name="headerTextColor">236 234 232 255</Setting>
<Setting name="dividerLightColor">96 94 92 255</Setting>
</Group>
<Group name="TerrainEditor">
<Setting name="currentAction">lowerHeight</Setting>
<Group name="ActionValues">
<Setting name="noiseFactor">1</Setting>
<Setting name="scaleVal">1</Setting>
<Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="SlopeMaxAngle">90</Setting>
<Setting name="adjustHeightVal">10</Setting>
<Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="smoothFactor">0.1</Setting>
<Setting name="softSelectRadius">50</Setting>
<Setting name="setHeightVal">100</Setting>
<Setting name="SlopeMinAngle">0</Setting>
</Group>
<Group name="Brush">
<Setting name="brushSize">40 40</Setting>
<Setting name="brushSoftness">1</Setting>
<Setting name="maxBrushSize">40 40</Setting>
<Setting name="brushPressure">1</Setting>
<Setting name="brushType">ellipse</Setting>
</Group>
</Group>
<Group name="AxisGizmo">
<Setting name="renderWhenUsed">0</Setting>
<Setting name="mouseRotateScalar">0.8</Setting>
<Setting name="axisGizmoMaxScreenLen">100</Setting>
<Setting name="mouseScaleScalar">0.8</Setting>
<Setting name="snapRotations">0</Setting>
<Setting name="renderInfoText">1</Setting>
<Setting name="rotationSnap">15</Setting>
<Group name="Grid">
<Setting name="snapToGrid">0</Setting>
<Setting name="gridSize">10 10 10</Setting>
<Setting name="planeDim">500</Setting>
<Setting name="renderPlane">0</Setting>
<Setting name="gridColor">255 255 255 20</Setting>
<Setting name="renderPlaneHashes">0</Setting>
</Group>
</Group>
<Group name="RiverEditor">
<Setting name="HoverSplineColor">255 0 0 255</Setting>
<Setting name="DefaultDepth">5</Setting>
<Setting name="DefaultWidth">10</Setting>
<Setting name="HoverNodeColor">255 255 255 255</Setting>
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
<Setting name="DefaultNormal">0 0 1</Setting>
</Group>
<Group name="NavEditor">
<Setting name="SpawnClass">AIPlayer</Setting>
</Group>
<Group name="ConvexEditor">
<Setting name="materialName">Grid_512_Orange</Setting>
</Group>
</EditorSettings>

View file

@ -425,4 +425,22 @@ function toggleLightFrustumViz()
function disableLightFrustumViz()
{
$Light::renderLightFrustums = false;
}
//Lighting Viz
singleton Material( Viz_DetailLightingMat )
{
diffuseColor[0] = "0.5 0.5 0.5 1";
preload = true;
};
function toggleDetailLightingViz()
{
if(!isObject(lightBizBin))
DiffuseRenderPassManager.addManager( new lightVisualizerBin(lightBizBin) { renderOrder = 1.5; processAddOrder = 1.5; } );
lightBizBin.material = Viz_DetailLightingMat;
//Then set the lighting bin flags for various modes here
}

View file

@ -302,4 +302,42 @@ function Viz_ColorBlindnessPFX::onEnabled( %this )
disableSurfacePropertiesViz();
return true;
}
//
//Material Complexity Viz
new ShaderData( Viz_MaterialComplexity )
{
DXVertexShaderFile = "./shaders/Viz_materialComplexityV.hlsl";
DXPixelShaderFile = "./shaders/Viz_materialComplexityP.hlsl";
OGLVertexShaderFile = "./shaders/basicRibbonShaderV.glsl";
OGLPixelShaderFile = "./shaders/basicRibbonShaderP.glsl";
//samplerNames[0] = "$ribTex";
pixVersion = 2.0;
};
singleton CustomMaterial( Viz_MaterialComplexityMat )
{
shader = Viz_MaterialComplexity;
version = 2.0;
emissive[0] = true;
doubleSided = true;
translucent = true;
preload = true;
};
function toggleMatComplexityViz()
{
if(!isObject(MatComplexityVizBin))
DiffuseRenderPassManager.addManager( new MaterailComplexityVisualizerBin(MatComplexityVizBin) { renderOrder = 1.55; processAddOrder = 1.55; } );
MatComplexityVizBin.material = Viz_MaterialComplexityMat;
MatComplexityVizBin.maxComplexity = 10;
}

View file

@ -0,0 +1,84 @@
//-----------------------------------------------------------------------------
// 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(ssaoMaskTex, 3);
TORQUE_UNIFORM_SAMPLER2D(backbufferTex, 4);
TORQUE_UNIFORM_SAMPLER2D(glowBuffer, 5);
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( ssaoMaskTex, IN.uv0 ).rgb, 1.0);
else if(mode == 13)
float4(TORQUE_TEX2D( backbufferTex, IN.uv0 ).rgb, 1.0);
else if(mode == 14)
float4(TORQUE_TEX2D( glowBuffer, IN.uv0 ).rgb, 1.0);
return float4(0,0,0,1);
}

View file

@ -0,0 +1,52 @@
//-----------------------------------------------------------------------------
// 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/lighting.hlsl"
#include "../../../../core/rendering/shaders/torque.hlsl"
struct ConnectData
{
float4 hpos : SV_Position;
float2 out_texCoord : TEXCOORD0;
float3 outWsPosition : TEXCOORD1;
};
uniform float materialComplexity;
uniform float minComplexity;
uniform float maxComplexity;
float4 main( ConnectData IN ) : TORQUE_TARGET0
{
float complexity = (materialComplexity-minComplexity)/(maxComplexity-minComplexity);
float3 green = float3(0,1,0);
float3 yellow = float3(1,1,0);
float3 red = float3(1,0,0);
float a = complexity * 2;
float3 finalColor = lerp (green, yellow, a);
a -= 1;
finalColor = lerp (finalColor, red, a);
return float4(finalColor, 1.0);
}

View file

@ -0,0 +1,66 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
// Dependencies:
#include "../../../../core/rendering/shaders/lighting.hlsl"
#include "../../../../core/rendering/shaders/torque.hlsl"
struct VertData
{
float3 position : POSITION;
float3 normal : NORMAL;
float3 binormal : BINORMAL;
float3 tangent : TANGENT;
float2 uv0 : TEXCOORD0;
};
struct ConnectData
{
float4 hpos : SV_Position;
float2 out_texCoord : TEXCOORD0;
float3 outWsPosition : TEXCOORD1;
};
//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------
ConnectData main( VertData IN,
uniform float4x4 modelview : register(C0),
uniform float4x4 worldToObj : register(C4),
uniform float4x4 objTrans : register(C8)
)
{
ConnectData OUT;
// Vert Position
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
// Base Texture
OUT.out_texCoord = (float2)IN.uv0;
// Deferred RT Lighting
OUT.outWsPosition = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
return OUT;
}