16#include <simplesquirrel/simplesquirrel.hpp>
23constexpr float kPi = 3.14159265f;
24constexpr float kMaxElevationDeg = 70.f;
25constexpr float kSkyCubeSize = 128;
26constexpr int kMaxFireflies = 8;
30inline float deg2rad(
float d) {
return d * kPi / 180.f; }
31inline float smoothstep(
float e0,
float e1,
float x) {
32 if (std::fabs(e1 - e0) < 1e-7f)
return x < e0 ? 0.f : 1.f;
33 const float t = std::clamp((
x - e0) / (e1 - e0), 0.f, 1.f);
34 return t *
t * (3.f - 2.f *
t);
41inline Vec3 add(Vec3
a, Vec3
b) {
return {
a.x +
b.x,
a.y +
b.y,
a.z +
b.z}; }
42inline Vec3 mul(Vec3
a, Vec3
b) {
return {
a.x *
b.x,
a.y *
b.y,
a.z *
b.z}; }
50Vec3 atmosphereRadiance(Vec3
view, Vec3 sun,
float turbidity,
float mieStrength) {
51 const float mu = std::clamp(
view.x * sun.x +
view.y * sun.y +
view.z * sun.z, -1.f, 1.f);
52 const float horizonMass = 1.f / std::max(0.08f,
view.y + 0.14f);
53 const float sunMass = 1.f / std::max(0.06f, sun.y + 0.12f);
54 const Vec3 betaR{0.055f, 0.130f, 0.285f};
55 const Vec3 betaM =
scale(Vec3{0.18f, 0.17f, 0.15f}, mieStrength * (0.35f + turbidity * 0.09f));
63 const float rayleighPhase = 3.f / (16.f * kPi) * (1.f +
mu *
mu);
64 const float g = std::clamp(0.72f + turbidity * 0.008f, 0.72f, 0.82f);
65 const float gg =
g *
g;
66 const float miePhase = (1.f - gg) /
67 (4.f * kPi * std::pow(std::max(0.015f, 1.f + gg - 2.f *
g *
mu), 1.5f));
68 const Vec3 scatter = add(
scale(betaR, rayleighPhase * 13.f),
69 scale(betaM, miePhase * 2.2f));
70 Vec3 sky = mul(mul(scatter, sunT), Vec3{1.f - viewT.x, 1.f - viewT.y, 1.f - viewT.z});
73 sky = add(sky,
scale(mul(sunT, Vec3{0.18f, 0.22f, 0.30f}),
74 0.12f + 0.18f * (1.f - std::max(
view.y, 0.f))));
78Vec3 toneMapSky(Vec3
c,
float exposure) {
79 c =
scale(
c, std::max(exposure, 0.01f));
82 auto channel = [](
float x) {
83 x = std::clamp((
x * (2.51f *
x + 0.03f)) /
84 (
x * (2.43f *
x + 0.59f) + 0.14f), 0.f, 1.f);
85 return std::pow(
x, 1.f / 2.2f);
87 return {channel(
c.x), channel(
c.y), channel(
c.z)};
90Vec3 attenuatedSunColor(
float sunElevation,
float turbidity,
float mieStrength) {
91 const float mass = 1.f / std::max(0.06f, sunElevation + 0.12f);
93 scale(Vec3{0.18f, 0.17f, 0.15f}, mieStrength * (0.35f + turbidity * 0.09f)));
96 const float maxChannel = std::max({
c.x,
c.y,
c.z, 1e-5f});
97 return scale(
c, 1.f / maxChannel);
100Vec3 correlatedColorTemperature(
float kelvin) {
101 const float t = std::clamp(kelvin, 1000.f, 40000.f) / 100.f;
102 const float r =
t <= 66.f ? 1.f : 1.2929362f * std::pow(
t - 60.f, -0.13320476f);
103 const float g =
t <= 66.f ? 0.39008158f * std::log(
t) - 0.63184144f
104 : 1.1298909f * std::pow(
t - 60.f, -0.07551485f);
105 const float b =
t >= 66.f ? 1.f
107 : 0.5432068f * std::log(
t - 10.f) - 1.1962541f;
108 return {std::clamp(
r, 0.f, 1.f), std::clamp(
g, 0.f, 1.f),
109 std::clamp(
b, 0.f, 1.f)};
112Vec3 manualSunColor(
const PcgManualSunState &sun) {
120inline void sunDirection(
float elevDeg,
float azimDeg,
float &
dx,
float &
dy,
float &
dz) {
121 const float el = deg2rad(elevDeg);
122 const float az = deg2rad(azimDeg);
123 const float he = std::cos(el);
124 dx = he * std::sin(
az);
126 dz = he * std::cos(
az);
130inline uint32_t hash13(uint32_t
x) {
138inline float hashUnit(uint32_t
x) {
return float(hash13(
x) % 10000u) / 9999.f; }
142void fillSkyFace(std::vector<uint8_t> &
px,
int size,
int face,
143 const float sunDir[3],
const Vec3 &directSunColor,
float sunEnergy,
145 float turbidity,
float mieStrength,
float exposure,
float cloudiness,
147 void (*dirAt)(
int face,
int size,
int x,
int y,
float out[3])) {
149 for (
int y = 0;
y <
n; ++
y) {
150 for (
int x = 0;
x <
n; ++
x) {
152 dirAt(face,
n,
x,
y,
d);
153 const float len = std::sqrt(
d[0] *
d[0] +
d[1] *
d[1] +
d[2] *
d[2]);
154 if (len < 1e-6f) {
d[0] = 0.f;
d[1] = 1.f;
d[2] = 0.f; }
155 else {
d[0] /= len;
d[1] /= len;
d[2] /= len; }
158 const float x =
d[0] * std::cos(
angle) +
d[2] * std::sin(
angle);
163 const float up =
d[1];
164 const Vec3 view{
d[0], std::max(
d[1], 0.002f),
d[2]};
165 const Vec3 sun{sunDir[0], sunDir[1], sunDir[2]};
166 Vec3 day = atmosphereRadiance(
view, sun, turbidity, mieStrength);
167 Vec3 night{0.006f + 0.012f * std::max(
up, 0.f),
168 0.010f + 0.020f * std::max(
up, 0.f),
169 0.035f + 0.070f * std::max(
up, 0.f)};
171 scale(night, nightAmount));
174 const float dot =
d[0] * sunDir[0] +
d[1] * sunDir[1] +
d[2] * sunDir[2];
177 const float disc = smoothstep(std::cos(deg2rad(0.65f)),
178 std::cos(deg2rad(0.35f)), dot) * sunEnergy;
179 const float sunMass = 1.f / std::max(0.06f, sun.y + 0.12f);
180 const Vec3 atmosphericSun{std::exp(-0.16f * sunMass),
181 std::exp(-0.28f * sunMass),
182 std::exp(-0.58f * sunMass)};
183 const Vec3 sunColor{atmosphericSun.x * directSunColor.x,
184 atmosphericSun.y * directSunColor.y,
185 atmosphericSun.z * directSunColor.z};
190 if (nightAmount > 0.5f &&
up > 0.05f && dot < 0.98f) {
191 uint32_t
h = hash13(uint32_t((
x * 73856093) ^ (
y * 19349663) ^ (face * 83492791)));
193 const float tw = 0.6f + 0.4f * hashUnit(
h + 1u);
194 star = nightAmount * tw;
197 color = add(
color,
scale(Vec3{0.9f, 0.95f, 1.f}, star * (1.f - cloudiness)));
198 const Vec3 overcast{0.075f + 0.035f * std::max(
up, 0.f),
199 0.090f + 0.045f * std::max(
up, 0.f),
200 0.125f + 0.060f * std::max(
up, 0.f)};
202 scale(overcast, cloudiness));
206 const int i = (
y *
n +
x) * 4;
207 px[i + 0] = uint8_t(std::clamp(
color.x * 255.f, 0.f, 255.f));
208 px[i + 1] = uint8_t(std::clamp(
color.y * 255.f, 0.f, 255.f));
209 px[i + 2] = uint8_t(std::clamp(
color.z * 255.f, 0.f, 255.f));
216void cubeDir(
int face,
int size,
int x,
int y,
float out[3]) {
217 const float u = (2.f * (float(
x) + 0.5f) /
float(
size)) - 1.f;
218 const float v = (2.f * (float(
y) + 0.5f) /
float(
size)) - 1.f;
220 case 0: out[0] = 1.f; out[1] = -
v; out[2] = -
u;
break;
221 case 1: out[0] = -1.f; out[1] = -
v; out[2] =
u;
break;
222 case 2: out[0] =
u; out[1] = 1.f; out[2] =
v;
break;
223 case 3: out[0] =
u; out[1] = -1.f; out[2] = -
v;
break;
224 case 4: out[0] =
u; out[1] = -
v; out[2] = 1.f;
break;
225 default: out[0] = -
u; out[1] = -
v; out[2] = -1.f;
break;
294 float h = std::fmod(hours, 24.f);
295 if (
h < 0.f)
h += 24.f;
345 const bool finite = std::isfinite(
state.pitchDegrees) &&
346 std::isfinite(
state.rotationDegrees) &&
347 std::isfinite(
state.intensity) && std::isfinite(
state.red) &&
348 std::isfinite(
state.green) && std::isfinite(
state.blue) &&
349 std::isfinite(
state.kelvin);
351 state.rotationDegrees < 0.f ||
state.rotationDegrees > 360.f ||
354 state.kelvin > 20000.f) {
357 "daynight.pcgManualSun"));
367 const bool finite = std::isfinite(
state.rotationDegrees) &&
368 std::isfinite(
state.exposure) && std::isfinite(
state.tintRed) &&
369 std::isfinite(
state.tintGreen) && std::isfinite(
state.tintBlue);
370 if (!
finite ||
state.rotationDegrees < 0.f ||
state.rotationDegrees > 360.f ||
371 state.exposure < 0.f ||
state.exposure > 30.f ||
state.tintRed < 0.f ||
372 state.tintGreen < 0.f ||
state.tintBlue < 0.f) {
375 "daynight.pcgSkybox"));
385 const float values[] = {
state.additionalLinearDistance,
state.additionalExponentialDensity,
388 state.globalDensityMultiplier,
state.densityAlbedoRed,
389 state.densityAlbedoGreen,
state.densityAlbedoBlue,
390 state.densityVolumeDistance};
392 if (!std::isfinite(
value))
396 const bool invalid =
state.additionalLinearDistance < -5000.f ||
397 state.additionalLinearDistance > 5000.f ||
398 state.additionalExponentialDensity < 0.f ||
399 state.additionalExponentialDensity > 0.05f ||
state.mode < 0 ||
402 state.startDistance < 0.f ||
state.startDistance > 5000.f ||
403 state.endDistance < 0.f ||
state.endDistance > 5000.f ||
404 state.globalDensityMultiplier < 0.f ||
405 state.globalDensityMultiplier > 5.f ||
406 state.densityAlbedoRed < 0.f ||
state.densityAlbedoGreen < 0.f ||
407 state.densityAlbedoBlue < 0.f ||
state.densityVolumeDistance < 0.01f ||
408 state.densityVolumeDistance > 1500.f ||
409 state.densityVolumeEffect < 0 ||
state.densityVolumeEffect > 4 ||
410 state.densityVolumeTiling < 0 ||
state.densityVolumeTiling > 5;
425 state.globalLightMultiplier};
430 "Pcg ambient-light values must be finite and non-negative", {}, {},
431 "daynight.pcgAmbientLight"));
433 if (
state.intensity > 10.f ||
state.globalLightMultiplier > 5.f)
436 "daynight.pcgAmbientLight"));
463 const Vec3
c = toneMapSky(atmosphereRadiance({std::sin(
angle), 0.04f, std::cos(
angle)},
473 const Vec3
c = toneMapSky(atmosphereRadiance({std::sin(
angle), 0.04f, std::cos(
angle)},
483 const Vec3
c = toneMapSky(atmosphereRadiance({std::sin(
angle), 0.04f, std::cos(
angle)},
492 const float night = impl_->
nightLight[1] ? 1.0f : 0.6f;
493 return 0.05f * night + impl_->
sunEnergy * 0.5f *
498 const float nextCloudiness = std::clamp(cloudiness, 0.f, 1.f);
502 impl_->
weatherFlash = std::clamp(lightningFlash, 0.f, 1.f);
509 return (
a.skyRed * 0.5f +
a.equatorRed * 0.35f +
a.groundRed * 0.15f) *
518 return (
a.skyGreen * 0.5f +
a.equatorGreen * 0.35f +
a.groundGreen * 0.15f) *
527 return (
a.skyBlue * 0.5f +
a.equatorBlue * 0.35f +
a.groundBlue * 0.15f) *
567 static constexpr float hazeDensity[] = {0.0025f, 0.005f, 0.01f, 0.02f, 0.04f};
580 const float modeScale = pcg.
mode == 2 ? 1.5f : 1.f;
593 {1.f, 0.f, 0.f}, {-1.f, 0.f, 0.f}, {0.f, 1.f, 0.f},
594 {0.f, -1.f, 0.f}, {0.f, 0.f, 1.f}, {0.f, 0.f, -1.f},
597 const float nightAmount = std::clamp((-impl_->
elevDeg) / 12.f, 0.f, 1.f);
598 const float skyRotation = deg2rad(
603 : Vec3{1.f, 1.f, 1.f};
604 for (
int face = 0; face < 6; ++face) {
606 const float rotatedX =
direction.x * std::cos(skyRotation) +
614 const Vec3 night{0.006f + 0.012f * std::max(
up, 0.f),
615 0.010f + 0.020f * std::max(
up, 0.f),
616 0.035f + 0.070f * std::max(
up, 0.f)};
618 scale(night, nightAmount));
619 const Vec3 overcast{0.075f + 0.035f * std::max(
up, 0.f),
620 0.090f + 0.045f * std::max(
up, 0.f),
621 0.125f + 0.060f * std::max(
up, 0.f)};
630 const float linearLuminance =
632 const float encodedLuminance =
635 face, encodedLuminance > 1e-4f ? linearLuminance / encodedLuminance : 1.f);
679 if (
int(impl_->
flies.size()) >= kMaxFireflies)
return;
682 f.seed = float(impl_->
flies.size()) * 1.7f;
683 impl_->
flies.push_back(
f);
686 l->
setColor(0.6f, 0.9f, 0.3f, 0.9f);
694 impl_->
flies.clear();
704 if (impl_->
built)
return;
723 for (
const auto &
f : impl_->
flies) {
725 l->
setColor(0.6f, 0.9f, 0.3f, 0.9f);
735 if (!impl_->
gfx)
return;
745 const float frac = (hours - 6.f) / 12.f;
746 float elevDeg = kMaxElevationDeg * std::sin(kPi * frac);
747 float azimDeg = (hours / 24.f) * 360.f;
754 elevDeg = std::asin(std::clamp(impl_->
sunDir[1], -1.f, 1.f)) * 180.f / kPi;
755 azimDeg = std::atan2(impl_->
sunDir[0], impl_->
sunDir[2]) * 180.f / kPi;
756 if (azimDeg < 0.f) azimDeg += 360.f;
758 sunDirection(elevDeg, azimDeg, impl_->
sunDir[0], impl_->
sunDir[1],
767 : std::clamp((elevDeg + 6.f) / 14.f, 0.f, 1.f);
768 const float nightAmount = std::clamp((-elevDeg) / 12.f, 0.f, 1.f);
784 directSun.x * impl_->
sunEnergy * weatherSun * globalLight + flashLight.x,
785 directSun.y * impl_->
sunEnergy * weatherSun * globalLight + flashLight.y,
786 directSun.z * impl_->
sunEnergy * weatherSun * globalLight + flashLight.z);
794 const int bucket = int(elevDeg) + int(azimDeg / 4.f) * 1000 +
798 std::vector<uint8_t> faces(
799 size_t(kSkyCubeSize) *
size_t(kSkyCubeSize) * 4 * 6);
800 for (
int f = 0;
f < 6; ++
f) {
801 std::vector<uint8_t> face(
802 size_t(kSkyCubeSize) *
size_t(kSkyCubeSize) * 4);
806 : Vec3{1.f, 1.f, 1.f};
807 fillSkyFace(face,
int(kSkyCubeSize),
f, impl_->
sunDir, directSun,
814 impl_->
skyFaces[
static_cast<size_t>(
f)] =
815 gfx->
newTexture(
int(kSkyCubeSize), int(kSkyCubeSize), face.data());
817 (size_t(kSkyCubeSize / 2) * size_t(kSkyCubeSize) + size_t(kSkyCubeSize / 2)) *
820 (
float(face[
center]) * 0.2126f + float(face[
center + 1]) * 0.7152f +
821 float(face[
center + 2]) * 0.0722f) /
823 std::memcpy(faces.data() +
size_t(
f) * face.size(), face.data(), face.size());
833 const bool night = elevDeg < 0.f;
837 const bool on = night && impl_->
nightLight[0];
852 for (
size_t i = 0; i < impl_->
flies.size(); ++i) {
855 const bool on = night && impl_->
nightLight[3];
860 f.y + std::sin(
t * 1.3f + 1.7f) * 0.4f,
861 f.z + std::cos(
t * 0.8f) * 0.6f);
871void DayNight::expose(ssq::Table &table) {
872 auto cls = table.addClass(
name, DayNight::create,
false);
877void DayNight::expose(ssq::Class &
cls) {
std::map< std::string, Var > values
std::array< float, 4 > rotation
std::array< float, 3 > scale
#define Module_IMPL(ModuleName, newExpr)
RoadLaneDirection direction
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
virtual std::string getName() const =0
Returns the name.
Move-only operation result carrying either a value or Status.
static Result success(T value)
Construct a successful result owning value.
static Result failure(Status status)
Construct a failed result from a structured status.
DayNight module — a time-of-day cycle that drives the sun, sky and light.
float getSpeed() const
Returns the speed.
float getWeatherFlash() const
Returns the weather flash.
float getSunR() const
Atmosphere-attenuated direct sunlight red channel, including intensity.
bool isPaused() const
True when paused.
int getFireflyCount() const
Returns the firefly count.
float getSunG() const
Atmosphere-attenuated direct sunlight green channel, including intensity.
PcgManualSunState getPcgManualSun() const noexcept
Return the authoritative manual-sun settings by value.
void applyReflectionProbeSky(graphics::ReflectionProbeCapture *probe) const
Synchronize linear directional sky radiance and sky IBL to a reflection probe.
float getSunDirY() const
Returns the sun dir y.
float getSkyR() const
Returns the sky r.
void applyAtmosphere(graphics::Volumetric *fog) const
Synchronize sun direction and atmosphere-derived fog lighting.
float getSkyG() const
Returns the sky g.
float getSkyB() const
Returns the sky b.
bool isNight() const
True when the sun is below the horizon (night).
float getSunDirZ() const
Returns the sun dir z.
void setPaused(bool paused)
Sets the paused.
void setSkyboxEnabled(bool enabled)
Sets the skybox enabled.
void clearFireflies()
Clears fireflies.
Result< void > setPcgManualSun(const PcgManualSunState &state)
Atomically replace the persistent Pcg manual-sun state.
void init(graphics::Graphics *gfx)
Idempotent; builds lights / sky cubemap on first call.
static const int kNamedLightCount
float getSunIntensity() const
0..1 sun energy; ramps to 0 below the horizon.
float getTimeOfDay() const
Returns the time of day.
float getAmbientR() const
Returns the ambient r.
bool isNightLight(const std::string &name) const
True when night light.
PcgFogState getPcgFog() const noexcept
Return the authoritative Pcg fog state by value.
float getAmbientB() const
Returns the ambient b.
Result< void > setPcgSkybox(const PcgSkyboxState &state)
Atomically replace Pcg's persistent skybox override.
float getSunAzimuth() const
Solar azimuth in degrees, measured clockwise from +Z.
PcgSkyboxState getPcgSkybox() const noexcept
Return the authoritative Pcg skybox override by value.
float getSkyExposure() const
Returns the sky exposure.
Result< void > setPcgAmbientLight(const PcgAmbientLightState &state)
Atomically replace Pcg ambient colors, intensity and direct-light multiplier.
Result< void > setPcgFog(const PcgFogState &state)
Atomically replace all Pcg fog and density-volume controls.
bool isSkyboxEnabled() const
True when skybox enabled.
void setFirePosition(float x, float y, float z)
Position of the campfire point light (fire system).
void addFirefly(float x, float y, float z)
Add one firefly anchor (world space); up to kMaxFireflies.
float getMieStrength() const
Returns the mie strength.
float getSunB() const
Atmosphere-attenuated direct sunlight blue channel, including intensity.
void setTurbidity(float turbidity)
Set aerosol turbidity. 1.5 is very clear; 10 is hazy.
PcgAmbientLightState getPcgAmbientLight() const noexcept
Return the authoritative Pcg ambient-light state by value.
float getAmbientG() const
Returns the ambient g.
~DayNight() override
Day night.
void setWeatherInfluence(float cloudiness, float lightningFlash)
Apply cloud cover and lightning exposure to the unified sky/lighting model.
static const char *const kNamedLights[]
float getTurbidity() const
Returns the turbidity.
void setSkyExposure(float exposure)
Exposure used when mapping physical sky radiance to the RGBA8 sky cubemap.
void setSpeed(float hoursPerRealHour)
Sets the speed.
float getSunElevation() const
Solar elevation in degrees (max at local noon, ~70°).
void setNightLight(const std::string &name, bool enabled)
Enable a named light system: "moonlight"|"starlight"|"fire"|"fireflies".
void setMieStrength(float strength)
Relative Mie aerosol density; controls horizon haze and solar halo.
float getAmbientBrightness() const
Returns the ambient brightness.
float getSunDirX() const
World-space direction pointing AT the sun (normalized).
float getWeatherCloudiness() const
Returns the weather cloudiness.
void setTimeOfDay(float hours)
Sets the time of day.
void update(float dt, graphics::Graphics *gfx)
Advance the clock and push sun/sky/light state; before gfx.render3D().
virtual Texture * newCubemap(int faceSize, const uint8_t *rgbaFaces)=0
Create an RGBA8 cubemap from 6 faces packed as +X,-X,+Y,-Y,+Z,-Z (each faceSize×faceSize,...
virtual void setDirectionalLight(float dx, float dy, float dz, float r=1.f, float g=1.f, float b=1.f)
Sets the directional light.
virtual void setBackgroundColorRGBA(float r, float g, float b, float a=1.f)
Sets the background color rgba.
virtual void setMesh3DEnv(Texture *cube, float intensity)=0
Specular IBL environment for subsequent default mesh draws. cube must be from newCubemap (or nullptr ...
virtual Texture * newTexture(int width, int height, const uint8_t *rgba, bool repeatU=false, bool repeatV=false)=0
Creates a texture. @ownership Caller deletes unless documented otherwise.
Declarative 3D light. Collected by RenderSystem3D (max 8 per frame). type: "point" | "dir" | "spot" (...
void setEnabled(bool enabled)
void setDirection(float dx, float dy, float dz)
void setPosition(float x, float y, float z)
static Light3D * createLight(const std::string &type="point")
void setRadius(float radius)
void setColor(float r, float g, float b, float intensity=1.f)
Incremental six-face HDR scene capture for a runtime reflection probe.
void setEnvironmentLighting(Texture *environment, float intensity=1.f)
Set non-recursive global environment lighting for captured geometry.
void setSkyFaceTextureScale(int face, float scale)
Set the linear HDR radiance multiplier for one sky face texture.
void setSkyFaceTexture(int face, Texture *texture)
Set a directional per-pixel sky texture for one capture face.
void setSkyFaceColor(int face, float r, float g, float b)
Override one directional backup sky face in +X,-X,+Y,-Y,+Z,-Z order.
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
float getFloat(const std::string &name) const
Returns the float.
void setMode(const std::string &mode)
"screenspace" | "raymarch" | "fog" | "froxel" | "cloud".
void setCloudLightColor(float r, float g, float b)
Direct sunlight color used by cloud single scattering.
void setFogEnd(float endDistance)
Sets the fog end.
std::string getMode() const
Returns the mode.
void setIntensity(float intensity)
Sets the intensity.
std::string getQuality() const
Returns the quality.
void setLightDirection(float dx, float dy, float dz)
World-space direction toward the lit surface (ray march / phase).
void setTime(float seconds)
Sets the time.
void setQuality(const std::string &quality)
"low" | "medium" | "high" (unknown → medium).
void setDensity(float density)
Sets the density.
void setFogStart(float startDistance)
View-distance ramp where fog appears (world units along the ray).
void setFogColor(float r, float g, float b)
Sets the fog color.
void exposeSkyScriptBindings(ssq::Table &table, ssq::Class &daynightClass)
Register independent sky bindings on the VM/graphics owner thread.
double dot(const Vec2 &a, const Vec2 &b)
Dot.
PcgManualSunState manualSun
std::vector< graphics::Light3D * > flyLights
std::array< float, 6 > skyFaceCenterLuminance
graphics::Volumetric * pcgFogTarget
std::string pcgFogBaseMode
graphics::Light3D * moonLight
graphics::Light3D * fireLight
std::string pcgFogBaseQuality
graphics::Texture * skyCube
std::array< graphics::Texture *, 6 > skyFaces
PcgAmbientLightState pcgAmbient
Pcg ambient-gradient colors and global direct-light multiplier.
float globalLightMultiplier
Joint Pcg Photo Mode fog and density-volume state.
float densityVolumeDistance
float globalDensityMultiplier
float additionalExponentialDensity
float additionalLinearDistance
bool overrideDensityVolume
Persistent manual sun settings projected from Pcg Photo Mode.
Persistent Pcg skybox override settings.
static TextureCreateInfo withMipmaps(bool aniso=true, float maxAniso=16.f)
With mipmaps.