Merge pull request #1529 from Azaezel/alpha41/WaterGridGrinding

adress odd water values
This commit is contained in:
Brian Roberts 2025-08-04 08:50:29 -05:00 committed by GitHub
commit 07c67f2935
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 9 deletions

View file

@ -531,12 +531,9 @@ void WaterBlock::initPersistFields()
docsURL; docsURL;
addGroup( "WaterBlock" ); addGroup( "WaterBlock" );
addProtectedFieldV("gridSize", TypeRangedS32, Offset(mGridElementSize, WaterBlock), &setGridSizeProperty, &defaultProtectedGetFn, &CommonValidators::NaturalNumber, addProtectedFieldV("gridSize", TypeRangedF32, Offset(mGridElementSize, WaterBlock), &setGridSizeProperty, &defaultProtectedGetFn, &CommonValidators::PositiveFloat,
"Spacing between vertices in the WaterBlock mesh"); "Spacing between vertices in the WaterBlock mesh");
addProtectedFieldV("gridElementSize", TypeRangedF32, Offset(mGridElementSize, WaterBlock), &setGridSizeProperty, &defaultProtectedGetFn, &CommonValidators::PositiveFloat, "Duplicate of gridElementSize for backwards compatility");
addProtectedFieldV("gridElementSize", TypeRangedS32, Offset(mGridElementSize, WaterBlock), &setGridSizeProperty, &defaultProtectedGetFn, &CommonValidators::NaturalNumber,
"Duplicate of gridElementSize for backwards compatility");
Parent::initPersistFields(); Parent::initPersistFields();
} }

View file

@ -82,7 +82,7 @@ private:
GFXPrimitiveBufferHandle mRadialPrimBuff; GFXPrimitiveBufferHandle mRadialPrimBuff;
// misc // misc
U32 mGridElementSize; F32 mGridElementSize;
U32 mWidth; U32 mWidth;
U32 mHeight; U32 mHeight;
F32 mElapsedTime; F32 mElapsedTime;

View file

@ -45,6 +45,7 @@
#include "T3D/sfx/sfx3DWorld.h" #include "T3D/sfx/sfx3DWorld.h"
#include "sfx/sfxTypes.h" #include "sfx/sfxTypes.h"
#include "console/typeValidators.h" #include "console/typeValidators.h"
#include "gfx/gfxTransformSaver.h"
GFXImplementVertexFormat( GFXWaterVertex ) GFXImplementVertexFormat( GFXWaterVertex )
{ {
@ -699,6 +700,8 @@ void WaterObject::prepRenderImage( SceneRenderState *state )
if( !state->isDiffusePass() ) if( !state->isDiffusePass() )
return; return;
GFXTransformSaver saver;
// Setup scene transforms // Setup scene transforms
mMatrixSet->setSceneView(GFX->getWorldMatrix()); mMatrixSet->setSceneView(GFX->getWorldMatrix());
mMatrixSet->setSceneProjection(GFX->getProjectionMatrix()); mMatrixSet->setSceneProjection(GFX->getProjectionMatrix());

View file

@ -124,9 +124,7 @@ void WaterPlane::initPersistFields()
addProtectedFieldV( "gridSize", TypeRangedS32, Offset( mGridSize, WaterPlane ), &protectedSetGridSize, &defaultProtectedGetFn, &CommonValidators::NaturalNumber, addProtectedFieldV( "gridSize", TypeRangedS32, Offset( mGridSize, WaterPlane ), &protectedSetGridSize, &defaultProtectedGetFn, &CommonValidators::NaturalNumber,
"Spacing between vertices in the WaterBlock mesh" ); "Spacing between vertices in the WaterBlock mesh" );
addProtectedFieldV("gridElementSize", TypeRangedF32, Offset(mGridElementSize, WaterPlane), &protectedSetGridElementSize, &defaultProtectedGetFn, &CommonValidators::PositiveFloat, "Duplicate of gridElementSize for backwards compatility");
addProtectedFieldV( "gridElementSize", TypeRangedS32, Offset( mGridElementSize, WaterPlane ), &protectedSetGridElementSize, &defaultProtectedGetFn, &CommonValidators::NaturalNumber,
"Duplicate of gridElementSize for backwards compatility");
endGroup( "WaterPlane" ); endGroup( "WaterPlane" );
@ -699,6 +697,8 @@ void WaterPlane::prepRenderImage( SceneRenderState *state )
if( !state->isDiffusePass() ) if( !state->isDiffusePass() )
return; return;
GFXTransformSaver saver;
mBasicLighting = dStricmp( LIGHTMGR->getId(), "BLM" ) == 0; mBasicLighting = dStricmp( LIGHTMGR->getId(), "BLM" ) == 0;
mUnderwater = isUnderwater( state->getCameraPosition() ); mUnderwater = isUnderwater( state->getCameraPosition() );