fix particle glow

multiple preloads were failing to return false or mesages on failure of mandatory entries.
clear out redundant isScriptFile definition
fix default order of /scripts/managedData script files
This commit is contained in:
AzaezelX 2025-11-13 14:29:25 -06:00
parent 5d260bc58f
commit cce40efd35
21 changed files with 250 additions and 134 deletions

View file

@ -19,7 +19,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "torque.glsl"
#include "hlslCompat.glsl"
@ -77,6 +76,7 @@ vec4 lmSample( vec3 nrm )
uniform float alphaFactor;
uniform float alphaScale;
uniform bool glow;
out vec4 OUT_col;
@ -106,7 +106,12 @@ void main()
// Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
vec3 colorScale = ( alphaFactor < 0.0 ? IN_color.rgb * diffuse.rgb : vec3( alphaFactor > 0.0 ? IN_color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
if (glow)
{
vec3 glowCol = (IN_color * diffuse).rgb*10;//pow((IN_color * diffuse).rgb*10,3.54406804435);
glowCol*=glowCol*glowCol*0.54406804435;
colorScale *= glowCol.rgb;
}
OUT_col = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
IN_color.a * diffuse.a * softBlend * alphaScale ) );
}

View file

@ -75,6 +75,7 @@ float4 lmSample( float3 nrm )
uniform float alphaFactor;
uniform float alphaScale;
uniform bool glow;
float4 main( Conn IN ) : TORQUE_TARGET0
{
@ -102,7 +103,11 @@ float4 main( Conn IN ) : TORQUE_TARGET0
// Scale output color by the alpha factor (turn LerpAlpha into pre-multiplied alpha)
float3 colorScale = ( alphaFactor < 0.0 ? IN.color.rgb * diffuse.rgb : ( alphaFactor > 0.0 ? IN.color.a * diffuse.a * alphaFactor * softBlend : softBlend ) );
if (glow)
{
float4 glowCol = float4(pow(max((IN.color * diffuse).rgb*10,0.0),3.54406804435),(IN.color * diffuse).a);
colorScale *= glowCol.rgb;
}
return hdrEncode( float4( IN.color.rgb * diffuse.rgb * colorScale,
IN.color.a * diffuse.a * softBlend * alphaScale ) );
}

View file

@ -20,17 +20,6 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Check if a script file exists, compiled or not.
function isScriptFile(%path)
{
if( isFile(%path @ ".dso") || isFile(%path) )
return true;
return false;
}
function loadMaterials()
{
loadModuleMaterials();
@ -77,7 +66,7 @@ function loadDatablockFiles( %datablockFiles, %recurse )
for ( %i=0; %i < %count; %i++ )
{
%file = %datablockFiles.getKey( %i );
if (!isFile(%file) && !isFile(%file @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension))
if (!isScriptFile(%file))
continue;
exec( %file );
@ -100,7 +89,7 @@ function recursiveLoadDatablockFiles( %datablockFiles, %previousErrors )
for ( %i=0; %i < %count; %i++ )
{
%file = %datablockFiles.getKey( %i );
if (!isFile(%file) && !isFile(%file @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension @ ".dso") && !isFile(%file @"."@ $TorqueScriptFileExtension))
if (!isScriptFile(%file))
continue;
// Start counting copy constructor creation errors.

View file

@ -20,11 +20,11 @@ function @@::onCreateGameServer(%this)
//These are common managed data files. For any datablock-based stuff that gets generated by the editors
//(that doesn't have a specific associated file, like data for a player class) will go into these.
//So we'll register them now if they exist.
%this.registerDatablock("./scripts/managedData/managedDatablocks");
%this.registerDatablock("./scripts/managedData/managedForestItemData");
%this.registerDatablock("./scripts/managedData/managedForestBrushData");
%this.registerDatablock("./scripts/managedData/managedParticleData");
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
%this.registerDatablock("./scripts/managedData/managedDatablocks");
//--DATABLOCK EXEC END--
}