mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 14:00:39 +00:00
shift glow logic to use a bool. we'll likely make that a scalar at some point, but not at the last second
gl math parity. for proper *command* parity we'll need to hunt down why it' forcing it to version 110
This commit is contained in:
parent
ab80a842aa
commit
c0bd8de143
3 changed files with 7 additions and 7 deletions
|
|
@ -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() );
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue