mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 23:05:38 +00:00
Adjusted creation of various assets to utilize template files.
This commit is contained in:
parent
98f50a4453
commit
ff7e580d28
12 changed files with 426 additions and 166 deletions
|
|
@ -0,0 +1,26 @@
|
|||
//onAdd is called when the component is created and then added to it's owner entity.
|
||||
//You would also add any script-defined component fields via addComponentField().
|
||||
function @@::onAdd(%this)
|
||||
{
|
||||
|
||||
}
|
||||
//onAdd is called when the component is removed and deleted from it's owner entity.
|
||||
function @@::onRemove(%this)
|
||||
{
|
||||
|
||||
}
|
||||
//onClientConnect is called any time a new client connects to the server.
|
||||
function @@::onClientConnect(%this, %client)
|
||||
{
|
||||
|
||||
}
|
||||
//onClientDisconnect is called any time a client disconnects from the server.
|
||||
%function @@::onClientDisonnect(%this, %client)
|
||||
{
|
||||
|
||||
}
|
||||
//update is called when the component does an update tick.
|
||||
function @@::Update(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
function @@::onWake(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function @@::onSleep(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(@@)
|
||||
{
|
||||
position = "0 0";
|
||||
extent = "100 100";
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 ShaderData( @@_Shader )
|
||||
{
|
||||
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
||||
DXPixelShaderFile = $Core:modulePath @ "@@P.hlsl";
|
||||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = $Core:modulePath @ "@@P.glsl";
|
||||
|
||||
samplerNames[0] = "$inputTex";
|
||||
|
||||
pixVersion = 3.0;
|
||||
};
|
||||
|
||||
singleton GFXStateBlockData( @@_StateBlock )
|
||||
{
|
||||
samplersDefined = true;
|
||||
samplerStates[0] = SamplerClampLinear;
|
||||
samplerStates[1] = SamplerClampLinear;
|
||||
samplerStates[2] = SamplerClampLinear;
|
||||
samplerStates[3] = SamplerClampLinear;
|
||||
|
||||
blendDefined = true;
|
||||
blendDest = GFXBlendOne;
|
||||
blendSrc = GFXBlendZero;
|
||||
|
||||
zDefined = true;
|
||||
zEnable = false;
|
||||
zWriteEnable = false;
|
||||
|
||||
cullDefined = true;
|
||||
cullMode = GFXCullNone;
|
||||
};
|
||||
|
||||
|
||||
function @@::setShaderConsts( %this )
|
||||
{
|
||||
}
|
||||
|
||||
function @@::preProcess( %this )
|
||||
{
|
||||
}
|
||||
|
||||
function @@::onEnabled( %this )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function @@::onDisabled( %this )
|
||||
{
|
||||
}
|
||||
|
||||
singleton PostEffect( @@ )
|
||||
{
|
||||
isEnabled = false;
|
||||
allowReflectPass = false;
|
||||
|
||||
// Resolve the HDR before we render any editor stuff
|
||||
// and before we resolve the scene to the backbuffer.
|
||||
renderTime = "PFXBeforeBin";
|
||||
renderBin = "EditorBin";
|
||||
renderPriority = 9999;
|
||||
|
||||
// The bright pass generates a bloomed version of
|
||||
// the scene for pixels which are brighter than a
|
||||
// fixed threshold value.
|
||||
//
|
||||
// This is then used in the final HDR combine pass
|
||||
// at the end of this post effect chain.
|
||||
shader = @@_Shader;
|
||||
stateBlock = @@_StateBlock;
|
||||
texture[0] = "$backBuffer";
|
||||
target = "$outTex";
|
||||
targetFormat = "GFXFormatR16G16B16A16F";
|
||||
targetScale = "1 1";
|
||||
};
|
||||
|
|
@ -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 "core/rendering/shaders/gl/torque.glsl"
|
||||
#include "core/rendering/shaders/gl/hlslCompat.glsl"
|
||||
#include "shadergen:/autogenConditioners.h"
|
||||
#include "core/rendering/shaders/postFX/gl/postFX.glsl"
|
||||
|
||||
uniform sampler2D inputTex;
|
||||
|
||||
out vec4 OUT_col;
|
||||
|
||||
void main()
|
||||
{
|
||||
OUT_col = hdrEncode( vec4(1,1,1,1) );
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "core/rendering/shaders/postFX/postFx.hlsl"
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
TORQUE_UNIFORM_SAMPLER2D(inputTex, 0);
|
||||
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
return hdrEncode( float4(1,1,1,1) );
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue