diff --git a/Engine/source/renderInstance/renderParticleMgr.cpp b/Engine/source/renderInstance/renderParticleMgr.cpp index 4c2f8ccba..5bcd8cb96 100644 --- a/Engine/source/renderInstance/renderParticleMgr.cpp +++ b/Engine/source/renderInstance/renderParticleMgr.cpp @@ -495,7 +495,7 @@ void RenderParticleMgr::renderParticle(ParticleRenderInst* ri, SceneRenderState* mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mAlphaFactorSC, alphaFactor ); mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mAlphaScaleSC, alphaScale ); - mParticleShaderConsts.mShaderConsts->setSafe(mParticleShaderConsts.mGlowSC, ri->glow ? 1 : 0); + mParticleShaderConsts.mShaderConsts->setSafe(mParticleShaderConsts.mGlowSC, ri->glow); mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mFSModelViewProjSC, *ri->modelViewProj ); mParticleShaderConsts.mShaderConsts->setSafe( mParticleShaderConsts.mOneOverFarSC, 1.0f / state->getFarPlane() ); diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/particlesP.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/particlesP.glsl index 96a165ef3..b5311267a 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/particlesP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/particlesP.glsl @@ -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,7 +76,7 @@ vec4 lmSample( vec3 nrm ) uniform float alphaFactor; uniform float alphaScale; -uniform int glow; +uniform bool glow; out vec4 OUT_col; @@ -107,9 +106,10 @@ 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 >0) + if (glow) { - vec4 glowCol = vec4(pow(max((IN_color * diffuse).rgb*10,0.0),3.54406804435),(IN_color * diffuse).a); + 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, diff --git a/Templates/BaseGame/game/core/rendering/shaders/particlesP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/particlesP.hlsl index b27885f53..f6cd1ebb2 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/particlesP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/particlesP.hlsl @@ -75,7 +75,7 @@ float4 lmSample( float3 nrm ) uniform float alphaFactor; uniform float alphaScale; -uniform int glow; +uniform bool glow; float4 main( Conn IN ) : TORQUE_TARGET0 { @@ -103,7 +103,7 @@ 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 >0) + if (glow) { float4 glowCol = float4(pow(max((IN.color * diffuse).rgb*10,0.0),3.54406804435),(IN.color * diffuse).a); colorScale *= glowCol.rgb;