3ds Max C++ API Reference
IPhysicalSunSky Class Referenceabstract

Access to functionality and properties of the Physical Sun & Sky environment map. More...

#include <IPhysicalSunSky.h>

+ Inheritance diagram for IPhysicalSunSky:

Classes

class  IShader
 An object which encapsulates the evaluation (shading) of the Physical Sun & Sky environment. More...
 
class  IShaderGenerator
 Provides facilities to initialize the shading parameters of the Physical Sun & Sky plugin. More...
 
struct  ShadingParameters
 Encapsulates the set of shading parameters for the Physical Sun & Sky. More...
 

Public Member Functions

virtual ShadingParameters EvaluateShadingParameters (const TimeValue t, Interval &validity) const =0
 Returns the shading parameters to be used for the Sun & Sky environment. More...
 
virtual std::unique_ptr< IShaderInstantiateShader (const TimeValue t, Interval &validity) const =0
 Instantiates a object which may be used for evaluating the Physical Sun & Sky environment. More...
 

Static Public Member Functions

static Class_ID GetClassID ()
 Returns the class ID for the physical sun & sky plugin. More...
 
- 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

Access to functionality and properties of the Physical Sun & Sky environment map.

This interface provides SDK access to the properties of the Physical Sun & Sky environment. To retrieve a pointer to this interface, perform a dynamic_cast on a Texmap.

Member Function Documentation

◆ GetClassID()

Class_ID GetClassID ( )
inlinestatic

Returns the class ID for the physical sun & sky plugin.

Note that IPhysicalSunSky is an interface which may be freely be implemented by any plugin. This class ID is therefore that of the standard Physical Sun & Sky plugin.

21 {
22  return Class_ID(0x223349b4, 0x562a7d8b);
23 }
Definition: maxtypes.h:154

◆ EvaluateShadingParameters()

virtual ShadingParameters EvaluateShadingParameters ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the shading parameters to be used for the Sun & Sky environment.

The source code for the Physical Sun & Sky shader is available in the maxsdk samples folder: maxsdk/samples/systems/sunlight/PhysicalSunSkyShader.h. A third party renderer may choose to implement this shader for rendering within 3ds Max. In that case, the parameters to be passed to the shader may be obtained from this method.

Parameters
tThe time at which to evaluate the parameters.
validityThe interval into which the validity of the evaluated parameters is intersected.
Returns
The shading parameters to be used with the standard shader.
Remarks
If possible, a third party renderer should avoid calling the shader itself, and should instead use the built-in shader returned by InstantiateShader().

◆ InstantiateShader()

virtual std::unique_ptr<IShader> InstantiateShader ( const TimeValue  t,
Interval validity 
) const
pure virtual

Instantiates a object which may be used for evaluating the Physical Sun & Sky environment.

A third-party plugin developer has three options for supporting the Physical Sun & Sky Environment:

  1. Calling Texmap::EvalColor().
  2. Implementing its own version of the shader, using the source code provided in maxsdk/samples/systems/sunlight/PhysicalSunSkyShader.h.
  3. Using the instance of IShader returned here.

The advantage of using this method is that it enables safe multi-threaded evaluation. The IShader that is returned here is completely independent of the the 3ds Max plugin, and may be evaluated or deleted at will, in a multi-threaded manner, by the client code.

Parameters
tThe time at which to evaluate the parameters.
validityThe interval into which the validity of the evaluated parameters is intersected.
Returns
A shading object which is henceforth owned by the caller.