mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-24 22:05:40 +00:00
Merge branch 'development' into walkabout
Conflicts: Engine/source/T3D/aiPlayer.cpp
This commit is contained in:
commit
bd437cda1c
981 changed files with 304060 additions and 7888 deletions
|
|
@ -155,8 +155,8 @@ void DecalRoadNodeEvent::padListToSize()
|
|||
newlist->mPositions.merge(list->mPositions);
|
||||
newlist->mWidths.merge(list->mWidths);
|
||||
|
||||
mNodeList = newlist;
|
||||
delete list;
|
||||
mNodeList = list = newlist;
|
||||
}
|
||||
|
||||
// Pad our list end?
|
||||
|
|
@ -1726,4 +1726,4 @@ DefineEngineMethod( DecalRoad, postApply, void, (),,
|
|||
)
|
||||
{
|
||||
object->inspectPostApply();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,8 +203,8 @@ void MeshRoadNodeEvent::padListToSize()
|
|||
newlist->mDepths.merge(list->mDepths);
|
||||
newlist->mNormals.merge(list->mNormals);
|
||||
|
||||
mNodeList = newlist;
|
||||
delete list;
|
||||
mNodeList = list = newlist;
|
||||
}
|
||||
|
||||
// Pad our list end?
|
||||
|
|
@ -864,7 +864,7 @@ void MeshRoad::prepRenderImage( SceneRenderState* state )
|
|||
|
||||
// We sort by the material then vertex buffer.
|
||||
ri->defaultKey = matInst->getStateHint();
|
||||
ri->defaultKey2 = (U32)ri->vertBuff; // Not 64bit safe!
|
||||
ri->defaultKey2 = (uintptr_t)ri->vertBuff; // Not 64bit safe!
|
||||
|
||||
renderPass->addInst( ri );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,8 +227,8 @@ void RiverNodeEvent::padListToSize()
|
|||
newlist->mDepths.merge(list->mDepths);
|
||||
newlist->mNormals.merge(list->mNormals);
|
||||
|
||||
mNodeList = newlist;
|
||||
delete list;
|
||||
mNodeList = list = newlist;
|
||||
}
|
||||
|
||||
// Pad our list end?
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ ScatterSky::ScatterSky()
|
|||
|
||||
mExposure = 1.0f;
|
||||
mNightInterpolant = 0;
|
||||
mZOffset = 0.0f;
|
||||
|
||||
mShader = NULL;
|
||||
|
||||
|
|
@ -313,7 +314,7 @@ void ScatterSky::setElevation( F32 elevation )
|
|||
void ScatterSky::inspectPostApply()
|
||||
{
|
||||
mDirty = true;
|
||||
setMaskBits( 0xFFFFFFFF );
|
||||
setMaskBits( 0xFFFFFFFF );
|
||||
}
|
||||
|
||||
void ScatterSky::initPersistFields()
|
||||
|
|
@ -324,13 +325,13 @@ void ScatterSky::initPersistFields()
|
|||
addField( "skyBrightness", TypeF32, Offset( mSkyBrightness, ScatterSky ),
|
||||
"Global brightness and intensity applied to the sky and objects in the level." );
|
||||
|
||||
addField( "sunSize", TypeF32, Offset( mSunSize, ScatterSky ),
|
||||
addField( "sunSize", TypeF32, Offset( mSunSize, ScatterSky ),
|
||||
"Affects the size of the sun's disk." );
|
||||
|
||||
addField( "colorizeAmount", TypeF32, Offset( mColorizeAmt, ScatterSky ),
|
||||
addField( "colorizeAmount", TypeF32, Offset( mColorizeAmt, ScatterSky ),
|
||||
"Controls how much the the alpha component of colorize brigthens the sky. Setting to 0 returns default behavior." );
|
||||
|
||||
addField( "colorize", TypeColorF, Offset( mColorize, ScatterSky ),
|
||||
addField( "colorize", TypeColorF, Offset( mColorize, ScatterSky ),
|
||||
"Tints the sky the color specified, the alpha controls the brigthness. The brightness is multipled by the value of colorizeAmt." );
|
||||
|
||||
addField( "rayleighScattering", TypeF32, Offset( mRayleighScattering, ScatterSky ),
|
||||
|
|
@ -350,6 +351,9 @@ void ScatterSky::initPersistFields()
|
|||
addField( "exposure", TypeF32, Offset( mExposure, ScatterSky ),
|
||||
"Controls the contrast of the sky and sun during daytime." );
|
||||
|
||||
addField( "zOffset", TypeF32, Offset( mZOffset, ScatterSky ),
|
||||
"Offsets the scatterSky to avoid canvas rendering. Use 5000 or greater for the initial adjustment" );
|
||||
|
||||
endGroup( "ScatterSky" );
|
||||
|
||||
addGroup( "Orbit" );
|
||||
|
|
@ -473,11 +477,13 @@ U32 ScatterSky::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
|||
stream->write( mAmbientScale );
|
||||
stream->write( mSunScale );
|
||||
stream->write( mFogScale );
|
||||
stream->write( mColorizeAmt );
|
||||
stream->write( mColorizeAmt );
|
||||
stream->write( mColorize );
|
||||
|
||||
stream->write( mExposure );
|
||||
|
||||
stream->write( mZOffset );
|
||||
|
||||
stream->write( mBrightness );
|
||||
|
||||
stream->writeFlag( mCastShadows );
|
||||
|
|
@ -556,7 +562,7 @@ void ScatterSky::unpackUpdate(NetConnection *con, BitStream *stream)
|
|||
stream->read( &mAmbientScale );
|
||||
stream->read( &mSunScale );
|
||||
stream->read( &mFogScale );
|
||||
F32 colorizeAmt;
|
||||
F32 colorizeAmt;
|
||||
stream->read( &colorizeAmt );
|
||||
|
||||
if(mColorizeAmt != colorizeAmt) {
|
||||
|
|
@ -577,6 +583,8 @@ void ScatterSky::unpackUpdate(NetConnection *con, BitStream *stream)
|
|||
|
||||
stream->read( &mExposure );
|
||||
|
||||
stream->read( &mZOffset );
|
||||
|
||||
stream->read( &mBrightness );
|
||||
|
||||
mCastShadows = stream->readFlag();
|
||||
|
|
@ -658,6 +666,11 @@ void ScatterSky::prepRenderImage( SceneRenderState *state )
|
|||
mFlareState.lightMat.identity();
|
||||
mFlareState.lightMat.setPosition( lightPos );
|
||||
|
||||
F32 dist = ( lightPos - state->getCameraPosition( ) ).len( );
|
||||
F32 coronaScale = 0.5f;
|
||||
F32 screenRadius = GFX->getViewport( ).extent.y * coronaScale * 0.5f;
|
||||
mFlareState.worldRadius = screenRadius * dist / state->getWorldToScreenScale( ).y;
|
||||
|
||||
mFlareData->prepRender( state, &mFlareState );
|
||||
}
|
||||
|
||||
|
|
@ -706,7 +719,7 @@ bool ScatterSky::_initShader()
|
|||
Con::warnf( "ScatterSky::_initShader - failed to locate ScatterSkySBData!" );
|
||||
else
|
||||
mStateBlock = GFX->createStateBlock( data->getState() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !mStateBlock )
|
||||
return false;
|
||||
|
|
@ -937,7 +950,7 @@ void ScatterSky::_render( ObjectRenderInst *ri, SceneRenderState *state, BaseMat
|
|||
|
||||
Point3F camPos2 = state->getCameraPosition();
|
||||
MatrixF xfm(true);
|
||||
xfm.setPosition(camPos2);//-Point3F( 0, 0, 200000.0f));
|
||||
xfm.setPosition(camPos2 - Point3F( 0, 0, mZOffset));
|
||||
GFX->multWorld(xfm);
|
||||
MatrixF xform(proj);//GFX->getProjectionMatrix());
|
||||
xform *= GFX->getViewMatrix();
|
||||
|
|
@ -979,7 +992,7 @@ void ScatterSky::_render( ObjectRenderInst *ri, SceneRenderState *state, BaseMat
|
|||
mShaderConsts->setSafe( mUseCubemapSC, 0.0f );
|
||||
}
|
||||
|
||||
GFX->setPrimitiveBuffer( mPrimBuffer );
|
||||
GFX->setPrimitiveBuffer( mPrimBuffer );
|
||||
GFX->setVertexBuffer( mVB );
|
||||
|
||||
GFX->drawIndexedPrimitive( GFXTriangleList, 0, 0, mVertCount, 0, mPrimCount );
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ protected:
|
|||
|
||||
F32 mExposure;
|
||||
F32 mNightInterpolant;
|
||||
F32 mZOffset;
|
||||
|
||||
VectorF mLightDir;
|
||||
VectorF mSunDir;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue