mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 22:10:36 +00:00
Merge pull request #1630 from Azaezel/alpha41/particleGlowAlpha
Some checks are pending
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Waiting to run
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Waiting to run
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Waiting to run
Some checks are pending
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Waiting to run
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Waiting to run
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Waiting to run
particle alpha influence on glow
This commit is contained in:
commit
1f5a4267ac
2 changed files with 6 additions and 4 deletions
|
|
@ -108,9 +108,10 @@ void main()
|
|||
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);
|
||||
float alphaLim = IN_color.a * diffuse.a;
|
||||
vec3 glowCol = (IN_color * diffuse).rgb*10;
|
||||
glowCol*=glowCol*glowCol*0.54406804435;
|
||||
colorScale *= glowCol.rgb;
|
||||
colorScale *= glowCol.rgb*alphaLim;
|
||||
}
|
||||
OUT_col = hdrEncode( vec4( IN_color.rgb * diffuse.rgb * colorScale,
|
||||
IN_color.a * diffuse.a * softBlend * alphaScale ) );
|
||||
|
|
|
|||
|
|
@ -105,8 +105,9 @@ float4 main( Conn IN ) : TORQUE_TARGET0
|
|||
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;
|
||||
float alphaLim = IN.color.a * diffuse.a;
|
||||
float3 glowCol = pow(max((IN.color * diffuse).rgb*10,0.0),3.54406804435);
|
||||
colorScale *= glowCol*alphaLim;
|
||||
}
|
||||
return hdrEncode( float4( IN.color.rgb * diffuse.rgb * colorScale,
|
||||
IN.color.a * diffuse.a * softBlend * alphaScale ) );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue