mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-11 16:30:48 +00:00
Added ability to pass ints to post effect shader consts
Reorg'd probe init to flow better and be more robust on load Cleaned up various parts of the probe render manager to be more stable Fixed issue with crash on release due to numProbe in loops being 0 Updated glsl probe array shader Beginning of rework of editor settings Beginning of conversion of asset import config to similar system as editor settings
This commit is contained in:
parent
b40d33a663
commit
dd3422b5a2
21 changed files with 300 additions and 420 deletions
|
|
@ -322,8 +322,6 @@ singleton ShaderData( PFX_ReflectionProbeArray )
|
|||
samplerNames[3] = "$BRDFTexture";
|
||||
samplerNames[4] = "$specularCubemapAR";
|
||||
samplerNames[5] = "$irradianceCubemapAR";
|
||||
samplerNames[6] = "$skylightSpecularMap";
|
||||
samplerNames[7] = "$skylightIrradMap";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
|
@ -345,7 +343,6 @@ singleton GFXStateBlockData( PFX_ReflectionProbeArrayStateBlock )
|
|||
zEnable = false;
|
||||
zWriteEnable = false;
|
||||
|
||||
|
||||
samplersDefined = true;
|
||||
samplerStates[0] = SamplerClampPoint;
|
||||
samplerStates[1] = SamplerClampPoint;
|
||||
|
|
@ -353,6 +350,4 @@ singleton GFXStateBlockData( PFX_ReflectionProbeArrayStateBlock )
|
|||
samplerStates[3] = SamplerClampPoint;
|
||||
samplerStates[4] = SamplerClampLinear;
|
||||
samplerStates[5] = SamplerClampLinear;
|
||||
samplerStates[6] = SamplerClampLinear;
|
||||
samplerStates[7] = SamplerClampLinear;
|
||||
};
|
||||
|
|
@ -19,7 +19,8 @@ uniform vec3 eyePosWorld;
|
|||
//cubemap arrays require all the same size. so shared mips# value
|
||||
uniform float cubeMips;
|
||||
|
||||
uniform float numProbes;
|
||||
uniform int numProbes;
|
||||
|
||||
uniform samplerCubeArray specularCubemapAR;
|
||||
uniform samplerCubeArray irradianceCubemapAR;
|
||||
|
||||
|
|
@ -34,9 +35,7 @@ uniform vec4 probeConfigData[MAX_PROBES]; //r,g,b/mode,radius,atten
|
|||
uniform vec4 probeContribColors[MAX_PROBES];
|
||||
#endif
|
||||
|
||||
uniform samplerCube skylightSpecularMap;
|
||||
uniform samplerCube skylightIrradMap;
|
||||
uniform float hasSkylight;
|
||||
uniform float skylightCubemapIdx;
|
||||
|
||||
out vec4 OUT_col;
|
||||
|
||||
|
|
@ -56,6 +55,7 @@ void main()
|
|||
|
||||
float alpha = 1;
|
||||
|
||||
#if SKYLIGHT_ONLY == 0
|
||||
int i = 0;
|
||||
float blendFactor[MAX_PROBES];
|
||||
float blendSum = 0;
|
||||
|
|
@ -64,8 +64,9 @@ void main()
|
|||
float probehits = 0;
|
||||
//Set up our struct data
|
||||
float contribution[MAX_PROBES];
|
||||
if (alpha > 0)
|
||||
{
|
||||
|
||||
//if (alpha > 0)
|
||||
//{
|
||||
//Process prooooobes
|
||||
for (i = 0; i < numProbes; ++i)
|
||||
{
|
||||
|
|
@ -83,6 +84,8 @@ void main()
|
|||
if (contribution[i]>0.0)
|
||||
probehits++;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
contribution[i] = max(contribution[i],0);
|
||||
|
||||
|
|
@ -106,20 +109,21 @@ void main()
|
|||
}
|
||||
|
||||
// Normalize blendVal
|
||||
#if DEBUGVIZ_ATTENUATION == 0 //this can likely be removed when we fix the above normalization behavior
|
||||
if (blendFacSum == 0.0f) // Possible with custom weight
|
||||
{
|
||||
blendFacSum = 1.0f;
|
||||
}
|
||||
#endif
|
||||
if (blendFacSum == 0.0f) // Possible with custom weight
|
||||
{
|
||||
blendFacSum = 1.0f;
|
||||
}
|
||||
|
||||
float invBlendSumWeighted = 1.0f / blendFacSum;
|
||||
for (i = 0; i < numProbes; ++i)
|
||||
{
|
||||
blendFactor[i] *= invBlendSumWeighted;
|
||||
contribution[i] *= blendFactor[i];
|
||||
alpha -= contribution[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
alpha -= blendSum;
|
||||
|
||||
#if DEBUGVIZ_ATTENUATION == 1
|
||||
float contribAlpha = 1;
|
||||
|
|
@ -142,12 +146,14 @@ void main()
|
|||
}
|
||||
|
||||
//Skylight coloration for anything not covered by probes above
|
||||
finalContribColor += vec3(0.3, 0.3, 0.3) * contribAlpha;
|
||||
if(skylightCubemapIdx != -1)
|
||||
finalContribColor += vec3(0.3, 0.3, 0.3) * contribAlpha;
|
||||
|
||||
OUT_col = vec4(finalContribColor, 1);
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
//}
|
||||
#endif
|
||||
|
||||
vec3 irradiance = vec3(0, 0, 0);
|
||||
vec3 specular = vec3(0, 0, 0);
|
||||
|
|
@ -159,27 +165,27 @@ void main()
|
|||
float lod = 0;
|
||||
#endif
|
||||
|
||||
#if SKYLIGHT_ONLY == 0
|
||||
alpha = 1;
|
||||
for (i = 0; i < numProbes; ++i)
|
||||
{
|
||||
float contrib = contribution[i];
|
||||
if (contrib != 0)
|
||||
{
|
||||
float cubemapIdx = probeConfigData[i].a;
|
||||
int cubemapIdx = probeConfigData[i].a;
|
||||
vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], bbMinArray[i].xyz, bbMaxArray[i].xyz, inRefPosArray[i].xyz);
|
||||
|
||||
irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;
|
||||
specular += textureLod(specularCubemapAR, vec4(dir, cubemapIdx), lod).xyz * contrib;
|
||||
//irradiance += vec3(1,1,1) * contrib;
|
||||
//specular += vec3(1,1,1) * contrib;
|
||||
alpha -= contrib;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hasSkylight == 1 && alpha > 0.001)
|
||||
if (skylightCubemapIdx != -1 && alpha > 0.001)
|
||||
{
|
||||
irradiance += textureLod(skylightIrradMap, surface.R, 0).xyz * alpha;
|
||||
specular += textureLod(skylightSpecularMap, surface.R, lod).xyz * alpha;
|
||||
irradiance += textureLod(irradianceCubemapAR, vec4(surface.R, skylightCubemapIdx), 0).xyz * alpha;
|
||||
specular += textureLod(specularCubemapAR, vec4(surface.R, skylightCubemapIdx), lod).xyz * alpha;
|
||||
}
|
||||
|
||||
#if DEBUGVIZ_SPECCUBEMAP == 1 && DEBUGVIZ_DIFFCUBEMAP == 0
|
||||
|
|
|
|||
|
|
@ -1,162 +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.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "../../../gl/hlslCompat.glsl"
|
||||
#include "shadergen:/autogenConditioners.h"
|
||||
#include "farFrustumQuad.glsl"
|
||||
#include "../../../gl/torque.glsl"
|
||||
#include "../../../gl/lighting.glsl"
|
||||
#line 27
|
||||
|
||||
in vec4 pos;
|
||||
in vec4 wsEyeDir;
|
||||
in vec4 ssPos;
|
||||
in vec4 vsEyeDir;
|
||||
|
||||
uniform sampler2D deferredBuffer;
|
||||
uniform sampler2D colorBuffer;
|
||||
uniform sampler2D matInfoBuffer;
|
||||
uniform samplerCube cubeMap;
|
||||
uniform samplerCube irradianceCubemap;
|
||||
uniform sampler2D BRDFTexture;
|
||||
uniform float cubeMips;
|
||||
|
||||
uniform vec4 rtParams0;
|
||||
|
||||
uniform vec3 probeWSPos;
|
||||
uniform vec3 probeLSPos;
|
||||
uniform vec4 vsFarPlane;
|
||||
|
||||
uniform float radius;
|
||||
uniform vec2 attenuation;
|
||||
|
||||
uniform mat4 worldToObj;
|
||||
uniform mat4 cameraToWorld;
|
||||
|
||||
uniform vec3 eyePosWorld;
|
||||
uniform vec3 bbMin;
|
||||
uniform vec3 bbMax;
|
||||
|
||||
uniform float useSphereMode;
|
||||
|
||||
// Box Projected IBL Lighting
|
||||
// Based on: http://www.gamedev.net/topic/568829-box-projected-cubemap-environment-mapping/
|
||||
// and https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/
|
||||
vec3 boxProject(vec3 wsPosition, vec3 reflectDir, vec3 boxWSPos, vec3 boxMin, vec3 boxMax)
|
||||
{
|
||||
vec3 nrdir = reflectDir;
|
||||
vec3 offset = wsPosition;
|
||||
vec3 plane1vec = (boxMax - offset) / nrdir;
|
||||
vec3 plane2vec = (boxMin - offset) / nrdir;
|
||||
|
||||
vec3 furthestPlane = max(plane1vec, plane2vec);
|
||||
float dist = min(min(furthestPlane.x, furthestPlane.y), furthestPlane.z);
|
||||
vec3 posonbox = offset + nrdir * dist;
|
||||
|
||||
return posonbox - boxWSPos;
|
||||
}
|
||||
|
||||
vec3 iblBoxSpecular(vec3 normal, vec3 wsPos, float roughness, vec3 surfToEye,
|
||||
sampler2D brdfTexture,
|
||||
samplerCube radianceCube,
|
||||
vec3 boxPos,
|
||||
vec3 boxMin,
|
||||
vec3 boxMax)
|
||||
{
|
||||
float ndotv = clamp(dot(normal, surfToEye), 0.0, 1.0);
|
||||
|
||||
// BRDF
|
||||
vec2 brdf = textureLod(brdfTexture, vec2(roughness, ndotv),0).xy;
|
||||
|
||||
// Radiance (Specular)
|
||||
float maxmip = pow(cubeMips+1,2);
|
||||
float lod = roughness*maxmip;
|
||||
vec3 r = reflect(surfToEye, normal);
|
||||
vec3 cubeR = normalize(r);
|
||||
cubeR = boxProject(wsPos, cubeR, boxPos, boxMin, boxMax);
|
||||
|
||||
vec3 radiance = textureLod(radianceCube, cubeR, lod).xyz * (brdf.x + brdf.y);
|
||||
|
||||
return radiance;
|
||||
}
|
||||
|
||||
float defineBoxSpaceInfluence(vec3 surfPosWS, vec3 probePos, float radius, float atten)
|
||||
{
|
||||
vec3 surfPosLS = tMul( worldToObj, vec4(surfPosWS,1.0)).xyz;
|
||||
|
||||
vec3 boxMinLS = probePos-(vec3(1,1,1)*radius);
|
||||
vec3 boxMaxLS = probePos+(vec3(1,1,1)*radius);
|
||||
|
||||
float boxOuterRange = length(boxMaxLS - boxMinLS);
|
||||
float boxInnerRange = boxOuterRange / atten;
|
||||
|
||||
vec3 localDir = vec3(abs(surfPosLS.x), abs(surfPosLS.y), abs(surfPosLS.z));
|
||||
localDir = (localDir - boxInnerRange) / (boxOuterRange - boxInnerRange);
|
||||
|
||||
return max(localDir.x, max(localDir.y, localDir.z)) * -1;
|
||||
}
|
||||
out vec4 OUT_col;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
// Compute scene UV
|
||||
vec2 uvScene = getUVFromSSPos( ssPos.xyz/ssPos.w, rtParams0 );
|
||||
|
||||
//eye ray WS/LS
|
||||
vec3 vsEyeRay = getDistanceVectorToPlane( -vsFarPlane.w, vsEyeDir.xyz, vsFarPlane );
|
||||
vec3 wsEyeRay = tMul(cameraToWorld, vec4(vsEyeRay, 0)).xyz;
|
||||
|
||||
//unpack normal and linear depth
|
||||
vec4 normDepth = deferredUncondition(deferredBuffer, uvScene);
|
||||
|
||||
//create surface
|
||||
Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
|
||||
uvScene, eyePosWorld, wsEyeRay, cameraToWorld);
|
||||
float blendVal = 1.0;
|
||||
if(useSphereMode>0)
|
||||
{
|
||||
vec3 L = probeWSPos - surface.P;
|
||||
blendVal = 1.0-length(L)/radius;
|
||||
clip(blendVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
float tempAttenVal = 3.5;
|
||||
blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal);
|
||||
clip(blendVal);
|
||||
float compression = 0.05;
|
||||
blendVal=(1.0-compression)+blendVal*compression;
|
||||
}
|
||||
//render into the bound space defined above
|
||||
vec3 surfToEye = normalize(surface.P - eyePosWorld);
|
||||
vec3 irradiance = textureLod(irradianceCubemap, surface.N,0).xyz;
|
||||
vec3 specular = iblBoxSpecular(surface.N, surface.P, surface.roughness, surfToEye, BRDFTexture, cubeMap, probeWSPos, bbMin, bbMax);
|
||||
vec3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness);
|
||||
specular *= F;
|
||||
//energy conservation
|
||||
vec3 kD = vec3(1.0) - F;
|
||||
kD *= 1.0 - surface.metalness;
|
||||
//final diffuse color
|
||||
vec3 diffuse = kD * irradiance * surface.baseColor.rgb;
|
||||
|
||||
OUT_col = vec4(diffuse + specular * surface.ao, blendVal);
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#include "shadergen:/autogenConditioners.h"
|
||||
#include "../../torque.hlsl"
|
||||
|
||||
// This is the shader input
|
||||
struct Vert
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
float3 wsEyeRay : TEXCOORD1;
|
||||
};
|
||||
|
||||
// This is the shader output data.
|
||||
struct Conn
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
float3 wsEyeRay : TEXCOORD1;
|
||||
};
|
||||
|
||||
// Render Target Paramaters
|
||||
float4 rtParams0;
|
||||
|
||||
Conn main(Vert IN,
|
||||
uniform float4x4 modelView : register(C0))
|
||||
{
|
||||
Conn OUT;
|
||||
OUT.position = IN.position;
|
||||
OUT.uv0 = viewportCoordToRenderTarget( IN.uv0, rtParams0 );
|
||||
OUT.wsEyeRay = IN.wsEyeRay;
|
||||
return OUT;
|
||||
}
|
||||
|
||||
|
|
@ -16,7 +16,8 @@ uniform float3 eyePosWorld;
|
|||
//cubemap arrays require all the same size. so shared mips# value
|
||||
uniform float cubeMips;
|
||||
|
||||
uniform float numProbes;
|
||||
uniform int numProbes;
|
||||
|
||||
TORQUE_UNIFORM_SAMPLERCUBEARRAY(specularCubemapAR, 4);
|
||||
TORQUE_UNIFORM_SAMPLERCUBEARRAY(irradianceCubemapAR, 5);
|
||||
|
||||
|
|
@ -31,7 +32,6 @@ uniform float4 probeConfigData[MAX_PROBES]; //r,g,b/mode,radius,atten
|
|||
uniform float4 probeContribColors[MAX_PROBES];
|
||||
#endif
|
||||
|
||||
uniform float hasSkylight;
|
||||
uniform float skylightCubemapIdx;
|
||||
|
||||
float4 main(PFXVertToPix IN) : SV_TARGET
|
||||
|
|
@ -46,11 +46,12 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
//early out if emissive
|
||||
if (getFlag(surface.matFlag, 0))
|
||||
{
|
||||
discard;
|
||||
return TORQUE_TEX2D(colorBuffer, IN.uv0.xy);
|
||||
}
|
||||
|
||||
float alpha = 1;
|
||||
|
||||
#if SKYLIGHT_ONLY == 0
|
||||
int i = 0;
|
||||
float blendFactor[MAX_PROBES];
|
||||
float blendSum = 0;
|
||||
|
|
@ -59,8 +60,9 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
float probehits = 0;
|
||||
//Set up our struct data
|
||||
float contribution[MAX_PROBES];
|
||||
if (alpha > 0)
|
||||
{
|
||||
|
||||
//if (alpha > 0)
|
||||
//{
|
||||
//Process prooooobes
|
||||
for (i = 0; i < numProbes; ++i)
|
||||
{
|
||||
|
|
@ -78,6 +80,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
if (contribution[i]>0.0)
|
||||
probehits++;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
contribution[i] = max(contribution[i],0);
|
||||
|
||||
|
|
@ -90,34 +94,32 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
// Weight1 = normalized inverted NDF, so we have 1 at center, 0 at boundary
|
||||
// and respect constraint A.
|
||||
|
||||
if (probehits>1.0)
|
||||
{
|
||||
for (i = 0; i < numProbes; i++)
|
||||
{
|
||||
blendFactor[i] = ((contribution[i] / blendSum)) / probehits;
|
||||
blendFactor[i] *= ((contribution[i]) / invBlendSum);
|
||||
blendFactor[i] = saturate(blendFactor[i]);
|
||||
blendFacSum += blendFactor[i];
|
||||
}
|
||||
if (probehits > 1.0)
|
||||
{
|
||||
for (i = 0; i < numProbes; i++)
|
||||
{
|
||||
blendFactor[i] = ((contribution[i] / blendSum)) / probehits;
|
||||
blendFactor[i] *= ((contribution[i]) / invBlendSum);
|
||||
blendFactor[i] = saturate(blendFactor[i]);
|
||||
blendFacSum += blendFactor[i];
|
||||
}
|
||||
|
||||
// Normalize blendVal
|
||||
#if DEBUGVIZ_ATTENUATION == 0 //this can likely be removed when we fix the above normalization behavior
|
||||
if (blendFacSum == 0.0f) // Possible with custom weight
|
||||
{
|
||||
blendFacSum = 1.0f;
|
||||
}
|
||||
#endif
|
||||
// Normalize blendVal
|
||||
if (blendFacSum == 0.0f) // Possible with custom weight
|
||||
{
|
||||
blendFacSum = 1.0f;
|
||||
}
|
||||
|
||||
float invBlendSumWeighted = 1.0f / blendFacSum;
|
||||
for (i = 0; i < numProbes; ++i)
|
||||
{
|
||||
blendFactor[i] *= invBlendSumWeighted;
|
||||
contribution[i] *= blendFactor[i];
|
||||
alpha -= contribution[i];
|
||||
}
|
||||
float invBlendSumWeighted = 1.0f / blendFacSum;
|
||||
for (i = 0; i < numProbes; ++i)
|
||||
{
|
||||
blendFactor[i] *= invBlendSumWeighted;
|
||||
contribution[i] *= blendFactor[i];
|
||||
alpha -= contribution[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
alpha -= blendSum;
|
||||
alpha -= blendSum;
|
||||
|
||||
#if DEBUGVIZ_ATTENUATION == 1
|
||||
float contribAlpha = 1;
|
||||
|
|
@ -139,11 +141,13 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
}
|
||||
|
||||
//Skylight coloration for anything not covered by probes above
|
||||
finalContribColor += float3(0.3, 0.3, 0.3) * contribAlpha;
|
||||
if(skylightCubemapIdx != -1)
|
||||
finalContribColor += float3(0.3, 0.3, 0.3) * contribAlpha;
|
||||
|
||||
return float4(finalContribColor, 1);
|
||||
#endif
|
||||
}
|
||||
//}
|
||||
#endif
|
||||
|
||||
float3 irradiance = float3(0, 0, 0);
|
||||
float3 specular = float3(0, 0, 0);
|
||||
|
|
@ -155,6 +159,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
float lod = 0;
|
||||
#endif
|
||||
|
||||
#if SKYLIGHT_ONLY == 0
|
||||
alpha = 1;
|
||||
for (i = 0; i < numProbes; ++i)
|
||||
{
|
||||
|
|
@ -169,8 +174,9 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
alpha -= contrib;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hasSkylight && alpha > 0.001)
|
||||
if(skylightCubemapIdx != -1 && alpha >= 0.001)
|
||||
{
|
||||
irradiance += TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.R, skylightCubemapIdx, 0).xyz * alpha;
|
||||
specular += TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz * alpha;
|
||||
|
|
@ -197,6 +203,5 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
float3 diffuse = kD * irradiance * surface.baseColor.rgb;
|
||||
float4 finalColor = float4(diffuse + specular * surface.ao, 1.0);
|
||||
|
||||
//finalColor.rgb += abs(surface.N);
|
||||
return finalColor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ function AssetBrowser::showDialog( %this, %AssetTypeFilter, %selectCallback, %ta
|
|||
AssetBrowser.fieldTargetObject = %targetObj;
|
||||
AssetBrowser.fieldTargetName = %fieldName;
|
||||
|
||||
Canvas.add(AssetBrowser);
|
||||
Canvas.pushDialog(AssetBrowser);
|
||||
AssetBrowser.setVisible(1);
|
||||
AssetBrowserWindow.setVisible(1);
|
||||
AssetBrowserWindow.selectWindow();
|
||||
|
|
|
|||
|
|
@ -497,6 +497,9 @@ function ImportAssetWindow::onWake(%this)
|
|||
return;
|
||||
|
||||
$AssetBrowser::importConfigsFile = "tools/assetBrowser/assetImportConfigs.xml";
|
||||
$AssetBrowser::currentImportConfig = "";
|
||||
new Settings(AssetImportSettings) { file = $AssetBrowser::importConfigsFile; };
|
||||
AssetImportSettings.read();
|
||||
|
||||
%this.reloadImportOptionConfigs();
|
||||
}
|
||||
|
|
@ -510,17 +513,15 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this)
|
|||
if(%xmlDoc.loadFile($AssetBrowser::importConfigsFile))
|
||||
{
|
||||
//StateMachine element
|
||||
%xmlDoc.pushFirstChildElement("AssetImportConfigs");
|
||||
%xmlDoc.pushFirstChildElement("AssetImportSettings");
|
||||
|
||||
//Configs
|
||||
//Config Groups
|
||||
%configCount = 0;
|
||||
while(%xmlDoc.pushChildElement(%configCount))
|
||||
{
|
||||
%configObj = new ScriptObject(){};
|
||||
|
||||
%configObj.Name = %xmlDoc.attribute("Name");
|
||||
%configName = %xmlDoc.attribute("name");
|
||||
|
||||
%xmlDoc.pushFirstChildElement("Mesh");
|
||||
/*%xmlDoc.pushFirstChildElement("Mesh");
|
||||
%configObj.ImportMesh = %xmlDoc.attribute("ImportMesh");
|
||||
%configObj.DoUpAxisOverride = %xmlDoc.attribute("DoUpAxisOverride");
|
||||
%configObj.UpAxisOverride = %xmlDoc.attribute("UpAxisOverride");
|
||||
|
|
@ -583,12 +584,12 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this)
|
|||
%configObj.VolumeAdjust = %xmlDoc.attribute("VolumeAdjust");
|
||||
%configObj.PitchAdjust = %xmlDoc.attribute("PitchAdjust");
|
||||
%configObj.Compressed = %xmlDoc.attribute("Compressed");
|
||||
%xmlDoc.popElement();
|
||||
%xmlDoc.popElement();*/
|
||||
|
||||
%xmlDoc.popElement();
|
||||
%configCount++;
|
||||
|
||||
ImportAssetWindow.importConfigsList.add(%configObj);
|
||||
ImportAssetWindow.importConfigsList.add(%configName);
|
||||
}
|
||||
|
||||
%xmlDoc.popElement();
|
||||
|
|
@ -596,8 +597,8 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this)
|
|||
|
||||
for(%i = 0; %i < ImportAssetWindow.importConfigsList.count(); %i++)
|
||||
{
|
||||
%configObj = ImportAssetWindow.importConfigsList.getKey(%i);
|
||||
ImportAssetConfigList.add(%configObj.Name);
|
||||
%configName = ImportAssetWindow.importConfigsList.getKey(%i);
|
||||
ImportAssetConfigList.add(%configName);
|
||||
}
|
||||
|
||||
%importConfigIdx = ImportAssetWindow.activeImportConfigIndex;
|
||||
|
|
@ -607,7 +608,7 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this)
|
|||
ImportAssetConfigList.setSelected(%importConfigIdx);
|
||||
}
|
||||
|
||||
function ImportAssetWindow::setImportOptions(%this, %optionsObj)
|
||||
function ImportAssetWindow::setImportOptions(%this, %configName)
|
||||
{
|
||||
//Todo, editor + load from files for preconfigs
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ new GuiControlProfile (ToolsGuiDefaultProfile)
|
|||
mouseOverSelected = false;
|
||||
|
||||
// fill color
|
||||
opaque = true;
|
||||
opaque = false;
|
||||
fillColor = "50 50 50";
|
||||
fillColorHL = "91 101 116";
|
||||
fillColorSEL = "91 101 116";
|
||||
|
|
|
|||
|
|
@ -1,94 +1,128 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<EditorSettings>
|
||||
<Group name="ConvexEditor">
|
||||
<Setting name="materialName">Grid_512_Orange</Setting>
|
||||
</Group>
|
||||
<Group name="LevelInformation">
|
||||
<Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
|
||||
<Group name="levels">
|
||||
<Group name="PbrMatTest.mis">
|
||||
<Setting name="cameraSpeed">5</Setting>
|
||||
</Group>
|
||||
<Group name="BlankRoom.mis">
|
||||
<Setting name="cameraSpeed">25</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="WorldEditor">
|
||||
<Setting name="forceLoadDAE">0</Setting>
|
||||
<Setting name="orthoShowGrid">1</Setting>
|
||||
<Setting name="dropType">screenCenter</Setting>
|
||||
<Setting name="displayType">6</Setting>
|
||||
<Setting name="forceLoadDAE">0</Setting>
|
||||
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
|
||||
<Setting name="orthoShowGrid">1</Setting>
|
||||
<Setting name="undoLimit">40</Setting>
|
||||
<Setting name="orthoFOV">50</Setting>
|
||||
<Setting name="torsionPath">AssetWork_Debug.exe</Setting>
|
||||
<Setting name="displayType">6</Setting>
|
||||
<Setting name="orthoFOV">50</Setting>
|
||||
<Group name="Color">
|
||||
<Setting name="objectTextColor">255 255 255 255</Setting>
|
||||
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
|
||||
<Setting name="selectionBoxColor">255 255 0 255</Setting>
|
||||
<Setting name="dragRectColor">255 255 0 255</Setting>
|
||||
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
|
||||
<Setting name="objSelectColor">255 0 0 255</Setting>
|
||||
<Setting name="objMouseOverColor">0 255 0 255</Setting>
|
||||
</Group>
|
||||
<Group name="Theme">
|
||||
<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="windowTitleBGNAColor">180 180 180 255</Setting>
|
||||
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
|
||||
</Group>
|
||||
<Group name="Tools">
|
||||
<Setting name="dropAtScreenCenterMax">100</Setting>
|
||||
<Setting name="snapSoft">0</Setting>
|
||||
<Setting name="boundingBoxCollision">0</Setting>
|
||||
<Setting name="snapGround">0</Setting>
|
||||
<Setting name="objectsUseBoxCenter">1</Setting>
|
||||
<Setting name="snapSoftSize">2</Setting>
|
||||
<Setting name="dropAtScreenCenterScalar">1</Setting>
|
||||
</Group>
|
||||
<Group name="Grid">
|
||||
<Setting name="gridMinorColor">51 51 51 100</Setting>
|
||||
<Setting name="gridColor">102 102 102 100</Setting>
|
||||
<Setting name="gridSize">1</Setting>
|
||||
<Setting name="gridOriginColor">255 255 255 100</Setting>
|
||||
<Setting name="gridSnap">0</Setting>
|
||||
</Group>
|
||||
<Group name="Images">
|
||||
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
|
||||
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
|
||||
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
|
||||
</Group>
|
||||
<Group name="Docs">
|
||||
<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>
|
||||
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</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="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>
|
||||
<Setting name="fadeIconsStartDist">8</Setting>
|
||||
</Group>
|
||||
<Group name="Render">
|
||||
<Setting name="renderObjText">1</Setting>
|
||||
<Setting name="showMousePopupInfo">1</Setting>
|
||||
<Setting name="renderSelectionBox">1</Setting>
|
||||
<Setting name="renderObjText">1</Setting>
|
||||
<Setting name="renderPopupBackground">1</Setting>
|
||||
<Setting name="renderObjHandle">1</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="AxisGizmo">
|
||||
<Setting name="mouseRotateScalar">0.8</Setting>
|
||||
<Setting name="axisGizmoMaxScreenLen">100</Setting>
|
||||
<Setting name="mouseScaleScalar">0.8</Setting>
|
||||
<Setting name="rotationSnap">15</Setting>
|
||||
<Setting name="renderWhenUsed">0</Setting>
|
||||
<Setting name="snapRotations">0</Setting>
|
||||
<Setting name="renderInfoText">1</Setting>
|
||||
<Group name="Grid">
|
||||
<Setting name="gridOriginColor">255 255 255 100</Setting>
|
||||
<Setting name="gridSnap">0</Setting>
|
||||
<Setting name="gridMinorColor">51 51 51 100</Setting>
|
||||
<Setting name="gridColor">102 102 102 100</Setting>
|
||||
<Setting name="gridSize">1</Setting>
|
||||
</Group>
|
||||
<Group name="Tools">
|
||||
<Setting name="snapSoftSize">2</Setting>
|
||||
<Setting name="snapSoft">0</Setting>
|
||||
<Setting name="boundingBoxCollision">0</Setting>
|
||||
<Setting name="dropAtScreenCenterScalar">1</Setting>
|
||||
<Setting name="objectsUseBoxCenter">1</Setting>
|
||||
<Setting name="snapGround">0</Setting>
|
||||
<Setting name="dropAtScreenCenterMax">100</Setting>
|
||||
</Group>
|
||||
<Group name="Theme">
|
||||
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
|
||||
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
|
||||
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
|
||||
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
|
||||
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
|
||||
</Group>
|
||||
<Group name="Color">
|
||||
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
|
||||
<Setting name="objMouseOverColor">0 255 0 255</Setting>
|
||||
<Setting name="objSelectColor">255 0 0 255</Setting>
|
||||
<Setting name="dragRectColor">255 255 0 255</Setting>
|
||||
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
|
||||
<Setting name="objectTextColor">255 255 255 255</Setting>
|
||||
<Setting name="selectionBoxColor">255 255 0 255</Setting>
|
||||
</Group>
|
||||
<Group name="Images">
|
||||
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
|
||||
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
|
||||
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
|
||||
<Setting name="snapToGrid">0</Setting>
|
||||
<Setting name="gridColor">255 255 255 20</Setting>
|
||||
<Setting name="renderPlaneHashes">0</Setting>
|
||||
<Setting name="gridSize">10 10 10</Setting>
|
||||
<Setting name="renderPlane">0</Setting>
|
||||
<Setting name="planeDim">500</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="GuiEditor">
|
||||
<Setting name="previewResolution">1024 768</Setting>
|
||||
<Setting name="lastPath">tools/gui</Setting>
|
||||
<Setting name="previewResolution">1024 768</Setting>
|
||||
<Group name="EngineDevelopment">
|
||||
<Setting name="showEditorProfiles">0</Setting>
|
||||
<Setting name="toggleIntoEditor">0</Setting>
|
||||
<Setting name="showEditorGuis">0</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="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
|
||||
</Group>
|
||||
<Group name="Snapping">
|
||||
<Setting name="snapToCanvas">1</Setting>
|
||||
<Setting name="snapToGuides">1</Setting>
|
||||
<Setting name="snapToCenters">1</Setting>
|
||||
<Setting name="snapToControls">1</Setting>
|
||||
<Setting name="snap2GridSize">8</Setting>
|
||||
<Setting name="snapToCenters">1</Setting>
|
||||
<Setting name="snapToGuides">1</Setting>
|
||||
<Setting name="sensitivity">2</Setting>
|
||||
<Setting name="snapToEdges">1</Setting>
|
||||
<Setting name="snap2Grid">0</Setting>
|
||||
</Group>
|
||||
<Group name="Help">
|
||||
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
|
||||
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
|
||||
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
|
||||
<Group name="Selection">
|
||||
<Setting name="fullBox">0</Setting>
|
||||
</Group>
|
||||
<Group name="Rendering">
|
||||
<Setting name="drawGuides">1</Setting>
|
||||
|
|
@ -97,37 +131,6 @@
|
|||
<Group name="Library">
|
||||
<Setting name="viewType">Categorized</Setting>
|
||||
</Group>
|
||||
<Group name="Selection">
|
||||
<Setting name="fullBox">0</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="AxisGizmo">
|
||||
<Setting name="renderWhenUsed">0</Setting>
|
||||
<Setting name="renderInfoText">1</Setting>
|
||||
<Setting name="axisGizmoMaxScreenLen">100</Setting>
|
||||
<Setting name="rotationSnap">15</Setting>
|
||||
<Setting name="snapRotations">0</Setting>
|
||||
<Setting name="mouseRotateScalar">0.8</Setting>
|
||||
<Setting name="mouseScaleScalar">0.8</Setting>
|
||||
<Group name="Grid">
|
||||
<Setting name="renderPlane">0</Setting>
|
||||
<Setting name="planeDim">500</Setting>
|
||||
<Setting name="renderPlaneHashes">0</Setting>
|
||||
<Setting name="gridColor">255 255 255 20</Setting>
|
||||
<Setting name="gridSize">10 10 10</Setting>
|
||||
<Setting name="snapToGrid">0</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="LevelInformation">
|
||||
<Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
|
||||
<Group name="levels">
|
||||
<Group name="BlankRoom.mis">
|
||||
<Setting name="cameraSpeed">25</Setting>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group name="ConvexEditor">
|
||||
<Setting name="materialName">Grid_512_Orange</Setting>
|
||||
</Group>
|
||||
<Group name="NavEditor">
|
||||
<Setting name="SpawnClass">AIPlayer</Setting>
|
||||
|
|
|
|||
|
|
@ -135,7 +135,12 @@ function initializeWorldEditor()
|
|||
EVisibility.addOption( "Frustum Lock", "$Scene::lockCull", "" );
|
||||
EVisibility.addOption( "Disable Zone Culling", "$Scene::disableZoneCulling", "" );
|
||||
EVisibility.addOption( "Disable Terrain Occlusion", "$Scene::disableTerrainOcclusion", "" );
|
||||
|
||||
|
||||
EVisibility.addOption( "Probes: Attenuation", "$Probes::showAttenuation", "" );
|
||||
EVisibility.addOption( "Probes: Specular Cubemaps", "$Probes::showSpecularCubemaps", "" );
|
||||
EVisibility.addOption( "Probes: Diffuse Cubemaps", "$Probes::showDiffuseCubemaps", "" );
|
||||
EVisibility.addOption( "Probes: Contribution", "$Probes::showProbeContrib", "" );
|
||||
|
||||
EVisibility.addOption( "Colorblindness: Protanopia", "$CBV_Protanopia", "toggleColorBlindnessViz" );
|
||||
EVisibility.addOption( "Colorblindness: Protanomaly", "$CBV_Protanomaly", "toggleColorBlindnessViz" );
|
||||
EVisibility.addOption( "Colorblindness: Deuteranopia", "$CBV_Deuteranopia", "toggleColorBlindnessViz" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue