Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
anonymous_namespace{quantumglview.cpp} Namespace Reference

Functions

QColor probabilityContourColor (float normalizedLevel)
 Chooses the display color for a normalized probability-contour level.
 

Variables

const char * kVertexShader
 
const char * kSceneFragmentShader
 
const char * kBrightPassFragmentShader
 
const char * kGaussianBlurFragmentShader
 
const char * kBloomFragmentShader
 
const char * kToneMapFragmentShader
 
const char * kPotentialOverlayFragmentShader
 

Function Documentation

◆ probabilityContourColor()

QColor anonymous_namespace{quantumglview.cpp}::probabilityContourColor ( float normalizedLevel)

Chooses the display color for a normalized probability-contour level.

Parameters
normalizedLevelContour level normalized to the display range [0,1].
Returns
Color used only by the contour overlay renderer.

This mapping is a visualization choice and never modifies the underlying probability field or wave function.

Definition at line 1367 of file quantumglview.cpp.

Variable Documentation

◆ kBloomFragmentShader

const char* anonymous_namespace{quantumglview.cpp}::kBloomFragmentShader
Initial value:
= R"GLSL(
#version 330 core
in vec2 vTexCoord;
out vec4 fragColor;
uniform sampler2D uScene;
uniform sampler2D uBlurredHighlights;
uniform float uStrength;
void main()
{
vec3 scene = texture(uScene, vTexCoord).rgb;
vec3 glow = texture(uBlurredHighlights, vTexCoord).rgb;
float strength = clamp(uStrength, 0.0, 5.0);
// HDR additive bloom. Values above 1.0 are deliberately preserved in the
// RGBA16F target; the final pass applies tone mapping before display.
fragColor = vec4(scene + glow * strength, 1.0);
}
)GLSL"

Definition at line 294 of file quantumglview.cpp.

◆ kBrightPassFragmentShader

const char* anonymous_namespace{quantumglview.cpp}::kBrightPassFragmentShader
Initial value:
= R"GLSL(
#version 330 core
in vec2 vTexCoord;
out vec4 fragColor;
uniform sampler2D uScene;
uniform float uThreshold;
uniform float uSoftKnee;
void main()
{
vec3 rgb = texture(uScene, vTexCoord).rgb;
float luminance = dot(rgb, vec3(0.2126, 0.7152, 0.0722));
float threshold = clamp(uThreshold, 0.0, 1.0);
float knee = max(uSoftKnee, 0.0);
float maskValue;
if (knee <= 1.0e-7) {
maskValue = luminance >= threshold ? 1.0 : 0.0;
} else {
maskValue = smoothstep(threshold - knee,
threshold + knee,
luminance);
}
fragColor = vec4(rgb * maskValue, 1.0);
}
)GLSL"

Definition at line 228 of file quantumglview.cpp.

◆ kGaussianBlurFragmentShader

const char* anonymous_namespace{quantumglview.cpp}::kGaussianBlurFragmentShader

Definition at line 259 of file quantumglview.cpp.

◆ kPotentialOverlayFragmentShader

const char* anonymous_namespace{quantumglview.cpp}::kPotentialOverlayFragmentShader
Initial value:
= R"GLSL(
#version 330 core
in vec2 vTexCoord;
out vec4 fragColor;
uniform sampler2D uPotential;
uniform float uMaxAbsPotential;
uniform float uOverlayOpacity;
void main()
{
float potential = texture(uPotential, vTexCoord).r;
float threshold = max(1.0e-7, uMaxAbsPotential * 1.0e-6);
if (abs(potential) <= threshold) {
discard;
}
// Signed continuous-potential overlay, intentionally outside the HDR chain.
// Positive potential is warm, negative potential is cool. Alpha follows
// normalized |V| so smooth fields do not become a flat screen-wide veil.
float magnitude = clamp(abs(potential) / max(uMaxAbsPotential, 1.0e-7), 0.0, 1.0);
float shaped = sqrt(magnitude);
vec3 positiveColor = vec3(72.0 / 255.0);
vec3 negativeColor = vec3(0.08, 0.24, 0.46);
vec3 overlayColor = potential >= 0.0 ? positiveColor : negativeColor;
float signOpacity = potential >= 0.0 ? 1.0 : 0.35;
fragColor = vec4(overlayColor, clamp(uOverlayOpacity, 0.0, 1.0) * shaped * signOpacity);
}
)GLSL"

Definition at line 358 of file quantumglview.cpp.

◆ kSceneFragmentShader

const char* anonymous_namespace{quantumglview.cpp}::kSceneFragmentShader

Definition at line 65 of file quantumglview.cpp.

◆ kToneMapFragmentShader

const char* anonymous_namespace{quantumglview.cpp}::kToneMapFragmentShader

Definition at line 316 of file quantumglview.cpp.

◆ kVertexShader

const char* anonymous_namespace{quantumglview.cpp}::kVertexShader
Initial value:
= R"GLSL(
#version 330 core
out vec2 vTexCoord;
uniform vec2 uTexScale;
uniform vec2 uTexOffset;
void main()
{
vec2 position;
if (gl_VertexID == 0) {
position = vec2(-1.0, -1.0);
} else if (gl_VertexID == 1) {
position = vec2( 1.0, -1.0);
} else if (gl_VertexID == 2) {
position = vec2(-1.0, 1.0);
} else {
position = vec2( 1.0, 1.0);
}
vec2 baseTexCoord = position * 0.5 + 0.5;
vTexCoord = uTexOffset + baseTexCoord * uTexScale;
gl_Position = vec4(position, 0.0, 1.0);
}
)GLSL"

Definition at line 37 of file quantumglview.cpp.