3ds Max C++ API Reference
IPhysicalSunSky::ShadingParameters Struct Reference

Encapsulates the set of shading parameters for the Physical Sun & Sky. More...

#include <IPhysicalSunSky.h>

+ Inheritance diagram for IPhysicalSunSky::ShadingParameters:

Public Member Functions

 ShadingParameters ()
 

Public Attributes

float horizon_height
 Horizon height, as the sine of the angle offset for the horizon. More...
 
float horizon_blur
 Horizon blur range, as the sine of the angle over which the horizon is blurred. More...
 
Color global_multiplier
 Global multiplier, applied to the entire environment map (both sun and sky, as well as night color). May include tinting. More...
 
Color sun_illuminance
 The total illuminance of the sun (the integral of the contribution of the entire sun and sun glow). More...
 
Color sun_luminance
 The luminance of the sun. More...
 
float sun_glow_intensity
 Multiplier used in the intensity of the sun glow. More...
 
float sky_contribution_multiplier
 Multiplier for the sky contribution. More...
 
Color sky_ground_contribution
 The (approximated) integral of the sky contribution over the entire environment, used in illuminating the procedural ground plane. More...
 
float sun_disc_angular_radius
 Angular radius, in radians, of the sun disc. More...
 
float sun_smooth_angular_radius
 Angular radius, in radians, of smoothing/blur between the sun disc and sun glow. More...
 
float sun_glow_angular_radius
 Angular radius, in radians, of the sun glow region. More...
 
float color_saturation
 Saturation adjustment for the environment (both sun and sky). More...
 
Color color_tint
 Color adjustment (multiplier) for the environment (both sun and sky). More...
 
Color ground_color
 Color for the procedural/fake ground plane. More...
 
float night_falloff
 Multiplier for the sky color, to take into account that the sun has dipped below the horizon and that the sky should progressively get dimmer. More...
 
Color night_luminance
 Luminance for the night sky, used as a floor value for the sky luminance. In cd/m^2. More...
 
Point3 sun_direction
 The sun direction (pointing towards the sun). More...
 
Point3 sun_direction_for_sky_contribution
 This is the sun direction used when calculating the sky contribution. More...
 
Point3 perez_A
 The Perez coefficients used in calculating the brightness and color of the sky. More...
 
Point3 perez_B
 The Perez coefficients used in calculating the brightness and color of the sky. More...
 
Point3 perez_C
 The Perez coefficients used in calculating the brightness and color of the sky. More...
 
Point3 perez_D
 The Perez coefficients used in calculating the brightness and color of the sky. More...
 
Point3 perez_E
 The Perez coefficients used in calculating the brightness and color of the sky. More...
 
Point3 perez_Z
 The Perez coefficients used in calculating the brightness and color of the sky. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

Encapsulates the set of shading parameters for the Physical Sun & Sky.

These are the parameters which have been derived from the UI parameters, many of them pre-computed to optimize the shader at run-time. These parameters may be used directly with the shading function compute_sunsky_env_color(), which is defined in PhysSunSky.rtsl and included through PhysicalSunSkyShader.h, in maxsdk/samples/systems/sunlight.

Constructor & Destructor Documentation

◆ ShadingParameters()

ShadingParameters ( )
inline
30  : horizon_height(0.0f),
31  horizon_blur(0.0f),
32  global_multiplier(0.0f, 0.0f, 0.0f),
33  sun_illuminance(0.0f, 0.0f, 0.0f),
34  sun_luminance(0.0f, 0.0f, 0.0f),
35  sun_glow_intensity(0.0f),
37  sky_ground_contribution(0.0f, 0.0f, 0.0f),
41  color_saturation(0.0f),
42  color_tint(0.0f, 0.0f, 0.0f),
43  ground_color(0.0f, 0.0f, 0.0f),
44  night_falloff(1.0f),
45  night_luminance(0.0f, 0.0f, 0.0f),
46  sun_direction(0.0f, 0.0f, 0.0f),
47  sun_direction_for_sky_contribution(0.0f, 0.0f, 0.0f),
48  perez_A(0.0f, 0.0f, 0.0f),
49  perez_B(0.0f, 0.0f, 0.0f),
50  perez_C(0.0f, 0.0f, 0.0f),
51  perez_D(0.0f, 0.0f, 0.0f),
52  perez_E(0.0f, 0.0f, 0.0f),
53  perez_Z(0.0f, 0.0f, 0.0f)
54 {
55 
56 }
Color color_tint
Color adjustment (multiplier) for the environment (both sun and sky).
Definition: IPhysicalSunSky.h:117
float sun_smooth_angular_radius
Angular radius, in radians, of smoothing/blur between the sun disc and sun glow.
Definition: IPhysicalSunSky.h:106
Color night_luminance
Luminance for the night sky, used as a floor value for the sky luminance. In cd/m^2.
Definition: IPhysicalSunSky.h:125
Color sun_illuminance
The total illuminance of the sun (the integral of the contribution of the entire sun and sun glow).
Definition: IPhysicalSunSky.h:90
Point3 perez_D
The Perez coefficients used in calculating the brightness and color of the sky.
Definition: IPhysicalSunSky.h:142
Color ground_color
Color for the procedural/fake ground plane.
Definition: IPhysicalSunSky.h:120
Color global_multiplier
Global multiplier, applied to the entire environment map (both sun and sky, as well as night color)....
Definition: IPhysicalSunSky.h:86
float sun_disc_angular_radius
Angular radius, in radians, of the sun disc.
Definition: IPhysicalSunSky.h:104
float horizon_blur
Horizon blur range, as the sine of the angle over which the horizon is blurred.
Definition: IPhysicalSunSky.h:83
Color sky_ground_contribution
The (approximated) integral of the sky contribution over the entire environment, used in illuminating...
Definition: IPhysicalSunSky.h:101
Point3 perez_Z
The Perez coefficients used in calculating the brightness and color of the sky.
Definition: IPhysicalSunSky.h:144
Point3 sun_direction
The sun direction (pointing towards the sun).
Definition: IPhysicalSunSky.h:129
float night_falloff
Multiplier for the sky color, to take into account that the sun has dipped below the horizon and that...
Definition: IPhysicalSunSky.h:123
Point3 perez_A
The Perez coefficients used in calculating the brightness and color of the sky.
Definition: IPhysicalSunSky.h:139
float sun_glow_angular_radius
Angular radius, in radians, of the sun glow region.
Definition: IPhysicalSunSky.h:108
Color sun_luminance
The luminance of the sun.
Definition: IPhysicalSunSky.h:93
Point3 sun_direction_for_sky_contribution
This is the sun direction used when calculating the sky contribution.
Definition: IPhysicalSunSky.h:133
float sky_contribution_multiplier
Multiplier for the sky contribution.
Definition: IPhysicalSunSky.h:98
float sun_glow_intensity
Multiplier used in the intensity of the sun glow.
Definition: IPhysicalSunSky.h:95
float color_saturation
Saturation adjustment for the environment (both sun and sky).
Definition: IPhysicalSunSky.h:112
Point3 perez_E
The Perez coefficients used in calculating the brightness and color of the sky.
Definition: IPhysicalSunSky.h:143
Point3 perez_B
The Perez coefficients used in calculating the brightness and color of the sky.
Definition: IPhysicalSunSky.h:140
Point3 perez_C
The Perez coefficients used in calculating the brightness and color of the sky.
Definition: IPhysicalSunSky.h:141
float horizon_height
Horizon height, as the sine of the angle offset for the horizon.
Definition: IPhysicalSunSky.h:81

Member Data Documentation

◆ horizon_height

float horizon_height

Horizon height, as the sine of the angle offset for the horizon.

◆ horizon_blur

float horizon_blur

Horizon blur range, as the sine of the angle over which the horizon is blurred.

◆ global_multiplier

Color global_multiplier

Global multiplier, applied to the entire environment map (both sun and sky, as well as night color). May include tinting.

◆ sun_illuminance

Color sun_illuminance

The total illuminance of the sun (the integral of the contribution of the entire sun and sun glow).

This is used to fake lighting on the procedural ground plane.

◆ sun_luminance

Color sun_luminance

The luminance of the sun.

This is the value which, when multiplied with the sun/glow distribution function, gives us how much light is emitted (by the sun/glow) from a point in the sky.

◆ sun_glow_intensity

float sun_glow_intensity

Multiplier used in the intensity of the sun glow.

◆ sky_contribution_multiplier

float sky_contribution_multiplier

Multiplier for the sky contribution.

◆ sky_ground_contribution

Color sky_ground_contribution

The (approximated) integral of the sky contribution over the entire environment, used in illuminating the procedural ground plane.

◆ sun_disc_angular_radius

float sun_disc_angular_radius

Angular radius, in radians, of the sun disc.

◆ sun_smooth_angular_radius

float sun_smooth_angular_radius

Angular radius, in radians, of smoothing/blur between the sun disc and sun glow.

◆ sun_glow_angular_radius

float sun_glow_angular_radius

Angular radius, in radians, of the sun glow region.

◆ color_saturation

float color_saturation

Saturation adjustment for the environment (both sun and sky).

This is applied before the night color is added (and therefore doesn't affect the night color).

◆ color_tint

Color color_tint

Color adjustment (multiplier) for the environment (both sun and sky).

This is applied before the night color is added (and therefore doesn't affect the night color). This is applied after the saturation adjustment, making it possible to add some coloring back after removing saturation.

◆ ground_color

Color ground_color

Color for the procedural/fake ground plane.

◆ night_falloff

float night_falloff

Multiplier for the sky color, to take into account that the sun has dipped below the horizon and that the sky should progressively get dimmer.

This is applied to the sky contribution, before the night color is added.

◆ night_luminance

Color night_luminance

Luminance for the night sky, used as a floor value for the sky luminance. In cd/m^2.

◆ sun_direction

Point3 sun_direction

The sun direction (pointing towards the sun).

This direction is already adjusted to compensate for the horizon height; If the horizon is raised, then the sun is also raised such that it still sets at the horizon.

◆ sun_direction_for_sky_contribution

Point3 sun_direction_for_sky_contribution

This is the sun direction used when calculating the sky contribution.

This direction may differ from sun_direction: when the sun nears the horizon, this value is adjusted (with a smooth falloff) to avoid that the sky go directly to black after the sun reaches the horizon.

◆ perez_A

Point3 perez_A

The Perez coefficients used in calculating the brightness and color of the sky.

They are expressed as triplets:

  • x is for calculating the luminance Y
  • y and z are for calculating the chromacity xy *‍/

◆ perez_B

Point3 perez_B

The Perez coefficients used in calculating the brightness and color of the sky.

They are expressed as triplets:

  • x is for calculating the luminance Y
  • y and z are for calculating the chromacity xy *‍/

◆ perez_C

Point3 perez_C

The Perez coefficients used in calculating the brightness and color of the sky.

They are expressed as triplets:

  • x is for calculating the luminance Y
  • y and z are for calculating the chromacity xy *‍/

◆ perez_D

Point3 perez_D

The Perez coefficients used in calculating the brightness and color of the sky.

They are expressed as triplets:

  • x is for calculating the luminance Y
  • y and z are for calculating the chromacity xy *‍/

◆ perez_E

Point3 perez_E

The Perez coefficients used in calculating the brightness and color of the sky.

They are expressed as triplets:

  • x is for calculating the luminance Y
  • y and z are for calculating the chromacity xy *‍/

◆ perez_Z

Point3 perez_Z

The Perez coefficients used in calculating the brightness and color of the sky.

They are expressed as triplets:

  • x is for calculating the luminance Y
  • y and z are for calculating the chromacity xy *‍/