Page 1 of 1

Change Ocean Material

Posted: Thu Jul 25, 2019 8:11 pm
by bowlmaster
I try to change the ocean material at runtime with no luck
Here is my code

Code: Select all

IMaterial NMat = Engine.Engine3D.GetMaterialManager.LoadMaterial("Materials/water/oceans/ocean_default.mtl"); Engine.Engine3D.GetITerrain().ChangeOceanMaterial(NMat);
any ideas?

Re: Change Ocean Material

Posted: Fri Jul 26, 2019 12:42 am
by mknmknmknjk
have you try flowgraph node SetOceanMat?

sourceCode is here。https://github.com/CRYTEK/CRYENGINE/blo ... s.cpp#L454

Re: Change Ocean Material

Posted: Fri Jul 26, 2019 8:28 am
by bowlmaster
have you try flowgraph node SetOceanMat?

sourceCode is here。https://github.com/CRYTEK/CRYENGINE/blo ... s.cpp#L454
In Flowgraph the material is changing and it is exactly the same code i use

Code: Select all

IMaterial* pMat = gEnv->p3DEngine->GetMaterialManager()->LoadMaterial(mat.c_str(), false); gEnv->p3DEngine->GetITerrain()->ChangeOceanMaterial(pMat);

Edit: It is working! i have set a wrong path. Sorry.