Merge branch 'Preview4_0' into alpha40_lightreview

# Conflicts:
#	Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl
This commit is contained in:
AzaezelX 2020-11-16 04:23:00 -06:00
commit 1e107ceb94
76 changed files with 682 additions and 297 deletions

View file

@ -27,11 +27,10 @@ function CoreModule::onCreate(%this)
ModuleDatabase.LoadExplicit( "Core_PostFX" );
ModuleDatabase.LoadExplicit( "Core_GameObjects" );
exec("data/defaults.cs");
%prefPath = getPrefpath();
if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
exec( %prefPath @ "/clientPrefs.cs" );
else
exec("data/defaults.cs");
// Seed the random number generator.
setRandomSeed();

View file

@ -15,11 +15,10 @@ function initClient()
exec( "./levelLoad.cs" );
//load prefs
exec( "data/defaults.cs" );
%prefPath = getPrefpath();
if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
exec( %prefPath @ "/clientPrefs.cs" );
else
exec( "data/defaults.cs" );
callOnModules("initClient");

View file

@ -133,7 +133,7 @@ function configureCanvas()
// It's formatted as AATypexAALevel
// So, FXAAx4 or MLAAx2
if ( isObject( FXAA_PostEffect ) )
FXAA_PostEffect.isEnabled = ( %aa > 0 ) ? true : false;
FXAA_PostEffect.Enabled = ( %aa > 0 ) ? true : false;
}
function GuiCanvas::modeStrToPrefs(%this, %modeStr)

View file

@ -64,7 +64,7 @@ singleton CustomMaterial( BL_ProjectedShadowMaterial )
function onActivateBasicLM()
{
// If HDR is enabled... enable the special format token.
if ( HDRPostFx.isEnabled )
if ( HDRPostFx.Enabled )
AL_FormatToken.enable();
// Create render pass for projected shadow.

View file

@ -113,7 +113,7 @@ function CameraMotionBlurPostFX::savePresetSettings(%this)
//Our actual postFX
singleton PostEffect( CameraMotionBlurPostFX )
{
isEnabled = false;
enabled = false;
renderTime = "PFXAfterDiffuse";
shader = CameraMotionBlurPostFX_Shader;

View file

@ -50,7 +50,7 @@ singleton ShaderData( PFX_CausticsShader )
singleton PostEffect( CausticsPFX )
{
isEnabled = false;
enabled = false;
renderTime = "PFXAfterDiffuse";
renderBin = "ObjTranslucentBin";
//renderPriority = 0.1;

View file

@ -132,7 +132,7 @@ function ChromaticAberrationPostFX::savePresetSettings(%this)
//Our actual postFX
singleton PostEffect( ChromaticAberrationPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
// Resolve the HDR before we render any editor stuff

View file

@ -404,7 +404,7 @@ function DepthOfFieldPostFX::setLerpDist( %this, %d0, %d1, %d2 )
singleton PostEffect( DepthOfFieldPostFX )
{
isEnabled = false;
enabled = false;
renderTime = "PFXAfterBin";
renderBin = "GlowBin";

View file

@ -84,7 +84,7 @@ singleton PostEffect( EdgeDetectPostEffect )
texture[0] = "#deferred";
target = "#edge";
isEnabled = true;
enabled = true;
};
singleton PostEffect( EdgeAAPostEffect )

View file

@ -49,7 +49,7 @@ singleton ShaderData( FXAA_ShaderData )
singleton PostEffect( FXAAPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
renderTime = "PFXAfterDiffuse";

View file

@ -37,7 +37,7 @@ singleton ShaderData( PFX_FlashShader )
singleton PostEffect( FlashFx )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
renderTime = "PFXAfterDiffuse";

View file

@ -63,5 +63,5 @@ singleton PostEffect( fogPostFX )
renderPriority = 5;
targetFormat = getBestHDRFormat();
isEnabled = true;
enabled = true;
};

View file

@ -43,7 +43,7 @@ singleton GFXStateBlockData( GammaStateBlock : PFX_DefaultStateBlock )
singleton PostEffect( GammaPostFX )
{
isEnabled = true;
enabled = true;
allowReflectPass = true;
renderTime = "PFXBeforeBin";

View file

@ -77,7 +77,7 @@ singleton PostEffect( GlowPostFX )
target = "$outTex";
targetScale = "0.5 0.5";
isEnabled = true;
enabled = true;
// Blur vertically
new PostEffect()
@ -146,7 +146,7 @@ singleton PostEffect( VolFogGlowPostFx )
texture[0] = "$backbuffer";
target = "$outTex";
targetScale = "0.5 0.5";
isEnabled = false;
enabled = false;
// Blur vertically
new PostEffect()
{

View file

@ -412,7 +412,7 @@ function HDRPostFX::savePresetSettings(%this)
singleton PostEffect( HDRPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
// Resolve the HDR before we render any editor stuff
@ -580,7 +580,7 @@ function LuminanceVisPostFX::setShaderConsts( %this )
singleton PostEffect( LuminanceVisPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
// Render before we do any editor rendering.

View file

@ -120,7 +120,7 @@ function LUTColorGradePostFX::savePresetSettings(%this)
//Our actual postFX
singleton PostEffect( LUTColorGradePostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
// Resolve the HDR before we render any editor stuff

View file

@ -69,7 +69,7 @@ singleton GFXStateBlockData( LightRayStateBlock : PFX_DefaultStateBlock )
singleton PostEffect( LightRayPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
renderTime = "PFXBeforeBin";

View file

@ -119,7 +119,7 @@ singleton ShaderData( MLAA_NeighborhoodBlendingShader )
singleton PostEffect( MLAAFx )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
renderTime = "PFXAfterDiffuse";

View file

@ -7,7 +7,7 @@ singleton PostEffect( reflectionProbeArrayPostFX )
renderTime = "PFXAfterBin";
renderBin = "ProbeBin";
renderPriority = 9999;
isEnabled = true;
enabled = true;
shader = PFX_ReflectionProbeArray;
stateBlock = PFX_ReflectionProbeArrayStateBlock;

View file

@ -121,7 +121,7 @@ function SharpenPostFX::savePresetSettings(%this)
//Our actual postFX
singleton PostEffect( SharpenPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
// Resolve the HDR before we render any editor stuff

View file

@ -44,7 +44,7 @@ singleton ShaderData( PFX_TurbulenceShader )
singleton PostEffect( TurbulencePostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = true;
renderTime = "PFXAfterDiffuse";

View file

@ -70,7 +70,7 @@ singleton PostEffect( underWaterFogPostFX )
// Needs to happen after the FogPostFx
renderPriority = 4;
isEnabled = true;
enabled = true;
};
function underWaterFogPostFX::onEnabled( %this )

View file

@ -81,7 +81,7 @@ singleton GFXStateBlockData( OVRBarrelDistortionStateBlock : PFX_DefaultStateBlo
//-----------------------------------------------------------------------------
singleton BarrelDistortionPostEffect( OVRBarrelDistortionPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
renderTime = "PFXAfterDiffuse";
@ -107,7 +107,7 @@ singleton BarrelDistortionPostEffect( OVRBarrelDistortionPostFX )
//-----------------------------------------------------------------------------
singleton BarrelDistortionPostEffect( OVRBarrelDistortionChromaPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
renderTime = "PFXAfterDiffuse";
@ -132,7 +132,7 @@ singleton BarrelDistortionPostEffect( OVRBarrelDistortionChromaPostFX )
//-----------------------------------------------------------------------------
singleton PostEffect( OVRBarrelDistortionMonoPostFX )
{
isEnabled = false;
enabled = false;
allowReflectPass = false;
renderTime = "PFXAfterDiffuse";

View file

@ -119,7 +119,7 @@ function VignettePostFX::savePresetSettings(%this)
//Our actual postFX
singleton PostEffect( VignettePostFX )
{
isEnabled = false;
enabled = false;
renderTime = "PFXBeforeBin";
renderBin = "EditorBin";

View file

@ -36,7 +36,7 @@ singleton PostEffect( afxHighlightPostFX )
renderTime = "PFXAfterDiffuse";
renderBin = "HighlightBin";
renderPriority = 1;
isEnabled = true;
enabled = true;
shader = PFX_afxHighlightShader;
stateBlock = PFX_afxDefaultHighlightStateBlock;

View file

@ -122,7 +122,7 @@ function PostFXManager::savePresetHandler( %filename )
{
%postEffect = PostFXManager.getKey(%i);
if(isObject(%postEffect) && %postEffect.isEnabled && %postEffect.isMethod("savePresetSettings"))
if(isObject(%postEffect) && %postEffect.Enabled && %postEffect.isMethod("savePresetSettings"))
{
%postEffect.savePresetSettings();
}

View file

@ -33,11 +33,10 @@ function Core_Rendering::initClient(%this)
initLightingSystems("Advanced Lighting");
//load prefs
exec("data/defaults.cs");
%prefPath = getPrefpath();
if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
exec( %prefPath @ "/clientPrefs.cs" );
else
exec("data/defaults.cs");
configureCanvas();

View file

@ -125,7 +125,7 @@ singleton PostEffect( AL_FormatCopy )
{
// This PostEffect is used by 'AL_FormatToken' directly. It is never added to
// the PostEffectManager. Do not call enable() on it.
isEnabled = false;
enabled = false;
allowReflectPass = true;
shader = PFX_PassthruShader;

View file

@ -24,7 +24,7 @@
#include "./brdf.glsl"
#ifndef TORQUE_SHADERGEN
#line 26
#line 27
// These are the uniforms used by most lighting shaders.
uniform vec4 inLightPos[4];
@ -52,6 +52,18 @@ uniform vec4 albedo;
#define MAX_FORWARD_LIGHT 4
#ifndef CAPTURING
#define CAPTURING 0
#endif
#ifndef DEBUGVIZ_ATTENUATION
#define DEBUGVIZ_ATTENUATION 0
#endif
#ifndef DEBUGVIZ_CONTRIB
#define DEBUGVIZ_CONTRIB 0
#endif
vec3 getDistanceVectorToPlane( vec3 origin, vec3 direction, vec4 plane )
{
float denum = dot( plane.xyz, direction.xyz );
@ -416,7 +428,7 @@ vec4 computeForwardProbes(Surface surface,
}
}
#if DEBUGVIZ_ATTENUATION == 1
#if (DEBUGVIZ_ATTENUATION == 1)
float contribAlpha = 1;
for (i = 0; i < numProbes; ++i)
{
@ -426,7 +438,7 @@ vec4 computeForwardProbes(Surface surface,
return vec4(1 - contribAlpha, 1 - contribAlpha, 1 - contribAlpha, 1);
#endif
#if DEBUGVIZ_CONTRIB == 1
#if (DEBUGVIZ_CONTRIB == 1)
vec3 probeContribColors[4];
probeContribColors[0] = vec3(1,0,0);
probeContribColors[1] = vec3(0,1,0);
@ -653,4 +665,4 @@ vec4 debugVizForwardProbes(Surface surface,
horizon *= horizon;
return vec4((irradiance + specular) * horizon, 0);//alpha writes disabled
}
}

View file

@ -53,6 +53,18 @@ uniform float4 albedo;
#define MAX_FORWARD_LIGHT 4
#ifndef CAPTURING
#define CAPTURING 0
#endif
#ifndef DEBUGVIZ_ATTENUATION
#define DEBUGVIZ_ATTENUATION 0
#endif
#ifndef DEBUGVIZ_CONTRIB
#define DEBUGVIZ_CONTRIB 0
#endif
inline float3 getDistanceVectorToPlane( float3 origin, float3 direction, float4 plane )
{
float denum = dot( plane.xyz, direction.xyz );

View file

@ -59,13 +59,13 @@
childMargin = "0 0";
new GuiScriptNotifyCtrl(VerveEditorGroupNotify) {
onChildAdded = "0";
onChildRemoved = "0";
onChildResized = "0";
onParentResized = "1";
onResize = "1";
onLoseFirstResponder = "0";
onGainFirstResponder = "0";
notifyOnChildAdded = "0";
notifyOnChildRemoved = "0";
notifyOnChildResized = "0";
notifyOnParentResized = "1";
notifyOnResize = "1";
notifyOnLoseFirstResponder = "0";
notifyOnGainFirstResponder = "0";
canSaveDynamicFields = "0";
class = "VerveEditorScrollNotifyV";
className = "VerveEditorScrollNotifyV";
@ -155,13 +155,13 @@
childMargin = "0 0";
new GuiScriptNotifyCtrl(VerveEditorTrackNotify) {
onChildAdded = "0";
onChildRemoved = "0";
onChildResized = "0";
onParentResized = "1";
onResize = "1";
onLoseFirstResponder = "0";
onGainFirstResponder = "0";
notifyOnChildAdded = "0";
notifyOnChildRemoved = "0";
notifyOnChildResized = "0";
notifyOnParentResized = "1";
notifyOnResize = "1";
notifyOnLoseFirstResponder = "0";
notifyOnGainFirstResponder = "0";
canSaveDynamicFields = "0";
class = "VerveEditorScrollNotify";
className = "VerveEditorScrollNotify";
@ -406,13 +406,13 @@
childMargin = "0 0";
new GuiScriptNotifyCtrl(VerveEditorTimeNotify) {
onChildAdded = "0";
onChildRemoved = "0";
onChildResized = "0";
onParentResized = "1";
onResize = "1";
onLoseFirstResponder = "0";
onGainFirstResponder = "0";
notifyOnChildAdded = "0";
notifyOnChildRemoved = "0";
notifyOnChildResized = "0";
notifyOnParentResized = "1";
notifyOnResize = "1";
notifyOnLoseFirstResponder = "0";
notifyOnGainFirstResponder = "0";
canSaveDynamicFields = "0";
class = "VerveEditorScrollNotifyH";
className = "VerveEditorScrollNotifyH";

View file

@ -46,7 +46,7 @@ function GuiEdit( %val )
//Temp fix to disable MLAA when in GUI editor
if( isObject(MLAAFx) && MLAAFx.isEnabled==true )
{
MLAAFx.isEnabled = false;
MLAAFx.Enabled = false;
$MLAAFxGuiEditorTemp = true;
}

View file

@ -544,7 +544,7 @@ function GuiEditCanvas::quit( %this )
//Temp fix to disable MLAA when in GUI editor
if( isObject(MLAAFx) && $MLAAFxGuiEditorTemp==true )
{
MLAAFx.isEnabled = true;
MLAAFx.Enabled = true;
$MLAAFxGuiEditorTemp = false;
}
}