Core implementation of Physical Based Rendering.
|
|
@ -28,6 +28,7 @@ datablock DecalData(ScorchBigDecal)
|
|||
Material = "DECAL_scorch";
|
||||
size = "5.0";
|
||||
lifeSpan = "50000";
|
||||
textureCoordCount = "0";
|
||||
};
|
||||
|
||||
datablock DecalData(ScorchRXDecal)
|
||||
|
|
|
|||
BIN
Templates/Full/game/art/particles/fireplace.png
Normal file
|
After Width: | Height: | Size: 2 MiB |
BIN
Templates/Full/game/art/particles/test.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
Templates/Full/game/art/shapes/Cheetah/Cheetah_c.dds
Normal file
BIN
Templates/Full/game/art/shapes/actors/Soldier/soldier_c.png
Normal file
|
After Width: | Height: | Size: 3.8 MiB |
BIN
Templates/Full/game/art/shapes/station/building01walls_c.dds
Normal file
BIN
Templates/Full/game/art/shapes/station/building01walls_n.dds
Normal file
BIN
Templates/Full/game/art/shapes/station/grid_c.dds
Normal file
BIN
Templates/Full/game/art/shapes/station/grid_c.png
Normal file
|
After Width: | Height: | Size: 306 KiB |
BIN
Templates/Full/game/art/shapes/station/grid_n.dds
Normal file
BIN
Templates/Full/game/art/shapes/station/plate_c.dds
Normal file
BIN
Templates/Full/game/art/shapes/station/plate_n.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/Metal_A.png
Normal file
|
After Width: | Height: | Size: 367 KiB |
BIN
Templates/Full/game/art/shapes/textures/Metal_N.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
Templates/Full/game/art/shapes/textures/Metal_S.png
Normal file
|
After Width: | Height: | Size: 415 KiB |
BIN
Templates/Full/game/art/shapes/textures/PBRGrid_a.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/PBRGrid_c.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/PBRGrid_n.png
Normal file
|
After Width: | Height: | Size: 656 KiB |
6
Templates/Full/game/art/shapes/textures/PBRTEST.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
singleton TSShapeConstructor(PBRTESTDae)
|
||||
{
|
||||
baseShape = "./PBRTEST.dae";
|
||||
loadLights = "0";
|
||||
};
|
||||
274
Templates/Full/game/art/shapes/textures/PBRTEST.dae
Normal file
11
Templates/Full/game/art/shapes/textures/PBRTEST2.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
singleton TSShapeConstructor(PBRTEST2Dae)
|
||||
{
|
||||
baseShape = "./PBRTEST2.dae";
|
||||
};
|
||||
|
||||
function PBRTEST2Dae::onLoad(%this)
|
||||
{
|
||||
%this.addNode("Col-1", "", "0 0 0 0 0 1 0", "0");
|
||||
%this.addCollisionDetail("-1", "Sphere", "Bounds", "4", "30", "30", "32", "30", "30", "30");
|
||||
}
|
||||
110
Templates/Full/game/art/shapes/textures/PBRTEST2.dae
Normal file
BIN
Templates/Full/game/art/shapes/textures/Stone_A.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/Stone_N.png
Normal file
|
After Width: | Height: | Size: 11 MiB |
BIN
Templates/Full/game/art/shapes/textures/Stone_S.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/T3D_Metal_2_any.png
Normal file
|
After Width: | Height: | Size: 510 KiB |
|
After Width: | Height: | Size: 476 KiB |
BIN
Templates/Full/game/art/shapes/textures/T3D_Metal_2_normal.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
1
Templates/Full/game/art/shapes/textures/T3D_Metal_6.sbs
Normal file
BIN
Templates/Full/game/art/shapes/textures/T3D_Metal_6.sbsar
Normal file
BIN
Templates/Full/game/art/shapes/textures/T3D_Metal_6_any.png
Normal file
|
After Width: | Height: | Size: 378 KiB |
|
After Width: | Height: | Size: 316 KiB |
BIN
Templates/Full/game/art/shapes/textures/T3D_Metal_6_normal.png
Normal file
|
After Width: | Height: | Size: 204 KiB |
BIN
Templates/Full/game/art/shapes/textures/Wood1_A.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/Wood1_N.png
Normal file
|
After Width: | Height: | Size: 21 MiB |
BIN
Templates/Full/game/art/shapes/textures/Wood1_S.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/black.dds
Normal file
BIN
Templates/Full/game/art/shapes/textures/copperalb.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
BIN
Templates/Full/game/art/shapes/textures/coppermtl.png
Normal file
|
After Width: | Height: | Size: 806 B |
BIN
Templates/Full/game/art/shapes/textures/coppernrm.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
Templates/Full/game/art/shapes/textures/copperrgh.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
113
Templates/Full/game/art/shapes/textures/materials.cs
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
|
||||
singleton Material(PBRTEST_PBRMetal)
|
||||
{
|
||||
mapTo = "PBRMetal";
|
||||
diffuseColor[0] = "1 1 1 1";
|
||||
roughness[0] = "1";
|
||||
metalness[0] = "50";
|
||||
translucentBlendOp = "None";
|
||||
diffuseMap[0] = "art/shapes/textures/Metal_A.png";
|
||||
normalMap[0] = "art/shapes/textures/Metal_N.png";
|
||||
materialTag0 = "Miscellaneous";
|
||||
metalChan[0] = "3";
|
||||
specularMap[0] = "art/shapes/textures/Metal_S.png";
|
||||
roughness0 = "1";
|
||||
pixelSpecular0 = "0";
|
||||
invertSmoothness[0] = "1";
|
||||
isSRGb[0] = "1";
|
||||
specularPower0 = "0.415939";
|
||||
specular0 = "0.9 0.9 0.9 1";
|
||||
};
|
||||
|
||||
singleton Material(PBRTEST_PBRWood)
|
||||
{
|
||||
mapTo = "PBRWood";
|
||||
diffuseColor[0] = "1 1 1 1";
|
||||
roughness[0] = "1";
|
||||
metalness[0] = "50";
|
||||
translucentBlendOp = "None";
|
||||
diffuseMap[0] = "art/shapes/textures/Wood1_A.dds";
|
||||
normalMap[0] = "art/shapes/textures/Wood1_N.png";
|
||||
materialTag0 = "Miscellaneous";
|
||||
roughMap[0] = "art/shapes/textures/Wood1_S.dds";
|
||||
metalMap[0] = "art/shapes/textures/Wood1_S.dds";
|
||||
metalChan[0] = "3";
|
||||
roughness0 = "1";
|
||||
pixelSpecular0 = "0";
|
||||
isSRGb[0] = "1";
|
||||
specularPower0 = "0.415939";
|
||||
specular0 = "0.9 0.9 0.9 1";
|
||||
};
|
||||
|
||||
singleton Material(PBRTest2Mat)
|
||||
{
|
||||
mapTo = "PBRTest2Mat";
|
||||
diffuseColor[0] = "1 1 1 1";
|
||||
roughness[0] = "1";
|
||||
metalness[0] = "1";
|
||||
translucentBlendOp = "None";
|
||||
normalMap[0] = "art/shapes/textures/T3D_Metal_6_normal.png";
|
||||
materialTag0 = "Miscellaneous";
|
||||
metalChan[0] = "2";
|
||||
roughness0 = "1";
|
||||
pixelSpecular0 = "0";
|
||||
smoothness[0] = "1";
|
||||
specularMap[0] = "art/shapes/textures/T3D_Metal_6_any.png";
|
||||
specularPower0 = "0.415939";
|
||||
specular0 = "0.9 0.9 0.9 1";
|
||||
translucent = "0";
|
||||
diffuseMap[0] = "art/shapes/textures/T3D_Metal_6_basecolor.png";
|
||||
isSRGb[0] = "1";
|
||||
};
|
||||
|
||||
singleton Material(PBRTest2Mat)
|
||||
{
|
||||
mapTo = "PBRTest2Mat";
|
||||
diffuseColor[0] = "1 1 1 1";
|
||||
smoothness[0] = "1";
|
||||
metalness[0] = "1";
|
||||
translucentBlendOp = "None";
|
||||
diffuseMap[0] = "art/shapes/textures/T3D_Metal_6_basecolor.png";
|
||||
normalMap[0] = "art/shapes/textures/T3D_Metal_6_normal.png";
|
||||
pixelSpecular0 = "0";
|
||||
materialTag0 = "Miscellaneous";
|
||||
specularMap[0] = "art/shapes/textures/T3D_Metal_6_any.png";
|
||||
};
|
||||
|
||||
singleton Material(PBRTEST_PBRstone)
|
||||
{
|
||||
mapTo = "PBRstone";
|
||||
diffuseColor[0] = "0.64 0.64 0.64 1";
|
||||
smoothness[0] = "1";
|
||||
metalness[0] = "1";
|
||||
translucentBlendOp = "None";
|
||||
diffuseMap[0] = "art/shapes/textures/Stone_A.dds";
|
||||
normalMap[0] = "art/shapes/textures/Stone_N.png";
|
||||
roughMap[0] = "art/shapes/textures/Stone_S.dds";
|
||||
metalMap[0] = "art/shapes/textures/Stone_S.dds";
|
||||
roughness0 = "1";
|
||||
materialTag0 = "Miscellaneous";
|
||||
pixelSpecular0 = "0";
|
||||
metalChan[0] = "3";
|
||||
isSRGb[0] = "1";
|
||||
specularPower0 = "0.415939";
|
||||
specular0 = "0.9 0.9 0.9 1";
|
||||
};
|
||||
|
||||
singleton Material(pbrGrid)
|
||||
{
|
||||
mapTo = "PBRGrid";
|
||||
diffuseColor[0] = "1 1 1 1";
|
||||
smoothness[0] = "0";
|
||||
metalness[0] = "0";
|
||||
translucentBlendOp = "LerpAlpha";
|
||||
diffuseMap[0] = "art/shapes/textures/PBRGrid_a.dds";
|
||||
alphaTest = "1";
|
||||
materialTag0 = "Miscellaneous";
|
||||
pixelSpecular0 = "0";
|
||||
doubleSided = "0";
|
||||
alphaRef = "1";
|
||||
diffuseColor[2] = "1 1 1 1";
|
||||
normalMap[0] = "art/shapes/textures/PBRGrid_n.png";
|
||||
specularMap[0] = "art/shapes/textures/PBRGrid_c.dds";
|
||||
};
|
||||
120
Templates/Full/game/art/shapes/textures/pbrGrid.dae
Normal file
BIN
Templates/Full/game/art/shapes/textures/white.dds
Normal file
BIN
Templates/Full/game/art/skies/Sky128Mat/cubemap/skybox_1.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Templates/Full/game/art/skies/Sky128Mat/cubemap/skybox_2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
Templates/Full/game/art/skies/Sky128Mat/cubemap/skybox_3.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
Templates/Full/game/art/skies/Sky128Mat/cubemap/skybox_4.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
Templates/Full/game/art/skies/Sky128Mat/cubemap/skybox_5.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
Templates/Full/game/art/skies/Sky128Mat/cubemap/skybox_6.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
38
Templates/Full/game/art/skies/Sky128Mat/materials.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
singleton CubemapData( Sky128Cubemap )
|
||||
{
|
||||
cubeFace[0] = "./cubemap/skybox_1";
|
||||
cubeFace[1] = "./cubemap/skybox_2";
|
||||
cubeFace[2] = "./cubemap/skybox_3";
|
||||
cubeFace[3] = "./cubemap/skybox_4";
|
||||
cubeFace[4] = "./cubemap/skybox_5";
|
||||
cubeFace[5] = "./cubemap/skybox_6";
|
||||
};
|
||||
|
||||
singleton Material( Sky128Mat )
|
||||
{
|
||||
cubemap = Sky128Cubemap;
|
||||
materialTag0 = "Skies";
|
||||
isSky = true;
|
||||
};
|
||||
|
|
@ -47,10 +47,10 @@ new ShaderData( AL_DeferredShader )
|
|||
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/deferredShadingP.glsl";
|
||||
|
||||
samplerNames[0] = "colorBufferTex";
|
||||
samplerNames[1] = "lightDeferredTex";
|
||||
samplerNames[1] = "directLightingBuffer";
|
||||
samplerNames[2] = "matInfoTex";
|
||||
samplerNames[3] = "deferredTex";
|
||||
|
||||
samplerNames[3] = "indirectLightingBuffer";
|
||||
samplerNames[4] = "deferredTex";
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
|
|
@ -61,9 +61,10 @@ singleton PostEffect( AL_DeferredShading )
|
|||
shader = AL_DeferredShader;
|
||||
stateBlock = AL_DeferredShadingState;
|
||||
texture[0] = "#color";
|
||||
texture[1] = "#lightinfo";
|
||||
texture[1] = "#directLighting";
|
||||
texture[2] = "#matinfo";
|
||||
texture[3] = "#deferred";
|
||||
texture[3] = "#indirectLighting";
|
||||
texture[4] = "#deferred";
|
||||
|
||||
target = "$backBuffer";
|
||||
renderPriority = 10000;
|
||||
|
|
@ -112,37 +113,107 @@ function toggleColorBufferViz( %enable )
|
|||
}
|
||||
}
|
||||
|
||||
new ShaderData( AL_SpecMapShader )
|
||||
//roughness map display (matinfo.b)
|
||||
new ShaderData( AL_RoughMapShader )
|
||||
{
|
||||
DXVertexShaderFile = "shaders/common/postFx/postFxV.hlsl";
|
||||
DXPixelShaderFile = "shaders/common/lighting/advanced/dbgSpecMapVisualizeP.hlsl";
|
||||
DXPixelShaderFile = "shaders/common/lighting/advanced/dbgRoughMapVisualizeP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = "shaders/common/postFx/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/dbgSpecMapVisualizeP.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/dbgRoughMapVisualizeP.glsl";
|
||||
|
||||
samplerNames[0] = "matinfoTex";
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
singleton PostEffect( AL_SpecMapVisualize )
|
||||
singleton PostEffect( AL_RoughMapVisualize )
|
||||
{
|
||||
shader = AL_SpecMapShader;
|
||||
shader = AL_RoughMapShader;
|
||||
stateBlock = AL_DefaultVisualizeState;
|
||||
texture[0] = "#matinfo";
|
||||
target = "$backBuffer";
|
||||
renderPriority = 9999;
|
||||
};
|
||||
|
||||
/// Toggles the visualization of the AL lighting specular power buffer.
|
||||
function toggleSpecMapViz( %enable )
|
||||
function toggleRoughMapViz( %enable )
|
||||
{
|
||||
if ( %enable $= "" )
|
||||
{
|
||||
$AL_SpecMapShaderVar = AL_SpecMapVisualize.isEnabled() ? false : true;
|
||||
AL_SpecMapVisualize.toggle();
|
||||
$AL_RoughMapShaderVar = AL_RoughMapVisualize.isEnabled() ? false : true;
|
||||
AL_RoughMapVisualize.toggle();
|
||||
}
|
||||
else if ( %enable )
|
||||
AL_SpecMapVisualize.enable();
|
||||
AL_RoughMapVisualize.enable();
|
||||
else if ( !%enable )
|
||||
AL_SpecMapVisualize.disable();
|
||||
AL_RoughMapVisualize.disable();
|
||||
}
|
||||
|
||||
//metalness map display (matinfo.a)
|
||||
new ShaderData( AL_MetalMapShader )
|
||||
{
|
||||
DXVertexShaderFile = "shaders/common/postFx/postFxV.hlsl";
|
||||
DXPixelShaderFile = "shaders/common/lighting/advanced/dbgMetalMapVisualizeP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = "shaders/common/postFx/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/dbgMetalMapVisualizeP.glsl";
|
||||
|
||||
samplerNames[0] = "matinfoTex";
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
singleton PostEffect( AL_MetalMapVisualize )
|
||||
{
|
||||
shader = AL_MetalMapShader;
|
||||
stateBlock = AL_DefaultVisualizeState;
|
||||
texture[0] = "#matinfo";
|
||||
target = "$backBuffer";
|
||||
renderPriority = 9999;
|
||||
};
|
||||
|
||||
function toggleMetalMapViz( %enable )
|
||||
{
|
||||
if ( %enable $= "" )
|
||||
{
|
||||
$AL_MetalMapShaderVar = AL_MetalMapVisualize.isEnabled() ? false : true;
|
||||
AL_MetalMapVisualize.toggle();
|
||||
}
|
||||
else if ( %enable )
|
||||
AL_MetalMapVisualize.enable();
|
||||
else if ( !%enable )
|
||||
AL_MetalMapVisualize.disable();
|
||||
}
|
||||
|
||||
//Light map display (indirectLighting)
|
||||
new ShaderData( AL_LightMapShader )
|
||||
{
|
||||
DXVertexShaderFile = "shaders/common/postFx/postFxV.hlsl";
|
||||
DXPixelShaderFile = "shaders/common/lighting/advanced/dbgLightMapVisualizeP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = "shaders/common/postFx/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/dbgLightMapVisualizeP.glsl";
|
||||
|
||||
samplerNames[0] = "indirectLightingBuffer";
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
||||
singleton PostEffect( AL_LightMapVisualize )
|
||||
{
|
||||
shader = AL_LightMapShader;
|
||||
stateBlock = AL_DefaultVisualizeState;
|
||||
texture[0] = "#indirectLighting";
|
||||
target = "$backBuffer";
|
||||
renderPriority = 9999;
|
||||
};
|
||||
|
||||
function toggleLightMapViz( %enable )
|
||||
{
|
||||
if ( %enable $= "" )
|
||||
{
|
||||
$AL_LightMapShaderVar = AL_LightMapVisualize.isEnabled() ? false : true;
|
||||
AL_LightMapVisualize.toggle();
|
||||
}
|
||||
else if ( %enable )
|
||||
AL_LightMapVisualize.enable();
|
||||
else if ( !%enable )
|
||||
AL_LightMapVisualize.disable();
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ new ShaderData( AL_LightColorVisualizeShader )
|
|||
OGLVertexShaderFile = "shaders/common/postFx/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/dbgLightColorVisualizeP.glsl";
|
||||
|
||||
samplerNames[0] = "lightDeferredTex";
|
||||
samplerNames[0] = "directLightingBuffer";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
|
@ -158,7 +158,7 @@ singleton PostEffect( AL_LightColorVisualize )
|
|||
{
|
||||
shader = AL_LightColorVisualizeShader;
|
||||
stateBlock = AL_DefaultVisualizeState;
|
||||
texture[0] = "#lightinfo";
|
||||
texture[0] = "#directLighting";
|
||||
target = "$backBuffer";
|
||||
renderPriority = 9999;
|
||||
};
|
||||
|
|
@ -184,7 +184,7 @@ new ShaderData( AL_LightSpecularVisualizeShader )
|
|||
OGLVertexShaderFile = "shaders/common/postFx/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/dbgLightSpecularVisualizeP.glsl";
|
||||
|
||||
samplerNames[0] = "lightDeferredTex";
|
||||
samplerNames[0] = "directLightingBuffer";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
|
@ -193,7 +193,7 @@ singleton PostEffect( AL_LightSpecularVisualize )
|
|||
{
|
||||
shader = AL_LightSpecularVisualizeShader;
|
||||
stateBlock = AL_DefaultVisualizeState;
|
||||
texture[0] = "#lightinfo";
|
||||
texture[0] = "#directLighting";
|
||||
target = "$backBuffer";
|
||||
renderPriority = 9999;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -86,11 +86,11 @@ new CustomMaterial( AL_VectorLightMaterial )
|
|||
sampler["shadowMap"] = "$dynamiclight";
|
||||
sampler["dynamicShadowMap"] = "$dynamicShadowMap";
|
||||
sampler["ssaoMask"] = "#ssaoMask";
|
||||
sampler["lightBuffer"] = "#lightinfo";
|
||||
sampler["lightBuffer"] = "#indirectLighting";
|
||||
sampler["colorBuffer"] = "#color";
|
||||
sampler["matInfoBuffer"] = "#matinfo";
|
||||
|
||||
target = "lightinfo";
|
||||
target = "directLighting";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
|
@ -163,11 +163,11 @@ new CustomMaterial( AL_PointLightMaterial )
|
|||
sampler["shadowMap"] = "$dynamiclight";
|
||||
sampler["dynamicShadowMap"] = "$dynamicShadowMap";
|
||||
sampler["cookieMap"] = "$dynamiclightmask";
|
||||
sampler["lightBuffer"] = "#lightinfo";
|
||||
sampler["lightBuffer"] = "#indirectLighting";
|
||||
sampler["colorBuffer"] = "#color";
|
||||
sampler["matInfoBuffer"] = "#matinfo";
|
||||
|
||||
target = "lightinfo";
|
||||
target = "directLighting";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
|
@ -202,11 +202,11 @@ new CustomMaterial( AL_SpotLightMaterial )
|
|||
sampler["shadowMap"] = "$dynamiclight";
|
||||
sampler["dynamicShadowMap"] = "$dynamicShadowMap";
|
||||
sampler["cookieMap"] = "$dynamiclightmask";
|
||||
sampler["lightBuffer"] = "#lightinfo";
|
||||
sampler["lightBuffer"] = "#indirectLighting";
|
||||
sampler["colorBuffer"] = "#color";
|
||||
sampler["matInfoBuffer"] = "#matinfo";
|
||||
|
||||
target = "lightinfo";
|
||||
target = "directLighting";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
|
@ -269,7 +269,7 @@ new CustomMaterial( AL_ParticlePointLightMaterial )
|
|||
stateBlock = AL_ConvexLightState;
|
||||
|
||||
sampler["deferredBuffer"] = "#deferred";
|
||||
target = "lightinfo";
|
||||
target = "directLighting";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -171,8 +171,6 @@ singleton ShaderData( HDR_CombineShader )
|
|||
samplerNames[1] = "$luminanceTex";
|
||||
samplerNames[2] = "$bloomTex";
|
||||
samplerNames[3] = "$colorCorrectionTex";
|
||||
|
||||
samplerNames[4] = "deferredTex";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
|
@ -290,13 +288,12 @@ function HDRPostFX::onEnabled( %this )
|
|||
// Set the right global shader define for HDR.
|
||||
if ( %format $= "GFXFormatR10G10B10A2" )
|
||||
addGlobalShaderMacro( "TORQUE_HDR_RGB10" );
|
||||
else if ( %format $= "GFXFormatR16G16B16A16" )
|
||||
addGlobalShaderMacro( "TORQUE_HDR_RGB16" );
|
||||
|
||||
|
||||
echo( "HDR FORMAT: " @ %format );
|
||||
|
||||
// Change the format of the offscreen surface
|
||||
// to an HDR compatible format.
|
||||
%this.previousFormat = AL_FormatToken.format;
|
||||
AL_FormatToken.format = %format;
|
||||
setReflectFormat( %format );
|
||||
|
||||
|
|
@ -314,13 +311,12 @@ function HDRPostFX::onDisabled( %this )
|
|||
GammaPostFX.enable();
|
||||
|
||||
// Restore the non-HDR offscreen surface format.
|
||||
%format = getBestHDRFormat();
|
||||
%format = %this.previousFormat;
|
||||
AL_FormatToken.format = %format;
|
||||
setReflectFormat( %format );
|
||||
|
||||
removeGlobalShaderMacro( "TORQUE_HDR_RGB10" );
|
||||
removeGlobalShaderMacro( "TORQUE_HDR_RGB16" );
|
||||
|
||||
|
||||
// Reset the light manager which will ensure the new
|
||||
// hdr encoding takes effect in all the shaders.
|
||||
resetLightManager();
|
||||
|
|
|
|||
|
|
@ -136,5 +136,18 @@ singleton ShaderData( VolumetricFogReflectionShader )
|
|||
OGLVertexShaderFile = "shaders/common/VolumetricFog/gl/VFogPreV.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/VolumetricFog/gl/VFogRefl.glsl";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
||||
singleton ShaderData( CubemapSaveShader )
|
||||
{
|
||||
DXVertexShaderFile = "shaders/common/cubemapSaveV.hlsl";
|
||||
DXPixelShaderFile = "shaders/common/cubemapSaveP.hlsl";
|
||||
|
||||
OGLVertexShaderFile = "shaders/common/gl/cubemapSaveV.glsl";
|
||||
OGLPixelShaderFile = "shaders/common/gl/cubemapSaveP.glsl";
|
||||
|
||||
samplerNames[0] = "$cubemapTex";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
276
Templates/Full/game/levels/AProbeTest.mis
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
new SimGroup(MissionGroup) {
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
cdTrack = "2";
|
||||
CTF_scoreLimit = "5";
|
||||
enabled = "1";
|
||||
musicTrack = "lush";
|
||||
|
||||
new LevelInfo(theLevelInfo) {
|
||||
nearClip = "0.1";
|
||||
visibleDistance = "1000";
|
||||
visibleGhostDistance = "0";
|
||||
decalBias = "0.0015";
|
||||
fogColor = "0.6 0.6 0.7 1";
|
||||
fogDensity = "0";
|
||||
fogDensityOffset = "700";
|
||||
fogAtmosphereHeight = "0";
|
||||
canvasClearColor = "0 0 0 255";
|
||||
ambientLightBlendPhase = "1";
|
||||
ambientLightBlendCurve = "0 0 -1 -1";
|
||||
soundAmbience = "AudioAmbienceDefault";
|
||||
soundDistanceModel = "Linear";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
desc0 = "A blank level for testing reflection probes";
|
||||
enabled = "1";
|
||||
levelName = "A Probe Test";
|
||||
};
|
||||
new SkyBox(theSky) {
|
||||
Material = "DesertSkyMat";
|
||||
drawBottom = "0";
|
||||
fogBandHeight = "0";
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new Sun(theSun) {
|
||||
azimuth = "290";
|
||||
elevation = "50";
|
||||
color = "1 1 1 1";
|
||||
ambient = "0.473532 0.473532 0.473532 1";
|
||||
brightness = "1";
|
||||
castShadows = "1";
|
||||
staticRefreshFreq = "250";
|
||||
dynamicRefreshFreq = "8";
|
||||
coronaEnabled = "1";
|
||||
coronaScale = "0.5";
|
||||
coronaTint = "1 1 1 1";
|
||||
coronaUseLightColor = "1";
|
||||
flareScale = "1";
|
||||
attenuationRatio = "0 1 1";
|
||||
shadowType = "PSSM";
|
||||
texSize = "1024";
|
||||
overDarkFactor = "3000 1500 750 250";
|
||||
shadowDistance = "100";
|
||||
shadowSoftness = "0.25";
|
||||
numSplits = "4";
|
||||
logWeight = "0.9";
|
||||
fadeStartDistance = "0";
|
||||
lastSplitTerrainOnly = "0";
|
||||
representedInLightmap = "0";
|
||||
shadowDarkenColor = "0 0 0 -1";
|
||||
includeLightmappedGeometryInShadow = "0";
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
bias = "0.1";
|
||||
Blur = "1";
|
||||
enabled = "1";
|
||||
height = "1024";
|
||||
lightBleedFactor = "0.8";
|
||||
minVariance = "0";
|
||||
pointShadowType = "PointShadowType_Paraboloid";
|
||||
shadowBox = "-100 -100 -100 100 100 100";
|
||||
splitFadeDistances = "1 1 1 1";
|
||||
width = "3072";
|
||||
};
|
||||
new SimGroup(PlayerDropPoints) {
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
|
||||
new SpawnSphere() {
|
||||
autoSpawn = "0";
|
||||
spawnTransform = "0";
|
||||
radius = "5";
|
||||
sphereWeight = "1";
|
||||
indoorWeight = "1";
|
||||
outdoorWeight = "1";
|
||||
isAIControlled = "0";
|
||||
dataBlock = "SpawnSphereMarker";
|
||||
position = "0 0 2";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
hidden = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
homingCount = "0";
|
||||
lockCount = "0";
|
||||
};
|
||||
};
|
||||
new GroundPlane() {
|
||||
squareSize = "128";
|
||||
scaleU = "25";
|
||||
scaleV = "25";
|
||||
Material = "Grid512_Grey_Mat";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
};
|
||||
new ReflectionProbe() {
|
||||
enabled = "1";
|
||||
ProbeShape = "Sphere";
|
||||
radius = "10";
|
||||
Intensity = "1";
|
||||
IndirectLightMode = "Ambient Color";
|
||||
IndirectLight = "1 1 1 1";
|
||||
ReflectionMode = "Baked Cubemap";
|
||||
reflectionPath = "levels/probeTest/probes/";
|
||||
Bake = "0";
|
||||
position = "0 0.559989 4.53387";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "5 5 5";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
persistentId = "8072e1be-2846-11e7-9f56-abd46b190c60";
|
||||
GroundColor = "0.8 0.7 0.5 1";
|
||||
SkyColor = "0.5 0.5 1 1";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_Orange_Mat";
|
||||
position = "0.487092 0.454657 9.4951";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "10 10 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 0 0 0.5";
|
||||
surface = "0 1 0 0 0 0 -0.5";
|
||||
surface = "0.707107 0 0 0.707107 0 0.5 0";
|
||||
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
|
||||
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
|
||||
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_Red_Mat";
|
||||
position = "0.470302 5.50317 5";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "10 1 10";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 0 0 0.5";
|
||||
surface = "0 1 0 0 0 0 -0.5";
|
||||
surface = "0.707107 0 0 0.707107 0 0.5 0";
|
||||
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
|
||||
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
|
||||
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_Green_Mat";
|
||||
position = "5.02238 0.0512025 5";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 10 10";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 0 0 0.5";
|
||||
surface = "0 1 0 0 0 0 -0.5";
|
||||
surface = "0.707107 0 0 0.707106 0 0.5 0";
|
||||
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
|
||||
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
|
||||
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_Grey_Mat";
|
||||
position = "0.631523 -1.77695 1.00151";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "2 2 2";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 0 0 0.5";
|
||||
surface = "0 1 0 0 0 0 -0.5";
|
||||
surface = "0.707107 0 0 0.707106 0 0.5 0";
|
||||
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
|
||||
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
|
||||
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_Blue_Mat";
|
||||
position = "0.470302 -5.04199 5";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "10 1 10";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 0 0 0.5";
|
||||
surface = "0 1 0 0 0 0 -0.5";
|
||||
surface = "0.707107 0 0 0.707106 0 0.5 0";
|
||||
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
|
||||
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
|
||||
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_Grey_Mat";
|
||||
position = "2.62512 2.62766 2.00332";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "2 2 4";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 0 0 0.5";
|
||||
surface = "0 1 0 0 0 0 -0.5";
|
||||
surface = "0.707107 0 0 0.707107 0 0.5 0";
|
||||
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
|
||||
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
|
||||
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_Grey_Mat";
|
||||
position = "0.487092 0.454657 -0.477887";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "10 10 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 0 0 0.5";
|
||||
surface = "0 1 0 0 0 0 -0.5";
|
||||
surface = "0.707107 0 0 0.707106 0 0.5 0";
|
||||
surface = "0 0.707107 -0.707107 0 0 -0.5 -2.84217e-14";
|
||||
surface = "0.5 0.5 -0.5 0.5 -0.5 0 -9.93411e-08";
|
||||
surface = "0.5 -0.5 0.5 0.5 0.5 0 -9.93411e-08";
|
||||
};
|
||||
new PointLight() {
|
||||
radius = "10";
|
||||
isEnabled = "1";
|
||||
color = "0.887923 1 0.008023 1";
|
||||
brightness = "1";
|
||||
castShadows = "0";
|
||||
staticRefreshFreq = "250";
|
||||
dynamicRefreshFreq = "8";
|
||||
priority = "1";
|
||||
animate = "1";
|
||||
animationPeriod = "1";
|
||||
animationPhase = "1";
|
||||
flareScale = "1";
|
||||
attenuationRatio = "0 1 1";
|
||||
shadowType = "DualParaboloidSinglePass";
|
||||
texSize = "512";
|
||||
overDarkFactor = "2000 1000 500 100";
|
||||
shadowDistance = "400";
|
||||
shadowSoftness = "0.15";
|
||||
numSplits = "1";
|
||||
logWeight = "0.91";
|
||||
fadeStartDistance = "0";
|
||||
lastSplitTerrainOnly = "0";
|
||||
representedInLightmap = "0";
|
||||
shadowDarkenColor = "0 0 0 -1";
|
||||
includeLightmappedGeometryInShadow = "0";
|
||||
position = "0 0.555882 4.56352";
|
||||
rotation = "1 0 0 0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -1,90 +1,334 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
new SimGroup(MissionGroup) {
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
|
||||
new LevelInfo(theLevelInfo) {
|
||||
nearClip = "0.1";
|
||||
visibleDistance = "2000";
|
||||
visibleGhostDistance = "0";
|
||||
decalBias = "0.0015";
|
||||
fogColor = "1 1 0.6 1";
|
||||
fogDensity = "0.001";
|
||||
fogDensityOffset = "10";
|
||||
fogAtmosphereHeight = "100";
|
||||
canvasClearColor = "233 220 143 255";
|
||||
advancedLightmapSupport = "0";
|
||||
desc0 = "An empty terrain ready to be populated with Torque objects.";
|
||||
LevelName = "Empty Terrain";
|
||||
};
|
||||
new ScatterSky() {
|
||||
skyBrightness = "30";
|
||||
mieScattering = "0.0015";
|
||||
rayleighScattering = "0.0035";
|
||||
sunScale = "1 1 0.8 1";
|
||||
ambientScale = "0.5 0.5 0.4 1";
|
||||
exposure = "0.85";
|
||||
azimuth = "84";
|
||||
elevation = "54";
|
||||
castShadows = "1";
|
||||
brightness = "1";
|
||||
flareType = "SunFlareExample1";
|
||||
flareScale = "1";
|
||||
nightColor = "0.0196078 0.0117647 0.109804 1";
|
||||
moonEnabled = "1";
|
||||
moonTexture = "core/art/skies/night/moon_wglow";
|
||||
moonScale = "0.3";
|
||||
moonTint = "0.192157 0.192157 0.192157 1";
|
||||
useNightCubemap = "0";
|
||||
attenuationRatio = "0 1 1";
|
||||
shadowType = "PSSM";
|
||||
texSize = "1024";
|
||||
overDarkFactor = "3000 2000 1000 250";
|
||||
shadowDistance = "400";
|
||||
shadowSoftness = "0.25";
|
||||
numSplits = "4";
|
||||
logWeight = "0.96";
|
||||
fadeStartDistance = "325";
|
||||
lastSplitTerrainOnly = "0";
|
||||
representedInLightmap = "0";
|
||||
shadowDarkenColor = "0 0 0 -1";
|
||||
includeLightmappedGeometryInShadow = "0";
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canvasClearColor = "0 0 0 255";
|
||||
ambientLightBlendPhase = "1";
|
||||
ambientLightBlendCurve = "0 0 -1 -1";
|
||||
LevelEnvMap = "DesertSkyCubemap";
|
||||
soundAmbience = "AudioAmbienceDefault";
|
||||
soundDistanceModel = "Linear";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
sunBrightness = "50";
|
||||
advancedLightmapSupport = "1";
|
||||
desc0 = "An empty terrain ready to be populated with Torque objects.";
|
||||
levelName = "Empty Terrain";
|
||||
};
|
||||
new TerrainBlock(theTerrain) {
|
||||
terrainFile = "art/terrains/Empty Terrain_0.ter";
|
||||
castShadows = "1";
|
||||
squareSize = "2";
|
||||
tile = "0";
|
||||
baseTexSize = "1024";
|
||||
baseTexFormat = "DDS";
|
||||
lightMapSize = "256";
|
||||
screenError = "16";
|
||||
position = "-1024 -1024 179.978";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new SimGroup(PlayerDropPoints) {
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
|
||||
new SpawnSphere() {
|
||||
autoSpawn = "0";
|
||||
spawnTransform = "0";
|
||||
radius = "1";
|
||||
sphereWeight = "1";
|
||||
indoorWeight = "1";
|
||||
outdoorWeight = "1";
|
||||
isAIControlled = "0";
|
||||
dataBlock = "SpawnSphereMarker";
|
||||
position = "0 0 241.772";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
enabled = "1";
|
||||
homingCount = "0";
|
||||
lockCount = "0";
|
||||
TypeBool locked = "False";
|
||||
};
|
||||
};
|
||||
new TSStatic() {
|
||||
shapeName = "art/shapes/cube/cube.dae";
|
||||
playAmbient = "1";
|
||||
meshCulling = "0";
|
||||
originSort = "0";
|
||||
collisionType = "Collision Mesh";
|
||||
decalType = "Collision Mesh";
|
||||
allowPlayerStep = "1";
|
||||
alphaFadeEnable = "0";
|
||||
alphaFadeStart = "100";
|
||||
alphaFadeEnd = "150";
|
||||
alphaFadeInverse = "0";
|
||||
renderNormals = "0";
|
||||
forceDetail = "-1";
|
||||
position = "9.42739 27.7428 241.767";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new Sun() {
|
||||
azimuth = "0";
|
||||
elevation = "35";
|
||||
color = "0.8 0.8 0.8 1";
|
||||
ambient = "0.2 0.2 0.2 1";
|
||||
brightness = "1";
|
||||
castShadows = "1";
|
||||
staticRefreshFreq = "250";
|
||||
dynamicRefreshFreq = "8";
|
||||
coronaEnabled = "1";
|
||||
coronaMaterial = "Corona_Mat";
|
||||
coronaScale = "0.5";
|
||||
coronaTint = "1 1 1 1";
|
||||
coronaUseLightColor = "1";
|
||||
flareType = "SunFlareExample";
|
||||
flareScale = "1";
|
||||
attenuationRatio = "0 1 1";
|
||||
shadowType = "PSSM";
|
||||
texSize = "1024";
|
||||
overDarkFactor = "2000 1000 500 100";
|
||||
shadowDistance = "400";
|
||||
shadowSoftness = "0.15";
|
||||
numSplits = "4";
|
||||
logWeight = "0.91";
|
||||
fadeStartDistance = "0";
|
||||
lastSplitTerrainOnly = "0";
|
||||
representedInLightmap = "0";
|
||||
shadowDarkenColor = "0 0 0 -1";
|
||||
includeLightmappedGeometryInShadow = "0";
|
||||
position = "-79.7465 2.70386 456.287";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
Direction = "1 1 -1";
|
||||
};
|
||||
new SkyBox() {
|
||||
Material = "DesertSkyMat";
|
||||
drawBottom = "1";
|
||||
fogBandHeight = "0";
|
||||
position = "-79.7465 2.70386 456.287";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new TSStatic() {
|
||||
shapeName = "art/shapes/textures/PBRTEST.dae";
|
||||
playAmbient = "1";
|
||||
meshCulling = "0";
|
||||
originSort = "0";
|
||||
collisionType = "Collision Mesh";
|
||||
decalType = "Collision Mesh";
|
||||
allowPlayerStep = "1";
|
||||
alphaFadeEnable = "0";
|
||||
alphaFadeStart = "100";
|
||||
alphaFadeEnd = "150";
|
||||
alphaFadeInverse = "0";
|
||||
renderNormals = "0";
|
||||
forceDetail = "-1";
|
||||
position = "17.8995 16.1596 241.136";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new ConvexShape() {
|
||||
Material = "Grid512_OrangeLines_Mat";
|
||||
position = "8.58057 11.6688 239.583";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
surface = "0 0 0 1 1.29457 -0.42643 0.5";
|
||||
surface = "0 1 0 0 1.29457 -0.42643 -0.5";
|
||||
surface = "0.707107 0 0 0.707107 1.29457 5.75621 0";
|
||||
surface = "0 0.707107 -0.707107 0 1.29457 -6.60907 -4.54747e-013";
|
||||
surface = "0.5 0.5 -0.5 0.5 -3.35148 -0.42643 -1.28542e-008";
|
||||
surface = "0.5 -0.5 0.5 0.5 5.94063 -0.42643 -1.28542e-008";
|
||||
};
|
||||
new EnvVolume() {
|
||||
AreaEnvMap = "MipCubemap";
|
||||
cubeReflectorDesc = "DefaultCubeDesc";
|
||||
position = "8.21068 19.3464 241.855";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "10 10 10";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new TSStatic() {
|
||||
shapeName = "art/shapes/textures/PBRTEST2.dae";
|
||||
playAmbient = "1";
|
||||
meshCulling = "0";
|
||||
originSort = "0";
|
||||
collisionType = "Collision Mesh";
|
||||
decalType = "Collision Mesh";
|
||||
allowPlayerStep = "1";
|
||||
alphaFadeEnable = "0";
|
||||
alphaFadeStart = "100";
|
||||
alphaFadeEnd = "150";
|
||||
alphaFadeInverse = "0";
|
||||
renderNormals = "0";
|
||||
forceDetail = "-1";
|
||||
position = "5.60579 18.8689 241.462";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new TSStatic() {
|
||||
shapeName = "art/shapes/textures/PBRTEST2.dae";
|
||||
playAmbient = "1";
|
||||
meshCulling = "0";
|
||||
originSort = "0";
|
||||
cubeReflectorDesc = "DefaultCubeDesc";
|
||||
collisionType = "Collision Mesh";
|
||||
decalType = "Collision Mesh";
|
||||
allowPlayerStep = "1";
|
||||
alphaFadeEnable = "0";
|
||||
alphaFadeStart = "100";
|
||||
alphaFadeEnd = "150";
|
||||
alphaFadeInverse = "0";
|
||||
renderNormals = "0";
|
||||
forceDetail = "-1";
|
||||
position = "22.1653 4.41543 241.364";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new TSStatic() {
|
||||
shapeName = "art/shapes/textures/PBRTEST2.dae";
|
||||
playAmbient = "1";
|
||||
meshCulling = "0";
|
||||
originSort = "0";
|
||||
collisionType = "Collision Mesh";
|
||||
decalType = "Collision Mesh";
|
||||
allowPlayerStep = "1";
|
||||
alphaFadeEnable = "0";
|
||||
alphaFadeStart = "100";
|
||||
alphaFadeEnd = "150";
|
||||
alphaFadeInverse = "0";
|
||||
renderNormals = "0";
|
||||
forceDetail = "-1";
|
||||
position = "15.72 5.9186 241.191";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new AccumulationVolume() {
|
||||
texture = "art/terrains/Example/sand.png";
|
||||
position = "8.14797 -1.59717 242.2";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "10 10 10";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new TSStatic() {
|
||||
shapeName = "art/shapes/rocks/rock1.dts";
|
||||
playAmbient = "1";
|
||||
meshCulling = "0";
|
||||
originSort = "0";
|
||||
collisionType = "Collision Mesh";
|
||||
decalType = "Collision Mesh";
|
||||
allowPlayerStep = "0";
|
||||
alphaFadeEnable = "0";
|
||||
alphaFadeStart = "100";
|
||||
alphaFadeEnd = "150";
|
||||
alphaFadeInverse = "0";
|
||||
renderNormals = "0";
|
||||
forceDetail = "-1";
|
||||
position = "12.8895 -2.18239 238.765";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new TSStatic() {
|
||||
shapeName = "art/shapes/textures/pbrGrid.dae";
|
||||
playAmbient = "1";
|
||||
meshCulling = "0";
|
||||
originSort = "0";
|
||||
collisionType = "Collision Mesh";
|
||||
decalType = "Collision Mesh";
|
||||
allowPlayerStep = "0";
|
||||
alphaFadeEnable = "0";
|
||||
alphaFadeStart = "100";
|
||||
alphaFadeEnd = "150";
|
||||
alphaFadeInverse = "0";
|
||||
renderNormals = "0";
|
||||
forceDetail = "-1";
|
||||
position = "10.406 10.0939 240.551";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
new SimGroup(CameraBookmarks) {
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
new CameraBookmark() {
|
||||
isAIControlled = "0";
|
||||
dataBlock = "CameraBookmarkMarker";
|
||||
position = "8.56947 28.7013 241.524";
|
||||
rotation = "-0.0952424 0.313705 0.944732 147.992";
|
||||
scale = "1 1 1";
|
||||
internalName = "NewCamera_0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
};
|
||||
new ReflectionProbe() {
|
||||
enabled = "1";
|
||||
ProbeShape = "Sphere";
|
||||
radius = "10";
|
||||
Intensity = "1";
|
||||
IndirectLightMode = "Ambient Color";
|
||||
IndirectLight = "1 1 1 1";
|
||||
ReflectionMode = "Baked Cubemap";
|
||||
reflectionPath = "levels/empty terrain/";
|
||||
Bake = "0";
|
||||
position = "15.1652 14.4709 242.142";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "5 5 5";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
persistentId = "fc28816f-65a6-11e7-b9a1-b6f5317ad553";
|
||||
};
|
||||
new ReflectionProbe() {
|
||||
enabled = "1";
|
||||
ProbeShape = "Sphere";
|
||||
radius = "10";
|
||||
Intensity = "1";
|
||||
IndirectLightMode = "Ambient Color";
|
||||
IndirectLight = "1 1 1 1";
|
||||
ReflectionMode = "Baked Cubemap";
|
||||
reflectionPath = "levels/empty terrain/";
|
||||
Bake = "0";
|
||||
position = "9.87758 12.8131 242.142";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "5 5 5";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
persistentId = "10bb5f41-65a7-11e7-b9a1-b6f5317ad553";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
|
|||
|
|
@ -49,7 +49,10 @@ function createCanvas(%windowTitle)
|
|||
|
||||
// Set the window title
|
||||
if (isObject(Canvas))
|
||||
Canvas.setWindowTitle(getEngineName() @ " - " @ $appName);
|
||||
{
|
||||
%renderer = GFXCardProfilerAPI::getRenderer();
|
||||
Canvas.setWindowTitle(getEngineName() @ " - " @ $appName @ " - " @ %renderer);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
63
Templates/Full/game/shaders/common/cubemapSaveP.hlsl
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2016 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 "shaderModel.hlsl"
|
||||
|
||||
struct Conn
|
||||
{
|
||||
float4 hpos : TORQUE_POSITION;
|
||||
float3 face_pos_x : TEXCOORD0;
|
||||
float3 face_neg_x : TEXCOORD1;
|
||||
float3 face_pos_y : TEXCOORD2;
|
||||
float3 face_neg_y : TEXCOORD3;
|
||||
float3 face_pos_z : TEXCOORD4;
|
||||
float3 face_neg_z : TEXCOORD5;
|
||||
};
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 target0 : TORQUE_TARGET0;
|
||||
float4 target1 : TORQUE_TARGET1;
|
||||
float4 target2 : TORQUE_TARGET2;
|
||||
float4 target3 : TORQUE_TARGET3;
|
||||
float4 target4 : TORQUE_TARGET4;
|
||||
float4 target5 : TORQUE_TARGET5;
|
||||
};
|
||||
|
||||
TORQUE_UNIFORM_SAMPLERCUBE(cubemapTex, 0);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main(Conn In)
|
||||
{
|
||||
Fragout Out;
|
||||
|
||||
Out.target0 = TORQUE_TEXCUBE(cubemapTex, In.face_pos_x);
|
||||
Out.target1 = TORQUE_TEXCUBE(cubemapTex, In.face_neg_x);
|
||||
Out.target2 = TORQUE_TEXCUBE(cubemapTex, In.face_pos_y);
|
||||
Out.target3 = TORQUE_TEXCUBE(cubemapTex, In.face_neg_y);
|
||||
Out.target4 = TORQUE_TEXCUBE(cubemapTex, In.face_pos_z);
|
||||
Out.target5 = TORQUE_TEXCUBE(cubemapTex, In.face_neg_z);
|
||||
|
||||
return Out;
|
||||
}
|
||||
56
Templates/Full/game/shaders/common/cubemapSaveV.hlsl
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2016 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 "shaderModel.hlsl"
|
||||
|
||||
struct Conn
|
||||
{
|
||||
float4 hpos : TORQUE_POSITION;
|
||||
float3 face_pos_x : TEXCOORD0;
|
||||
float3 face_neg_x : TEXCOORD1;
|
||||
float3 face_pos_y : TEXCOORD2;
|
||||
float3 face_neg_y : TEXCOORD3;
|
||||
float3 face_pos_z : TEXCOORD4;
|
||||
float3 face_neg_z : TEXCOORD5;
|
||||
};
|
||||
|
||||
uniform float4x4 matrix0;
|
||||
uniform float4x4 matrix1;
|
||||
uniform float4x4 matrix2;
|
||||
uniform float4x4 matrix3;
|
||||
uniform float4x4 matrix4;
|
||||
uniform float4x4 matrix5;
|
||||
|
||||
Conn main(uint id: SV_VertexID)
|
||||
{
|
||||
Conn Out;
|
||||
float4 vertex = float4(float2((id << 1) & 2, id & 2) * float2(2, -2) + float2(-1, 1), 0, 1);
|
||||
Out.hpos = vertex;
|
||||
Out.face_pos_x = mul(matrix0, vertex).xyz;
|
||||
Out.face_neg_x = mul(matrix1, vertex).xyz;
|
||||
Out.face_pos_y = mul(matrix2, vertex).xyz;
|
||||
Out.face_neg_y = mul(matrix3, vertex).xyz;
|
||||
Out.face_pos_z = mul(matrix4, vertex).xyz;
|
||||
Out.face_neg_z = mul(matrix5, vertex).xyz;
|
||||
|
||||
return Out;
|
||||
}
|
||||
52
Templates/Full/game/shaders/common/gl/cubemapSaveP.glsl
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2016 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 "hlslCompat.glsl"
|
||||
#include "torque.glsl"
|
||||
|
||||
uniform samplerCube cubemapTex;
|
||||
|
||||
in float3 face_pos_x;
|
||||
in float3 face_neg_x;
|
||||
in float3 face_pos_y;
|
||||
in float3 face_neg_y;
|
||||
in float3 face_pos_z;
|
||||
in float3 face_neg_z;
|
||||
|
||||
out float4 target0;
|
||||
out float4 target1;
|
||||
out float4 target2;
|
||||
out float4 target3;
|
||||
out float4 target4;
|
||||
out float4 target5;
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
void main()
|
||||
{
|
||||
target0 = texture(cubemapTex, face_pos_x);
|
||||
target1 = texture(cubemapTex, face_neg_x);
|
||||
target2 = texture(cubemapTex, face_pos_y);
|
||||
target3 = texture(cubemapTex, face_neg_y);
|
||||
target4 = texture(cubemapTex, face_pos_z);
|
||||
target5 = texture(cubemapTex, face_neg_z);
|
||||
}
|
||||
51
Templates/Full/game/shaders/common/gl/cubemapSaveV.glsl
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2016 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 "hlslCompat.glsl"
|
||||
#include "torque.glsl"
|
||||
|
||||
uniform float4x4 matrix0;
|
||||
uniform float4x4 matrix1;
|
||||
uniform float4x4 matrix2;
|
||||
uniform float4x4 matrix3;
|
||||
uniform float4x4 matrix4;
|
||||
uniform float4x4 matrix5;
|
||||
|
||||
out float3 face_pos_x;
|
||||
out float3 face_neg_x;
|
||||
out float3 face_pos_y;
|
||||
out float3 face_neg_y;
|
||||
out float3 face_pos_z;
|
||||
out float3 face_neg_z;
|
||||
|
||||
void main()
|
||||
{
|
||||
float4 vertex = float4(float2((gl_VertexID << 1) & 2, gl_VertexID & 2) * float2(2, -2) + float2(-1, 1), 0, 1);
|
||||
gl_Position = vertex;
|
||||
correctSSP(gl_Position);
|
||||
face_pos_x = tMul(matrix0, vertex).xyz;
|
||||
face_neg_x = tMul(matrix1, vertex).xyz;
|
||||
face_pos_y = tMul(matrix2, vertex).xyz;
|
||||
face_neg_y = tMul(matrix3, vertex).xyz;
|
||||
face_pos_z = tMul(matrix4, vertex).xyz;
|
||||
face_neg_z = tMul(matrix5, vertex).xyz;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Portions Copyright Zefiros
|
||||
// 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
|
||||
|
|
@ -38,12 +38,140 @@ uniform float4 inLightColor[4];
|
|||
|
||||
uniform float4 ambient;
|
||||
#define ambientCameraFactor 0.3
|
||||
uniform float specularPower;
|
||||
uniform float4 specularColor;
|
||||
uniform float smoothness;
|
||||
uniform float metalness;
|
||||
uniform float4 albedo;
|
||||
|
||||
#endif // !TORQUE_SHADERGEN
|
||||
|
||||
|
||||
float3 F_schlick( in float3 f0, in float3 f90, in float u )
|
||||
{
|
||||
//
|
||||
// F( v, h ) = F0 + ( 1.0 - F0 ) * pow( 1.0f - HdotV, 5.0f )
|
||||
//
|
||||
//
|
||||
// where
|
||||
//
|
||||
// F0 = BaseColor * nDotL
|
||||
//
|
||||
// Dielectric materials always have a range of 0.02 < F0 < 0.05 , use a stock value of 0.04 ( roughly plastics )
|
||||
//
|
||||
|
||||
return f0 + ( f90 - f0 ) * pow( 1.0f - u , 5.0f );
|
||||
}
|
||||
|
||||
float Fr_DisneyDiffuse ( float NdotV , float NdotL , float LdotH , float linearRoughness )
|
||||
{
|
||||
float energyBias = lerp (0 , 0.5 , linearRoughness );
|
||||
float energyFactor = lerp (1.0 , 1.0 / 1.51 , linearRoughness );
|
||||
float fd90 = energyBias + 2.0 * LdotH * LdotH * linearRoughness ;
|
||||
float3 f0 = float3 ( 1.0f , 1.0f , 1.0f );
|
||||
float lightScatter = F_schlick( f0 , fd90 , NdotL ).r;
|
||||
float viewScatter = F_schlick(f0 , fd90 , NdotV ).r;
|
||||
|
||||
return lightScatter * viewScatter * energyFactor ;
|
||||
}
|
||||
|
||||
float SmithGGX( float NdotL, float NdotV, float alpha )
|
||||
{
|
||||
//
|
||||
// G( L, V, h ) = G( L ) G( V )
|
||||
//
|
||||
// nDotL
|
||||
// G( L ) = _________________________
|
||||
// nDotL ( 1 - k ) + k
|
||||
//
|
||||
//
|
||||
// NdotV
|
||||
// G( V ) = _________________________
|
||||
// NdotV ( 1 - k ) + k
|
||||
//
|
||||
//
|
||||
// pow( ( Roughness + 1 ), 2)
|
||||
// , Where k = __________________________ ( unreal 4 )
|
||||
// 8
|
||||
//
|
||||
|
||||
float alphaSqr = alpha * alpha;
|
||||
|
||||
//float GGX_V = NdotL * sqrt ( ( - NdotV * alphaSqr + NdotV ) * NdotV + alphaSqr );
|
||||
//float GGX_L = NdotV * sqrt ( ( - NdotL * alphaSqr + NdotL ) * NdotL + alphaSqr );
|
||||
|
||||
float GGX_V = NdotL + sqrt ( ( - NdotV * alphaSqr + NdotV ) * NdotV + alphaSqr );
|
||||
float GGX_L = NdotV + sqrt ( ( - NdotL * alphaSqr + NdotL ) * NdotL + alphaSqr );
|
||||
|
||||
return rcp( GGX_V + GGX_L );
|
||||
//return 0.5f / ( GGX_V + GGX_L );
|
||||
}
|
||||
|
||||
float D_GGX( float NdotH , float alpha )
|
||||
{
|
||||
//
|
||||
// or GGX ( disney / unreal 4 )
|
||||
//
|
||||
// alpha = pow( roughness, 2 );
|
||||
//
|
||||
// pow( alpha, 2 )
|
||||
// D( h ) = ________________________________________________________________
|
||||
// PI pow( pow( NdotH , 2 ) ( pow( alpha, 2 ) - 1 ) + 1 ), 2 )
|
||||
//
|
||||
|
||||
float alphaSqr = alpha*alpha;
|
||||
float f = ( NdotH * alphaSqr - NdotH ) * NdotH + 1;
|
||||
return alphaSqr / ( M_PI_F * (f * f) );
|
||||
}
|
||||
|
||||
float4 EvalBDRF( float3 baseColor, float3 lightColor, float3 toLight, float3 position, float3 normal, float roughness, float metallic )
|
||||
{
|
||||
//
|
||||
// Microfacet Specular Cook-Torrance
|
||||
//
|
||||
// D( h ) F( v, h ) G( l, v, h )
|
||||
// f( l, v ) = ____________________________
|
||||
// 4 ( dot( n, l ) dot( n, v )
|
||||
//
|
||||
//
|
||||
|
||||
float3 L = normalize( toLight );
|
||||
float3 V = normalize( -position );
|
||||
float3 H = normalize( L + V );
|
||||
float3 N = normal;
|
||||
|
||||
float NdotV = abs( dot( N, V ) ) + 1e-5f;
|
||||
float NdotH = saturate( dot( N, H ) );
|
||||
float NdotL = saturate( dot( N, L ) );
|
||||
float LdotH = saturate( dot( L, H ) );
|
||||
|
||||
float VdotH = saturate( dot( V, H ) );
|
||||
|
||||
if ( NdotL == 0 )
|
||||
return float4( 0.0f, 0.0f, 0.0f, 0.0f );
|
||||
|
||||
float alpha = roughness;
|
||||
float visLinAlpha = alpha * alpha;
|
||||
|
||||
float3 f0 = baseColor;
|
||||
float metal = metallic;
|
||||
|
||||
float3 F_conductor= F_schlick( f0, float3( 1.0, 1.0, 1.0 ), VdotH );
|
||||
float3 F_dielec = F_schlick( float3( 0.04, 0.04, 0.04 ), float3( 1.0, 1.0, 1.0 ), VdotH );
|
||||
float Vis = SmithGGX( NdotL, NdotV, visLinAlpha );
|
||||
float D = D_GGX( NdotH, visLinAlpha );
|
||||
|
||||
float3 Fr_dielec = D * F_dielec * Vis;
|
||||
float3 Fr_conductor = D * F_conductor * Vis;
|
||||
|
||||
float3 Fd = Fr_DisneyDiffuse( NdotV , NdotL , LdotH , visLinAlpha ) / M_PI_F ;
|
||||
float3 specular = ( 1.0f - metal ) * Fr_dielec + metal * Fr_conductor;
|
||||
float3 diffuse = ( 1.0f - metal ) * Fd * f0;
|
||||
|
||||
float3 ret = ( diffuse + specular + lightColor) * NdotL;
|
||||
|
||||
float FR = saturate(length(specular));
|
||||
return float4(ret,FR);
|
||||
}
|
||||
|
||||
void compute4Lights( float3 wsView,
|
||||
float3 wsPosition,
|
||||
float3 wsNormal,
|
||||
|
|
@ -57,8 +185,9 @@ void compute4Lights( float3 wsView,
|
|||
float4 inLightSpotDir[3],
|
||||
float4 inLightSpotAngle,
|
||||
float4 inLightSpotFalloff,
|
||||
float specularPower,
|
||||
float4 specularColor,
|
||||
float smoothness,
|
||||
float metalness,
|
||||
float4 albedo,
|
||||
|
||||
#endif // TORQUE_SHADERGEN
|
||||
|
||||
|
|
@ -81,10 +210,6 @@ void compute4Lights( float3 wsView,
|
|||
for ( i = 0; i < 3; i++ )
|
||||
lightVectors[i] = wsPosition[i] - inLightPos[i];
|
||||
|
||||
float4 squareDists = 0;
|
||||
for ( i = 0; i < 3; i++ )
|
||||
squareDists += lightVectors[i] * lightVectors[i];
|
||||
|
||||
// Accumulate the dot product between the light
|
||||
// vector and the normal.
|
||||
//
|
||||
|
|
@ -100,39 +225,11 @@ void compute4Lights( float3 wsView,
|
|||
for ( i = 0; i < 3; i++ )
|
||||
nDotL += lightVectors[i] * -wsNormal[i];
|
||||
|
||||
float4 rDotL = 0;
|
||||
#ifndef TORQUE_BL_NOSPECULAR
|
||||
|
||||
// We're using the Phong specular reflection model
|
||||
// here where traditionally Torque has used Blinn-Phong
|
||||
// which has proven to be more accurate to real materials.
|
||||
//
|
||||
// We do so because its cheaper as do not need to
|
||||
// calculate the half angle for all 4 lights.
|
||||
//
|
||||
// Advanced Lighting still uses Blinn-Phong, but the
|
||||
// specular reconstruction it does looks fairly similar
|
||||
// to this.
|
||||
//
|
||||
float3 R = reflect( wsView, -wsNormal );
|
||||
|
||||
for ( i = 0; i < 3; i++ )
|
||||
rDotL += lightVectors[i] * R[i];
|
||||
|
||||
#endif
|
||||
|
||||
// Normalize the dots.
|
||||
//
|
||||
// Notice we're using the half type here to get a
|
||||
// much faster sqrt via the rsq_pp instruction at
|
||||
// the loss of some precision.
|
||||
//
|
||||
// Unless we have some extremely large point lights
|
||||
// i don't believe the precision loss will matter.
|
||||
//
|
||||
float4 squareDists = 0;
|
||||
for ( i = 0; i < 3; i++ )
|
||||
squareDists += lightVectors[i] * lightVectors[i];
|
||||
half4 correction = (half4)rsqrt( squareDists );
|
||||
nDotL = saturate( nDotL * correction );
|
||||
rDotL = clamp( rDotL * correction, 0.00001, 1.0 );
|
||||
|
||||
// First calculate a simple point light linear
|
||||
// attenuation factor.
|
||||
|
|
@ -156,94 +253,19 @@ void compute4Lights( float3 wsView,
|
|||
atten *= saturate( cosAngle * inLightSpotFalloff );
|
||||
|
||||
#endif
|
||||
|
||||
// Finally apply the shadow masking on the attenuation.
|
||||
atten *= shadowMask;
|
||||
|
||||
|
||||
// Get the final light intensity.
|
||||
float4 intensity = nDotL * atten;
|
||||
|
||||
// Combine the light colors for output.
|
||||
outDiffuse = 0;
|
||||
float4 lightColor = 0;
|
||||
for ( i = 0; i < 4; i++ )
|
||||
outDiffuse += intensity[i] * inLightColor[i];
|
||||
lightColor += intensity[i] * inLightColor[i];
|
||||
|
||||
float3 toLight = 0;
|
||||
for ( i = 0; i < 3; i++ )
|
||||
toLight += lightVectors[i].rgb;
|
||||
|
||||
// Output the specular power.
|
||||
float4 specularIntensity = pow( rDotL, specularPower.xxxx ) * atten;
|
||||
|
||||
// Apply the per-light specular attenuation.
|
||||
float4 specular = float4(0,0,0,1);
|
||||
for ( i = 0; i < 4; i++ )
|
||||
specular += float4( inLightColor[i].rgb * inLightColor[i].a * specularIntensity[i], 1 );
|
||||
|
||||
// Add the final specular intensity values together
|
||||
// using a single dot product operation then get the
|
||||
// final specular lighting color.
|
||||
outSpecular = specularColor * specular;
|
||||
}
|
||||
|
||||
|
||||
// This value is used in AL as a constant power to raise specular values
|
||||
// to, before storing them into the light info buffer. The per-material
|
||||
// specular value is then computer by using the integer identity of
|
||||
// exponentiation:
|
||||
//
|
||||
// (a^m)^n = a^(m*n)
|
||||
//
|
||||
// or
|
||||
//
|
||||
// (specular^constSpecular)^(matSpecular/constSpecular) = specular^(matSpecular*constSpecular)
|
||||
//
|
||||
#define AL_ConstantSpecularPower 12.0f
|
||||
|
||||
/// The specular calculation used in Advanced Lighting.
|
||||
///
|
||||
/// @param toLight Normalized vector representing direction from the pixel
|
||||
/// being lit, to the light source, in world space.
|
||||
///
|
||||
/// @param normal Normalized surface normal.
|
||||
///
|
||||
/// @param toEye The normalized vector representing direction from the pixel
|
||||
/// being lit to the camera.
|
||||
///
|
||||
float AL_CalcSpecular( float3 toLight, float3 normal, float3 toEye )
|
||||
{
|
||||
// (R.V)^c
|
||||
float specVal = dot( normalize( -reflect( toLight, normal ) ), toEye );
|
||||
|
||||
// Return the specular factor.
|
||||
return pow( max( specVal, 0.00001f ), AL_ConstantSpecularPower );
|
||||
}
|
||||
|
||||
/// The output for Deferred Lighting
|
||||
///
|
||||
/// @param toLight Normalized vector representing direction from the pixel
|
||||
/// being lit, to the light source, in world space.
|
||||
///
|
||||
/// @param normal Normalized surface normal.
|
||||
///
|
||||
/// @param toEye The normalized vector representing direction from the pixel
|
||||
/// being lit to the camera.
|
||||
///
|
||||
float4 AL_DeferredOutput(
|
||||
float3 lightColor,
|
||||
float3 diffuseColor,
|
||||
float4 matInfo,
|
||||
float4 ambient,
|
||||
float specular,
|
||||
float shadowAttenuation)
|
||||
{
|
||||
float3 specularColor = float3(specular, specular, specular);
|
||||
bool metalness = getFlag(matInfo.r, 3);
|
||||
if ( metalness )
|
||||
{
|
||||
specularColor = 0.04 * (1 - specular) + diffuseColor * specular;
|
||||
}
|
||||
|
||||
//specular = color * map * spec^gloss
|
||||
float specularOut = (specularColor * matInfo.b * min(pow(abs(specular), max(( matInfo.a/ AL_ConstantSpecularPower),1.0f)),matInfo.a)).r;
|
||||
|
||||
lightColor *= shadowAttenuation;
|
||||
lightColor += ambient.rgb;
|
||||
return float4(lightColor.rgb, specularOut);
|
||||
}
|
||||
outDiffuse = float4(albedo.rgb*(1.0-metalness),albedo.a);
|
||||
outSpecular = EvalBDRF( float3( 1.0, 1.0, 1.0 ), lightColor.rgb, toLight, wsPosition, wsNormal, smoothness, metalness );
|
||||
}
|
||||
|
|
@ -37,11 +37,12 @@ struct ConvexConnectV
|
|||
float4 vsEyeDir : TEXCOORD2;
|
||||
};
|
||||
|
||||
ConvexConnectV main( VertData IN,
|
||||
uniform float4x4 modelview,
|
||||
uniform float4x4 objTrans,
|
||||
uniform float4x4 worldViewOnly,
|
||||
uniform float3 eyePosWorld )
|
||||
uniform float4x4 modelview;
|
||||
uniform float4x4 objTrans;
|
||||
uniform float4x4 worldViewOnly;
|
||||
uniform float3 eyePosWorld;
|
||||
|
||||
ConvexConnectV main( VertData IN )
|
||||
{
|
||||
ConvexConnectV OUT;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 "shadergen:/autogenConditioners.h"
|
||||
#include "../../postfx/postFx.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(indirectLightingBuffer,0);
|
||||
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float4 directlighting = float4(TORQUE_TEX2D( indirectLightingBuffer, IN.uv0 ).rgb,1.0);
|
||||
return directlighting;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 "shadergen:/autogenConditioners.h"
|
||||
#include "../../postfx/postFx.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(matinfoTex,0);
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float specular = TORQUE_TEX2D( matinfoTex, IN.uv0 ).a;
|
||||
return float4( specular, specular, specular, 1.0 );
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 "shadergen:/autogenConditioners.h"
|
||||
#include "../../postfx/postFx.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(matinfoTex,0);
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float specular = TORQUE_TEX2D( matinfoTex, IN.uv0 ).b;
|
||||
return float4( specular, specular, specular, 1.0 );
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ struct Fragout
|
|||
float4 col : TORQUE_TARGET0;
|
||||
float4 col1 : TORQUE_TARGET1;
|
||||
float4 col2 : TORQUE_TARGET2;
|
||||
float4 col3 : TORQUE_TARGET3;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -45,10 +46,13 @@ Fragout main( Conn IN )
|
|||
OUT.col = float4(1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
// Clear Color Buffer.
|
||||
OUT.col1 = float4(0.0, 0.0, 0.0, 1.0);
|
||||
OUT.col1 = float4(0.0, 0.0, 0.0, 0.0001);
|
||||
|
||||
// Clear Material Info Buffer.
|
||||
OUT.col2 = float4(0.0, 0.0, 0.0, 1.0);
|
||||
OUT.col2 = float4(0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
// Clear Light Info Buffer.
|
||||
OUT.col3 = float4(0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,30 +25,37 @@
|
|||
#include "shaders/common/torque.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(colorBufferTex,0);
|
||||
TORQUE_UNIFORM_SAMPLER2D(lightDeferredTex,1);
|
||||
TORQUE_UNIFORM_SAMPLER2D(directLightingBuffer,1);
|
||||
TORQUE_UNIFORM_SAMPLER2D(matInfoTex,2);
|
||||
TORQUE_UNIFORM_SAMPLER2D(deferredTex,3);
|
||||
TORQUE_UNIFORM_SAMPLER2D(indirectLightingBuffer,3);
|
||||
TORQUE_UNIFORM_SAMPLER2D(deferredTex,4);
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float4 lightBuffer = TORQUE_TEX2D( lightDeferredTex, IN.uv0 );
|
||||
float4 colorBuffer = TORQUE_TEX2D( colorBufferTex, IN.uv0 );
|
||||
float4 matInfo = TORQUE_TEX2D( matInfoTex, IN.uv0 );
|
||||
float specular = saturate(lightBuffer.a);
|
||||
float depth = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).w;
|
||||
|
||||
if (depth>0.9999)
|
||||
return float4(0,0,0,0);
|
||||
|
||||
// Diffuse Color Altered by Metalness
|
||||
bool metalness = getFlag(matInfo.r, 3);
|
||||
if ( metalness )
|
||||
|
||||
float3 colorBuffer = TORQUE_TEX2D( colorBufferTex, IN.uv0 ).rgb; //albedo
|
||||
float4 matInfo = TORQUE_TEX2D(matInfoTex, IN.uv0); //flags|smoothness|ao|metallic
|
||||
|
||||
bool emissive = getFlag(matInfo.r, 0);
|
||||
if (emissive)
|
||||
{
|
||||
colorBuffer *= (1.0 - colorBuffer.a);
|
||||
return float4(colorBuffer, 1.0);
|
||||
}
|
||||
|
||||
colorBuffer += float4(specular, specular, specular, 1.0);
|
||||
colorBuffer *= float4(lightBuffer.rgb, 1.0);
|
||||
|
||||
return hdrEncode( float4(colorBuffer.rgb, 1.0) );
|
||||
|
||||
float4 directLighting = TORQUE_TEX2D( directLightingBuffer, IN.uv0 ); //shadowmap*specular
|
||||
float3 indirectLighting = TORQUE_TEX2D( indirectLightingBuffer, IN.uv0 ).rgb; //environment mapping*lightmaps
|
||||
float metalness = matInfo.a;
|
||||
|
||||
float frez = directLighting.a;
|
||||
|
||||
float3 diffuseColor = colorBuffer - (colorBuffer * metalness);
|
||||
float3 reflectColor = indirectLighting*colorBuffer;
|
||||
colorBuffer = diffuseColor+lerp(reflectColor,indirectLighting,frez);
|
||||
colorBuffer *= max(directLighting.rgb,float3(0,0,0));
|
||||
|
||||
return hdrEncode( float4(colorBuffer.rgb, 1.0) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@
|
|||
#include "../../hlslStructs.hlsl"
|
||||
#include "farFrustumQuad.hlsl"
|
||||
|
||||
uniform float4 rtParams0;
|
||||
|
||||
FarFrustumQuadConnectV main( VertexIn_PNTT IN,
|
||||
uniform float4 rtParams0 )
|
||||
FarFrustumQuadConnectV main( VertexIn_PNTT IN )
|
||||
{
|
||||
FarFrustumQuadConnectV OUT;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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"
|
||||
|
||||
in vec2 uv0;
|
||||
uniform sampler2D directLightingBuffer;
|
||||
|
||||
out vec4 OUT_col;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 directLighting = vec4(texture( directLightingBuffer, uv0 ).rgb,1.0);
|
||||
OUT_col = directLighting;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 "../../../postFx/gl/postFX.glsl"
|
||||
|
||||
uniform sampler2D matinfoTex;
|
||||
|
||||
out vec4 OUT_FragColor0;
|
||||
|
||||
void main()
|
||||
{
|
||||
float specular = texture( matinfoTex, uv0 ).a;
|
||||
OUT_FragColor0 = vec4( specular, specular, specular, 1.0 );
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 "../../../postFx/gl/postFX.glsl"
|
||||
|
||||
uniform sampler2D matinfoTex;
|
||||
|
||||
out vec4 OUT_FragColor0;
|
||||
|
||||
void main()
|
||||
{
|
||||
float specular = texture( matinfoTex, uv0 ).b;
|
||||
OUT_FragColor0 = vec4( specular, specular, specular, 1.0 );
|
||||
}
|
||||
|
|
@ -142,10 +142,11 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
|
|||
float3 ssPos = IN.ssPos.xyz / IN.ssPos.w;
|
||||
float2 uvScene = getUVFromSSPos( ssPos, rtParams0 );
|
||||
|
||||
// Emissive.
|
||||
float4 matInfo = TORQUE_TEX2D( matInfoBuffer, uvScene );
|
||||
bool emissive = getFlag( matInfo.r, 0 );
|
||||
if ( emissive )
|
||||
// Matinfo flags
|
||||
float4 matInfo = TORQUE_TEX2D( matInfoBuffer, uvScene );
|
||||
//early out if emissive
|
||||
bool emissive = getFlag(matInfo.r, 0);
|
||||
if (emissive)
|
||||
{
|
||||
return float4(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
|
@ -249,12 +250,18 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
|
|||
// cause the hardware occlusion query to disable the shadow.
|
||||
|
||||
// Specular term
|
||||
float specular = AL_CalcSpecular( lightVec,
|
||||
normal,
|
||||
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
||||
|
||||
float specular = 0;
|
||||
|
||||
float4 real_specular = EvalBDRF( float3( 1.0, 1.0, 1.0 ),
|
||||
lightcol,
|
||||
lightVec,
|
||||
viewSpacePos,
|
||||
normal,
|
||||
1.0-matInfo.b,
|
||||
matInfo.a );
|
||||
float3 lightColorOut = real_specular.rgb * lightBrightness * shadowed* atten;
|
||||
//lightColorOut /= colorSample.rgb;
|
||||
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
||||
float3 lightColorOut = lightMapParams.rgb * lightcol;
|
||||
float4 addToResult = 0.0;
|
||||
|
||||
// TODO: This needs to be removed when lightmapping is disabled
|
||||
|
|
@ -271,7 +278,6 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
|
|||
lightColorOut = shadowed;
|
||||
specular *= lightBrightness;
|
||||
addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
|
||||
}
|
||||
|
||||
return AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
|
||||
}
|
||||
return float4((lightColorOut*Sat_NL_Att+subsurface*(1.0-Sat_NL_Att)+addToResult.rgb),real_specular.a);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,10 +79,11 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
|
|||
float3 ssPos = IN.ssPos.xyz / IN.ssPos.w;
|
||||
float2 uvScene = getUVFromSSPos( ssPos, rtParams0 );
|
||||
|
||||
// Emissive.
|
||||
float4 matInfo = TORQUE_TEX2D( matInfoBuffer, uvScene );
|
||||
bool emissive = getFlag( matInfo.r, 0 );
|
||||
if ( emissive )
|
||||
// Matinfo flags
|
||||
float4 matInfo = TORQUE_TEX2D( matInfoBuffer, uvScene );
|
||||
//early out if emissive
|
||||
bool emissive = getFlag(matInfo.r, 0);
|
||||
if (emissive)
|
||||
{
|
||||
return float4(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
|
@ -181,12 +182,19 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
|
|||
// cause the hardware occlusion query to disable the shadow.
|
||||
|
||||
// Specular term
|
||||
float specular = AL_CalcSpecular( -lightToPxlVec,
|
||||
normal,
|
||||
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
||||
float specular = 0;
|
||||
|
||||
float3 lightVec = lightPosition - viewSpacePos;
|
||||
float4 real_specular = EvalBDRF( float3( 1.0, 1.0, 1.0 ),
|
||||
lightcol,
|
||||
lightVec,
|
||||
viewSpacePos,
|
||||
normal,
|
||||
1.0-matInfo.b,
|
||||
matInfo.a );
|
||||
float3 lightColorOut = real_specular.rgb * lightBrightness * shadowed* atten;
|
||||
|
||||
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
||||
float3 lightColorOut = lightMapParams.rgb * lightcol;
|
||||
float4 addToResult = 0.0;
|
||||
|
||||
// TODO: This needs to be removed when lightmapping is disabled
|
||||
|
|
@ -204,6 +212,5 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
|
|||
specular *= lightBrightness;
|
||||
addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
|
||||
}
|
||||
|
||||
return AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
|
||||
return float4((lightColorOut*Sat_NL_Att+subsurface*(1.0-Sat_NL_Att)+addToResult.rgb),real_specular.a);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ TORQUE_UNIFORM_SAMPLER2D(dynamicShadowMap, 2);
|
|||
TORQUE_UNIFORM_SAMPLER2D(ssaoMask, 3);
|
||||
uniform float4 rtParams3;
|
||||
#endif
|
||||
//register 4?
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(lightBuffer, 5);
|
||||
TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 6);
|
||||
TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 7);
|
||||
|
|
@ -194,12 +194,13 @@ float4 AL_VectorLightShadowCast( TORQUE_SAMPLER2D(sourceShadowMap),
|
|||
|
||||
float4 main( FarFrustumQuadConnectP IN ) : TORQUE_TARGET0
|
||||
{
|
||||
// Emissive.
|
||||
float4 matInfo = TORQUE_TEX2D( matInfoBuffer, IN.uv0 );
|
||||
bool emissive = getFlag( matInfo.r, 0 );
|
||||
if ( emissive )
|
||||
// Matinfo flags
|
||||
float4 matInfo = TORQUE_TEX2D( matInfoBuffer, IN.uv0 );
|
||||
//early out if emissive
|
||||
bool emissive = getFlag(matInfo.r, 0);
|
||||
if (emissive)
|
||||
{
|
||||
return float4(1.0, 1.0, 1.0, 0.0);
|
||||
return float4(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
float4 colorSample = TORQUE_TEX2D( colorBuffer, IN.uv0 );
|
||||
|
|
@ -289,30 +290,20 @@ float4 main( FarFrustumQuadConnectP IN ) : TORQUE_TARGET0
|
|||
|
||||
#endif // !NO_SHADOW
|
||||
|
||||
// Specular term
|
||||
float specular = AL_CalcSpecular( -lightDirection,
|
||||
normal,
|
||||
normalize(-IN.vsEyeRay) ) * lightBrightness * shadowed;
|
||||
|
||||
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
|
||||
float3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
||||
// Specular term
|
||||
float3 viewSpacePos = IN.vsEyeRay * depth;
|
||||
float4 real_specular = EvalBDRF( float3( 1.0, 1.0, 1.0 ),
|
||||
lightColor.rgb,
|
||||
normalize( -lightDirection ),
|
||||
viewSpacePos,
|
||||
normal,
|
||||
1.0-matInfo.b,
|
||||
matInfo.a );
|
||||
float3 lightColorOut = real_specular.rgb * lightBrightness * shadowed;
|
||||
|
||||
float4 addToResult = (lightAmbient * (1 - ambientCameraFactor)) + ( lightAmbient * ambientCameraFactor * saturate(dot(normalize(-IN.vsEyeRay), normal)) );
|
||||
|
||||
// TODO: This needs to be removed when lightmapping is disabled
|
||||
// as its extra work per-pixel on dynamic lit scenes.
|
||||
//
|
||||
// Special lightmapping pass.
|
||||
if ( lightMapParams.a < 0.0 )
|
||||
{
|
||||
// This disables shadows on the backsides of objects.
|
||||
shadowed = dotNL < 0.0f ? 1.0f : shadowed;
|
||||
|
||||
Sat_NL_Att = 1.0f;
|
||||
lightColorOut = shadowed;
|
||||
specular *= lightBrightness;
|
||||
addToResult = ( 1.0 - shadowed ) * abs(lightMapParams);
|
||||
}
|
||||
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
|
||||
float Sat_NdotV = saturate(dot(normalize(-IN.vsEyeRay), normal));
|
||||
float4 addToResult = ( lightAmbient * (1 - ambientCameraFactor)) + ( lightAmbient * ambientCameraFactor * Sat_NdotV );
|
||||
|
||||
// Sample the AO texture.
|
||||
#ifdef USE_SSAO_MASK
|
||||
|
|
@ -323,6 +314,6 @@ float4 main( FarFrustumQuadConnectP IN ) : TORQUE_TARGET0
|
|||
#ifdef PSSM_DEBUG_RENDER
|
||||
lightColorOut = debugColor;
|
||||
#endif
|
||||
|
||||
return AL_DeferredOutput(lightColorOut+subsurface*(1.0-Sat_NL_Att), colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);
|
||||
|
||||
return float4(matInfo.g*(lightColorOut*Sat_NL_Att+subsurface*(1.0-Sat_NL_Att)+addToResult.rgb),real_specular.a);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ uniform float3 fogData;
|
|||
uniform float4 rtParams0;
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
//float2 deferredCoord = ( IN.uv0.xy * rtParams0.zw ) + rtParams0.xy;
|
||||
{
|
||||
float depth = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).w;
|
||||
//return float4( depth, 0, 0, 0.7 );
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,9 @@
|
|||
#include "../../shaderModel.hlsl"
|
||||
|
||||
#define FXAA_PC 1
|
||||
#if (TORQUE_SM <= 30)
|
||||
#define FXAA_HLSL_3 1
|
||||
#elif TORQUE_SM < 49
|
||||
#if TORQUE_SM == 40
|
||||
#define FXAA_HLSL_4 1
|
||||
#elif TORQUE_SM >=50
|
||||
#elif TORQUE_SM > 40
|
||||
#define FXAA_HLSL_5 1
|
||||
#endif
|
||||
#define FXAA_QUALITY__PRESET 12
|
||||
|
|
@ -48,9 +46,7 @@ uniform float2 oneOverTargetSize;
|
|||
|
||||
float4 main( VertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
#if (TORQUE_SM >= 10 && TORQUE_SM <=30)
|
||||
FxaaTex tex = colorTex;
|
||||
#elif TORQUE_SM >=40
|
||||
#if TORQUE_SM >=40
|
||||
FxaaTex tex;
|
||||
tex.smpl = colorTex;
|
||||
tex.tex = texture_colorTex;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
|||
color.rgb = ((color.rgb - 0.5f) * Contrast) + 0.5f;
|
||||
|
||||
// Apply brightness
|
||||
color.rgb += Brightness;
|
||||
|
||||
return color;
|
||||
//color.rgb += Brightness;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
|
@ -43,6 +43,29 @@ uniform float g_fOneOverGamma;
|
|||
uniform float Brightness;
|
||||
uniform float Contrast;
|
||||
|
||||
// uncharted 2 tonemapper see: http://filmicgames.com/archives/75
|
||||
float3 Uncharted2Tonemap(const float3 x)
|
||||
{
|
||||
const float A = 0.15;
|
||||
const float B = 0.50;
|
||||
const float C = 0.10;
|
||||
const float D = 0.20;
|
||||
const float E = 0.02;
|
||||
const float F = 0.30;
|
||||
return ((x*(A*x + C*B) + D*E) / (x*(A*x + B) + D*F)) - E / F;
|
||||
}
|
||||
|
||||
float3 tonemap(float3 c)
|
||||
{
|
||||
const float W = 11.2;
|
||||
float ExposureBias = 2.0f;
|
||||
float ExposureAdjust = 1.5f;
|
||||
c *= ExposureAdjust;
|
||||
float3 curr = Uncharted2Tonemap(ExposureBias*c);
|
||||
float3 whiteScale = 1.0f / Uncharted2Tonemap(W);
|
||||
return curr*whiteScale;
|
||||
}
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float4 sample = hdrDecode( TORQUE_TEX2D( sceneTex, IN.uv0 ) );
|
||||
|
|
@ -71,17 +94,6 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
|||
|
||||
// Add the bloom effect.
|
||||
sample += g_fBloomScale * bloom;
|
||||
|
||||
// Map the high range of color values into a range appropriate for
|
||||
// display, taking into account the user's adaptation level,
|
||||
// white point, and selected value for for middle gray.
|
||||
if ( g_fEnableToneMapping > 0.0f )
|
||||
{
|
||||
float Lp = (g_fMiddleGray / (adaptedLum + 0.0001)) * hdrLuminance( sample.rgb );
|
||||
//float toneScalar = ( Lp * ( 1.0 + ( Lp / ( g_fWhiteCutoff ) ) ) ) / ( 1.0 + Lp );
|
||||
float toneScalar = Lp;
|
||||
sample.rgb = lerp( sample.rgb, sample.rgb * toneScalar, g_fEnableToneMapping );
|
||||
}
|
||||
|
||||
// Apply the color correction.
|
||||
sample.r = TORQUE_TEX1D( colorCorrectionTex, sample.r ).r;
|
||||
|
|
|
|||
|
|
@ -24,44 +24,8 @@
|
|||
#define _TORQUE_SHADERMODEL_
|
||||
|
||||
// Portability helpers for different shader models
|
||||
//Shader model 1.0 - 3.0
|
||||
#if (TORQUE_SM >= 10 && TORQUE_SM <=30)
|
||||
// Semantics
|
||||
#define TORQUE_POSITION POSITION
|
||||
#define TORQUE_DEPTH DEPTH
|
||||
#define TORQUE_TARGET0 COLOR0
|
||||
#define TORQUE_TARGET1 COLOR1
|
||||
#define TORQUE_TARGET2 COLOR2
|
||||
#define TORQUE_TARGET3 COLOR3
|
||||
|
||||
// Sampler uniforms
|
||||
#define TORQUE_UNIFORM_SAMPLER1D(tex,regist) uniform sampler1D tex : register(S##regist)
|
||||
#define TORQUE_UNIFORM_SAMPLER2D(tex,regist) uniform sampler2D tex : register(S##regist)
|
||||
#define TORQUE_UNIFORM_SAMPLER3D(tex,regist) uniform sampler3D tex : register(S##regist)
|
||||
#define TORQUE_UNIFORM_SAMPLERCUBE(tex,regist) uniform samplerCUBE tex : register(S##regist)
|
||||
// Sampling functions
|
||||
#define TORQUE_TEX1D(tex,coords) tex1D(tex,coords)
|
||||
#define TORQUE_TEX2D(tex,coords) tex2D(tex,coords)
|
||||
#define TORQUE_TEX2DPROJ(tex,coords) tex2Dproj(tex,coords) //this really is sm 2 or later
|
||||
#define TORQUE_TEX3D(tex,coords) tex3D(tex,coords)
|
||||
#define TORQUE_TEXCUBE(tex,coords) texCUBE(tex,coords)
|
||||
|
||||
//Shader model 3.0 only
|
||||
#if TORQUE_SM == 30
|
||||
#define TORQUE_VPOS VPOS // This is a float2
|
||||
// The mipmap LOD is specified in coord.w
|
||||
#define TORQUE_TEX2DLOD(tex,coords) tex2Dlod(tex,coords)
|
||||
#endif
|
||||
|
||||
//helper if you want to pass sampler/texture in a function
|
||||
//2D
|
||||
#define TORQUE_SAMPLER2D(tex) sampler2D tex
|
||||
#define TORQUE_SAMPLER2D_MAKEARG(tex) tex
|
||||
//Cube
|
||||
#define TORQUE_SAMPLERCUBE(tex) samplerCUBE tex
|
||||
#define TORQUE_SAMPLERCUBE_MAKEARG(tex) tex
|
||||
// Shader model 4.0+
|
||||
#elif TORQUE_SM >= 40
|
||||
#if TORQUE_SM >= 40
|
||||
#define TORQUE_POSITION SV_Position
|
||||
#define TORQUE_DEPTH SV_Depth
|
||||
#define TORQUE_VPOS SV_Position //note float4 compared to SM 3 where it is a float2
|
||||
|
|
@ -69,10 +33,13 @@
|
|||
#define TORQUE_TARGET1 SV_Target1
|
||||
#define TORQUE_TARGET2 SV_Target2
|
||||
#define TORQUE_TARGET3 SV_Target3
|
||||
#define TORQUE_TARGET4 SV_Target4
|
||||
#define TORQUE_TARGET5 SV_Target5
|
||||
// Sampler uniforms
|
||||
//1D is emulated to a 2D for now
|
||||
#define TORQUE_UNIFORM_SAMPLER1D(tex,regist) uniform Texture2D texture_##tex : register(T##regist); uniform SamplerState tex : register(S##regist)
|
||||
#define TORQUE_UNIFORM_SAMPLER2D(tex,regist) uniform Texture2D texture_##tex : register(T##regist); uniform SamplerState tex : register(S##regist)
|
||||
#define TORQUE_UNIFORM_SAMPLER2DCMP(tex,regist) uniform Texture2D texture_##tex : register(T##regist); uniform SamplerComparisonState tex : register(S##regist)
|
||||
#define TORQUE_UNIFORM_SAMPLER3D(tex,regist) uniform Texture3D texture_##tex : register(T##regist); uniform SamplerState tex : register(S##regist)
|
||||
#define TORQUE_UNIFORM_SAMPLERCUBE(tex,regist) uniform TextureCube texture_##tex : register(T##regist); uniform SamplerState tex : register(S##regist)
|
||||
// Sampling functions
|
||||
|
|
@ -83,11 +50,18 @@
|
|||
#define TORQUE_TEXCUBE(tex,coords) texture_##tex.Sample(tex,coords)
|
||||
// The mipmap LOD is specified in coord.w
|
||||
#define TORQUE_TEX2DLOD(tex,coords) texture_##tex.SampleLevel(tex,coords.xy,coords.w)
|
||||
#define TORQUE_TEXCUBELOD(tex,coords) texture_##tex.SampleLevel(tex,coords.xyz,coords.w)
|
||||
// Tex2d comparison
|
||||
#define TORQUE_TEX2DCMP(tex,coords,compare) texture_##tex.SampleCmpLevelZero(tex,coords,compare)
|
||||
|
||||
#define TORQUE_TEX2DGATHER(tex,coords,compare,offset) texture_##tex.GatherCmp(tex,coords,compare,offset)
|
||||
|
||||
//helper if you want to pass sampler/texture in a function
|
||||
//2D
|
||||
#define TORQUE_SAMPLER2D(tex) Texture2D texture_##tex, SamplerState tex
|
||||
#define TORQUE_SAMPLER2D_MAKEARG(tex) texture_##tex, tex
|
||||
// Sampler comparison state - use above MAKEARG with this
|
||||
#define TORQUE_SAMPLER2DCMP(tex) Texture2D texture_##tex, SamplerComparisonState tex
|
||||
//Cube
|
||||
#define TORQUE_SAMPLERCUBE(tex) TextureCube texture_##tex, SamplerState tex
|
||||
#define TORQUE_SAMPLERCUBE_MAKEARG(tex) texture_##tex, tex
|
||||
|
|
|
|||
|
|
@ -26,9 +26,8 @@
|
|||
#include "shadergen:/autogenConditioners.h"
|
||||
|
||||
// Portability helpers for autogenConditioners
|
||||
#if (TORQUE_SM >= 10 && TORQUE_SM <=30)
|
||||
#define TORQUE_DEFERRED_UNCONDITION(tex, coords) deferredUncondition(tex, coords)
|
||||
#elif TORQUE_SM >= 40
|
||||
|
||||
#if TORQUE_SM >= 40
|
||||
#define TORQUE_DEFERRED_UNCONDITION(tex, coords) deferredUncondition(tex, texture_##tex, coords)
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -167,22 +167,13 @@ float2 parallaxOffsetDxtnm(TORQUE_SAMPLER2D(texMap), float2 texCoord, float3 neg
|
|||
return offset;
|
||||
}
|
||||
|
||||
|
||||
/// The maximum value for 16bit per component integer HDR encoding.
|
||||
static const float HDR_RGB16_MAX = 100.0;
|
||||
|
||||
/// The maximum value for 10bit per component integer HDR encoding.
|
||||
static const float HDR_RGB10_MAX = 4.0;
|
||||
|
||||
/// Encodes an HDR color for storage into a target.
|
||||
float3 hdrEncode( float3 sample )
|
||||
{
|
||||
#if defined( TORQUE_HDR_RGB16 )
|
||||
|
||||
return sample / HDR_RGB16_MAX;
|
||||
|
||||
#elif defined( TORQUE_HDR_RGB10 )
|
||||
|
||||
#if defined( TORQUE_HDR_RGB10 )
|
||||
return sample / HDR_RGB10_MAX;
|
||||
|
||||
#else
|
||||
|
|
@ -202,12 +193,7 @@ float4 hdrEncode( float4 sample )
|
|||
/// Decodes an HDR color from a target.
|
||||
float3 hdrDecode( float3 sample )
|
||||
{
|
||||
#if defined( TORQUE_HDR_RGB16 )
|
||||
|
||||
return sample * HDR_RGB16_MAX;
|
||||
|
||||
#elif defined( TORQUE_HDR_RGB10 )
|
||||
|
||||
#if defined( TORQUE_HDR_RGB10 )
|
||||
return sample * HDR_RGB10_MAX;
|
||||
|
||||
#else
|
||||
|
|
@ -286,37 +272,6 @@ bool getFlag(float flags, int num)
|
|||
return (fmod(process, pow(2, squareNum)) >= squareNum);
|
||||
}
|
||||
|
||||
// #define TORQUE_STOCK_GAMMA
|
||||
#ifdef TORQUE_STOCK_GAMMA
|
||||
// Sample in linear space. Decodes gamma.
|
||||
float4 toLinear(float4 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
// Encodes gamma.
|
||||
float4 toGamma(float4 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
float3 toLinear(float3 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
// Encodes gamma.
|
||||
float3 toGamma(float3 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
float3 toLinear(float3 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
// Encodes gamma.
|
||||
float3 toLinear(float3 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
#else
|
||||
// Sample in linear space. Decodes gamma.
|
||||
float4 toLinear(float4 tex)
|
||||
{
|
||||
|
|
@ -337,6 +292,22 @@ float3 toGamma(float3 tex)
|
|||
{
|
||||
return pow(abs(tex.rgb), 1.0/2.2);
|
||||
}
|
||||
#endif //
|
||||
|
||||
//
|
||||
float3 PBRFresnel(float3 albedo, float3 indirect, float metalness, float fresnel)
|
||||
{
|
||||
float3 diffuseColor = albedo - (albedo * metalness);
|
||||
float3 reflectColor = lerp(indirect*albedo, indirect, fresnel);
|
||||
|
||||
return diffuseColor + reflectColor;
|
||||
}
|
||||
|
||||
float3 simpleFresnel(float3 diffuseColor, float3 reflectColor, float metalness, float angle, float bias, float power)
|
||||
{
|
||||
float fresnelTerm = bias + (1.0 - bias) * pow(abs(1.0 - max(angle, 0)), power);
|
||||
|
||||
fresnelTerm *= metalness;
|
||||
|
||||
return lerp(diffuseColor, reflectColor, fresnelTerm);
|
||||
}
|
||||
#endif // _TORQUE_HLSL_
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0
|
|||
{
|
||||
// Modulate baseColor by the ambientColor.
|
||||
float4 waterBaseColor = baseColor * float4( ambientColor.rgb, 1 );
|
||||
waterBaseColor = waterBaseColor;
|
||||
|
||||
// Get the bumpNorm...
|
||||
float3 bumpNorm = ( TORQUE_TEX2D( bumpMap, IN.rippleTexCoord01.xy ).rgb * 2.0 - 1.0 ) * rippleMagnitude.x;
|
||||
|
|
|
|||
|
|
@ -311,7 +311,6 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0
|
|||
|
||||
// Calculate the water "base" color based on depth.
|
||||
float4 waterBaseColor = baseColor * TORQUE_TEX1D( depthGradMap, saturate( delta / depthGradMax ) );
|
||||
waterBaseColor = waterBaseColor;
|
||||
|
||||
// Modulate baseColor by the ambientColor.
|
||||
waterBaseColor *= float4( ambientColor.rgb, 1 );
|
||||
|
|
|
|||
|
|
@ -120,9 +120,13 @@ function MaterialEditorPlugin::onActivated( %this )
|
|||
}else{
|
||||
$wasInWireFrameMode = false;
|
||||
}
|
||||
|
||||
advancedTextureMapsRollout.Expanded = false;
|
||||
accumulationPropertiesRollout.Expanded = false;
|
||||
lightingPropertiesRollout.Expanded = false;
|
||||
materialAnimationPropertiesRollout.Expanded = false;
|
||||
materialAdvancedPropertiesRollout.Expanded = false;
|
||||
materialDamagePropertiesRollout.Expanded = false;
|
||||
WorldEditorPlugin.onActivated();
|
||||
|
||||
EditorGui-->MatEdPropertiesWindow.setVisible( true );
|
||||
|
|
|
|||
|
|
@ -593,6 +593,27 @@ function MaterialEditorGui::convertTextureFields(%this)
|
|||
%specMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %specMap);
|
||||
MaterialEditorGui.currentMaterial.specularMap[%specI] = %specMap;
|
||||
}
|
||||
|
||||
for(%roughI = 0; %roughI < 4; %roughI++)
|
||||
{
|
||||
%roughMap = MaterialEditorGui.currentMaterial.roughMap[%roughI];
|
||||
%roughMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %roughMap);
|
||||
MaterialEditorGui.currentMaterial.roughMap[%specI] = %roughMap;
|
||||
}
|
||||
|
||||
for(%aoI = 0; %aoI < 4; %aoI++)
|
||||
{
|
||||
%aoMap = MaterialEditorGui.currentMaterial.aoMap[%aoI];
|
||||
%aoMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %aoMap);
|
||||
MaterialEditorGui.currentMaterial.aoMap[%specI] = %aoMap;
|
||||
}
|
||||
|
||||
for(%metalI = 0; %metalI < 4; %metalI++)
|
||||
{
|
||||
%metalMap = MaterialEditorGui.currentMaterial.metalMap[%metalI];
|
||||
%metalMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %metalMap);
|
||||
MaterialEditorGui.currentMaterial.metalMap[%metalI] = %metalMap;
|
||||
}
|
||||
}
|
||||
|
||||
// still needs to be optimized further
|
||||
|
|
@ -875,7 +896,9 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|||
MaterialEditorPropertiesWindow-->toneMapNameText.setText( (%material).toneMap[%layer] );
|
||||
MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).toneMap[%layer] );
|
||||
}
|
||||
|
||||
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
|
||||
MaterialEditorPropertiesWindow-->invertSmoothnessCheckbox.setValue((%material).invertSmoothness[%layer]);
|
||||
|
||||
if((%material).specularMap[%layer] $= "")
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->specMapNameText.setText( "None" );
|
||||
|
|
@ -887,6 +910,39 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|||
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( (%material).specularMap[%layer] );
|
||||
}
|
||||
|
||||
if((%material).roughMap[%layer] $= "")
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->roughMapNameText.setText( "None" );
|
||||
MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->roughMapNameText.setText( (%material).roughMap[%layer] );
|
||||
MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( (%material).roughMap[%layer] );
|
||||
}
|
||||
|
||||
if((%material).aoMap[%layer] $= "")
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->aoMapNameText.setText( "None" );
|
||||
MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->aoMapNameText.setText( (%material).aoMap[%layer] );
|
||||
MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( (%material).aoMap[%layer] );
|
||||
}
|
||||
|
||||
if((%material).metalMap[%layer] $= "")
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->metalMapNameText.setText( "None" );
|
||||
MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->metalMapNameText.setText( (%material).metalMap[%layer] );
|
||||
MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).metalMap[%layer] );
|
||||
}
|
||||
|
||||
MaterialEditorPropertiesWindow-->accuScaleTextEdit.setText((%material).accuScale[%layer]);
|
||||
MaterialEditorPropertiesWindow-->accuScaleTextEdit.setText((%material).accuScale[%layer]);
|
||||
MaterialEditorPropertiesWindow-->accuDirectionTextEdit.setText((%material).accuDirection[%layer]);
|
||||
|
|
@ -904,11 +960,10 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|||
MaterialEditorPropertiesWindow-->colorTintSwatch.color = (%material).diffuseColor[%layer];
|
||||
MaterialEditorPropertiesWindow-->specularColorSwatch.color = (%material).specular[%layer];
|
||||
|
||||
MaterialEditorPropertiesWindow-->specularPowerTextEdit.setText((%material).specularPower[%layer]);
|
||||
MaterialEditorPropertiesWindow-->specularPowerSlider.setValue((%material).specularPower[%layer]);
|
||||
MaterialEditorPropertiesWindow-->specularStrengthTextEdit.setText((%material).specularStrength[%layer]);
|
||||
MaterialEditorPropertiesWindow-->specularStrengthSlider.setValue((%material).specularStrength[%layer]);
|
||||
MaterialEditorPropertiesWindow-->pixelSpecularCheckbox.setValue((%material).pixelSpecular[%layer]);
|
||||
MaterialEditorPropertiesWindow-->SmoothnessTextEdit.setText((%material).Smoothness[%layer]);
|
||||
MaterialEditorPropertiesWindow-->SmoothnessSlider.setValue((%material).Smoothness[%layer]);
|
||||
MaterialEditorPropertiesWindow-->MetalnessTextEdit.setText((%material).Metalness[%layer]);
|
||||
MaterialEditorPropertiesWindow-->MetalnessSlider.setValue((%material).Metalness[%layer]);
|
||||
MaterialEditorPropertiesWindow-->glowCheckbox.setValue((%material).glow[%layer]);
|
||||
MaterialEditorPropertiesWindow-->emissiveCheckbox.setValue((%material).emissive[%layer]);
|
||||
MaterialEditorPropertiesWindow-->parallaxTextEdit.setText((%material).parallaxScale[%layer]);
|
||||
|
|
@ -976,11 +1031,34 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|||
MaterialEditorPropertiesWindow-->SequenceSliderSSS.setValue( %numFrames );
|
||||
|
||||
// Accumulation
|
||||
MaterialEditorPropertiesWindow-->accuCheckbox.setValue((%material).accuEnabled[%layer]);
|
||||
MaterialEditorPropertiesWindow-->accuCheckbox.setValue((%material).accuEnabled[%layer]);
|
||||
|
||||
MaterialEditorPropertiesWindow-->accuCheckbox.setValue((%material).accuEnabled[%layer]);
|
||||
|
||||
%this.getRoughChan((%material).SmoothnessChan[%layer]);
|
||||
%this.getAOChan((%material).AOChan[%layer]);
|
||||
%this.getMetalChan((%material).metalChan[%layer]);
|
||||
%this.preventUndo = false;
|
||||
}
|
||||
|
||||
//=======================================
|
||||
function MaterialEditorGui::getRoughChan(%this, %channel)
|
||||
{
|
||||
%guiElement = roughChanBtn @ %channel;
|
||||
%guiElement.setStateOn(true);
|
||||
}
|
||||
|
||||
function MaterialEditorGui::getAOChan(%this, %channel)
|
||||
{
|
||||
%guiElement = AOChanBtn @ %channel;
|
||||
%guiElement.setStateOn(true);
|
||||
}
|
||||
|
||||
function MaterialEditorGui::getMetalChan(%this, %channel)
|
||||
{
|
||||
%guiElement = metalChanBtn @ %channel;
|
||||
%guiElement.setStateOn(true);
|
||||
}
|
||||
//=======================================
|
||||
// Material Update Functionality
|
||||
|
||||
|
|
@ -1192,6 +1270,90 @@ function MaterialEditorGui::updateSpecMap(%this,%action)
|
|||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
function MaterialEditorGui::updateRoughMap(%this,%action)
|
||||
{
|
||||
%layer = MaterialEditorGui.currentLayer;
|
||||
|
||||
if( %action )
|
||||
{
|
||||
%texture = MaterialEditorGui.openFile("texture");
|
||||
if( %texture !$= "" )
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap(%texture);
|
||||
|
||||
%bitmap = MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.bitmap;
|
||||
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
||||
MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap(%bitmap);
|
||||
MaterialEditorPropertiesWindow-->roughMapNameText.setText(%bitmap);
|
||||
MaterialEditorGui.updateActiveMaterial("roughMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->roughMapNameText.setText("None");
|
||||
MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
|
||||
MaterialEditorGui.updateActiveMaterial("roughMap[" @ %layer @ "]","");
|
||||
}
|
||||
|
||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
function MaterialEditorGui::updateaoMap(%this,%action)
|
||||
{
|
||||
%layer = MaterialEditorGui.currentLayer;
|
||||
|
||||
if( %action )
|
||||
{
|
||||
%texture = MaterialEditorGui.openFile("texture");
|
||||
if( %texture !$= "" )
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%texture);
|
||||
|
||||
%bitmap = MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.bitmap;
|
||||
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
||||
MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%bitmap);
|
||||
MaterialEditorPropertiesWindow-->aoMapNameText.setText(%bitmap);
|
||||
MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->aoMapNameText.setText("None");
|
||||
MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
|
||||
MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","");
|
||||
}
|
||||
|
||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
function MaterialEditorGui::updatemetalMap(%this,%action)
|
||||
{
|
||||
%layer = MaterialEditorGui.currentLayer;
|
||||
|
||||
if( %action )
|
||||
{
|
||||
%texture = MaterialEditorGui.openFile("texture");
|
||||
if( %texture !$= "" )
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap(%texture);
|
||||
|
||||
%bitmap = MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.bitmap;
|
||||
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
||||
MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap(%bitmap);
|
||||
MaterialEditorPropertiesWindow-->metalMapNameText.setText(%bitmap);
|
||||
MaterialEditorGui.updateActiveMaterial("metalMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->metalMapNameText.setText("None");
|
||||
MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
|
||||
MaterialEditorGui.updateActiveMaterial("metalMap[" @ %layer @ "]","");
|
||||
}
|
||||
|
||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
function MaterialEditorGui::updateRotationOffset(%this, %isSlider, %onMouseUp)
|
||||
{
|
||||
%layer = MaterialEditorGui.currentLayer;
|
||||
|
|
@ -2268,3 +2430,58 @@ function MaterialEditorGui::updateAccuCheckbox(%this, %value)
|
|||
MaterialEditorGui.updateActiveMaterial("accuEnabled[" @ MaterialEditorGui.currentLayer @ "]", %value);
|
||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
// channel in selectors
|
||||
function MaterialEditorGui::setRoughChan(%this, %value)
|
||||
{
|
||||
MaterialEditorGui.updateActiveMaterial("SmoothnessChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
|
||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
function MaterialEditorGui::setAOChan(%this, %value)
|
||||
{
|
||||
MaterialEditorGui.updateActiveMaterial("aoChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
|
||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
function MaterialEditorGui::setMetalChan(%this, %value)
|
||||
{
|
||||
MaterialEditorGui.updateActiveMaterial("metalChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
|
||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||
}
|
||||
|
||||
function MaterialEditorGui::saveCompositeMap(%this)
|
||||
{
|
||||
%saveAs = "";
|
||||
%dlg = new SaveFileDialog()
|
||||
{
|
||||
Filters = "png";
|
||||
DefaultPath = EditorSettings.value("art/shapes/textures");
|
||||
ChangePath = false;
|
||||
OverwritePrompt = true;
|
||||
};
|
||||
|
||||
%ret = %dlg.Execute();
|
||||
if(%ret)
|
||||
{
|
||||
// Immediately override/set the levelsDirectory
|
||||
EditorSettings.setValue( "art/shapes/textures", collapseFilename(filePath( %dlg.FileName )) );
|
||||
%saveAs = %dlg.FileName;
|
||||
}
|
||||
|
||||
%material = %this.currentMaterial;
|
||||
%layer = %this.currentLayer;
|
||||
|
||||
%roughMap = %material.roughMap[%layer];
|
||||
%aoMap = %material.aoMap[%layer];
|
||||
%metalMap = %material.metalMap[%layer];
|
||||
|
||||
%smooth = %material.SmoothnessChan[%layer];
|
||||
%ao = %material.AOChan[%layer];
|
||||
%metal = %material.metalChan[%layer];
|
||||
|
||||
%channelKey = %smooth SPC %ao SPC %metal SPC 3;
|
||||
error("Storing: \"" @ %roughMap @"\" \""@ %aoMap @"\" \""@ %metalMap @"\" \""@ %channelKey @"\" \""@ %saveAs @"\"");
|
||||
saveCompositeTexture(%roughMap,%aoMap,%metalMap,"",%channelKey, %saveAs);
|
||||
%dlg.delete();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,11 +117,13 @@ function initializeWorldEditor()
|
|||
EVisibility.addOption( "Debug Render: Physics World", "$PhysicsWorld::render", "togglePhysicsDebugViz" );
|
||||
EVisibility.addOption( "AL: Disable Shadows", "$Shadows::disable", "" );
|
||||
EVisibility.addOption( "AL: Light Color Viz", "$AL_LightColorVisualizeVar", "toggleLightColorViz" );
|
||||
EVisibility.addOption( "AL: Environment Light", "$AL_LightMapShaderVar", "toggleLightMapViz" );
|
||||
EVisibility.addOption( "AL: Light Specular Viz", "$AL_LightSpecularVisualizeVar", "toggleLightSpecularViz" );
|
||||
EVisibility.addOption( "AL: Normals Viz", "$AL_NormalsVisualizeVar", "toggleNormalsViz" );
|
||||
EVisibility.addOption( "AL: Depth Viz", "$AL_DepthVisualizeVar", "toggleDepthViz" );
|
||||
EVisibility.addOption( "AL: Color Buffer", "$AL_ColorBufferShaderVar", "toggleColorBufferViz" );
|
||||
EVisibility.addOption( "AL: Spec Map", "$AL_SpecMapShaderVar", "toggleSpecMapViz");
|
||||
EVisibility.addOption( "AL: Spec Map(Rough)", "$AL_RoughMapShaderVar", "toggleRoughMapViz");
|
||||
EVisibility.addOption( "AL: Spec Map(Metal)", "$AL_MetalMapShaderVar", "toggleMetalMapViz");
|
||||
EVisibility.addOption( "AL: Backbuffer", "$AL_BackbufferVisualizeVar", "toggleBackbufferViz" );
|
||||
EVisibility.addOption( "AL: Glow Buffer", "$AL_GlowVisualizeVar", "toggleGlowViz" );
|
||||
EVisibility.addOption( "AL: PSSM Cascade Viz", "$AL::PSSMDebugRender", "" );
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ function EWCreatorWindow::init( %this )
|
|||
%this.registerMissionObject( "SFXSpace", "Sound Space" );
|
||||
%this.registerMissionObject( "OcclusionVolume", "Occlusion Volume" );
|
||||
%this.registerMissionObject( "AccumulationVolume", "Accumulation Volume" );
|
||||
%this.registerMissionObject("NavMesh", "Navigation mesh");
|
||||
%this.registerMissionObject("NavPath", "Path");
|
||||
%this.registerMissionObject( "Entity", "Entity" );
|
||||
|
||||
%this.endGroup();
|
||||
|
|
|
|||