Ocean Modifier: Fix render resolution only used for baking

The modifier needs to check that the cached ocean has the correct
resolution.
This commit is contained in:
Hans Goudey 2020-08-03 15:33:32 -04:00
parent b5c737469d
commit 452b896f2d
1 changed files with 7 additions and 1 deletions

View File

@ -756,7 +756,13 @@ struct Ocean *BKE_ocean_add(void)
bool BKE_ocean_ensure(struct OceanModifierData *omd, const int resolution)
{
if (omd->ocean) {
return false;
/* Check that the ocean has the same resolution than we want now. */
if (omd->ocean->_M == resolution * resolution) {
return false;
}
else {
BKE_ocean_free(omd->ocean);
}
}
omd->ocean = BKE_ocean_add();