FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
SeabedLight.h
1#pragma once
2#ifdef FH_VISUALIZATION
3
4# include <OgrePass.h>
5# include <OgreVector.h>
6
7namespace visual
8{
9
11struct SeabedLight
12{
13 Ogre::Vector3 sunBelow {0.0f, 0.0f, 0.0f};
14 Ogre::Vector3 skyBelow {0.0f, 0.0f, 0.0f};
15 Ogre::Vector3 sunDown {0.0f, 0.0f, 1.0f};
16 Ogre::Vector2 rippleDir {1.0f, 0.0f};
17 Ogre::Vector4 mix {0.25f, 40.0f, 1.0f, 0.0f};
18};
19
26inline void ApplySeabedLight(Ogre::Pass* pass, const SeabedLight& light)
27{
28 if (!pass || !pass->hasFragmentProgram())
29 return;
30 auto fp = pass->getFragmentProgramParameters();
31 auto set = [&](const char* name, const auto& value) {
32 if (fp->_findNamedConstantDefinition(name, false))
33 fp->setNamedConstant(name, value);
34 };
35 set("sunBelow", light.sunBelow);
36 set("skyBelow", light.skyBelow);
37 set("sunDown", light.sunDown);
38 set("rippleDir", light.rippleDir);
39 set("seabedMix", light.mix);
40}
41
42} // namespace visual
43#endif
Visualization utilities.
Definition VisualDomain.h:12