mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
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:
parent
9e1544880e
commit
52fcbecb9f
21 changed files with 912 additions and 487 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue