3ds Max C++ API Reference
IReshadeFragment Class Referenceabstract

#include <IReshadeFragment.h>

+ Inheritance diagram for IReshadeFragment:

Public Member Functions

virtual int NChannels ()=0
 
virtual int NFirstChannel ()=0
 
virtual int NTextures ()=0
 
virtual Color32 Channel (int nChan)=0
 
virtual void SetChannel (int nChan, Color32 c)=0
 
virtual void AddChannel (Color32 c)=0
 
virtual void AddColorChannel (RGBA tex)=0
 
virtual void AddFloatChannel (float f)=0
 
virtual void AddIntChannel (int i)=0
 
virtual void AddUnitVecChannel (Point3 v)=0
 
virtual void AddPoint2Channel (Point2 p)=0
 
virtual void AddPoint3Channel (Point3 p)=0
 
virtual void SetColorChannel (int nChan, RGBA tex)=0
 
virtual void SetFloatChannel (int nChan, float f)=0
 
virtual void SetIntChannel (int nChan, int i)=0
 
virtual void SetUnitVecChannel (int nChan, Point3 v)=0
 
virtual void SetPoint2Channel (int nChan, Point2 p)=0
 
virtual void SetPoint3Channel (int nChan, Point3 p)=0
 
virtual RGBA GetColorChannel (int nChan)=0
 
virtual float GetFloatChannel (int nChan)=0
 
virtual int GetIntChannel (int nChan)=0
 
virtual Point3 GetUnitVecChannel (int nChan)=0
 
virtual Point2 GetPoint2Channel (int nChan)=0
 
virtual Point3 GetPoint3Channel (int nChan)=0
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

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

See also
Class InterfaceServer, Class IReshading, Class Point2, Class Point3

Description:
The Reshade Fragment interface is the materials/shaders/textures interface to reshading fragments. This interface is only concerned with saving and retrieving values in the fragments variable sized cache. Values are always saved in multiples of 32 bit words, and they can be a variety of types, colors, float's, int's, etc. Unit vectors are compressed to a single 32 bit word. Point2 and Point3 data types save multiple floats.

Color channels will be compressed to a 32 bit rgba color and saved in the cache.

Color32 channels are only used internally. This is the 'raw' form of what's stored, other forms may be accessed from this class.

Float and integer channels are stored uncompressed, they are stored directly in the 32 bits.

The Point2 & Point3 channels are shells that store multiple float channels so these values will be uncompressed. These should be used with great caution, as this memory is stored per fragment, in a scene with 100,000 fragments of a given material, a point3 channel will add 1.2 megabytes to the storage for the reshading buffer.

Member Function Documentation

◆ NChannels()

virtual int NChannels ( )
pure virtual
Remarks
This method returns the number of textures for the fragment.

◆ NFirstChannel()

virtual int NFirstChannel ( )
pure virtual
Remarks
This method returns the index of the first channel.

◆ NTextures()

virtual int NTextures ( )
pure virtual
Remarks
This method returns the number of textures.

◆ Channel()

virtual Color32 Channel ( int  nChan)
pure virtual
Remarks
This method returns the specified channel.
Parameters:
int nChan

The channel you wish to return.

◆ SetChannel()

virtual void SetChannel ( int  nChan,
Color32  c 
)
pure virtual
Remarks
This method allows you to set a channel in raw mode to a new value.
Parameters:
int nChan

The channel you wish to set.

Color32 c

The new value to set.

◆ AddChannel()

virtual void AddChannel ( Color32  c)
pure virtual
Remarks
This method allows you to add a new color channel in raw mode to the end of the cache.
Parameters:
Color32 c

The channel value you wish to set.

◆ AddColorChannel()

virtual void AddColorChannel ( RGBA  tex)
pure virtual
Remarks
This method allows you to add a new color channel to the end of the cache. The color will be compressed to 32bits.
Parameters:
RGBA tex

The color channel value you wish to add.

◆ AddFloatChannel()

virtual void AddFloatChannel ( float  f)
pure virtual
Remarks
This method allows you to add a float channel in the fragment cache.
Parameters:
float f

The channel value to add.

◆ AddIntChannel()

virtual void AddIntChannel ( int  i)
pure virtual
Remarks
This method allows you to add an integer channel in the fragment cache.
Parameters:
int i

The integer value to add.

◆ AddUnitVecChannel()

virtual void AddUnitVecChannel ( Point3  v)
pure virtual
Remarks
This method allows you to add a unit vector channel in the fragment cache, compressed to 32-bits.
Parameters:
Point3 v

The unit vector to add.

◆ AddPoint2Channel()

virtual void AddPoint2Channel ( Point2  p)
pure virtual
Remarks
This method allows you to add a Point2 channel in the fragment cache, uncompressed.
Parameters:
Point2 p

The Point2 to add.

◆ AddPoint3Channel()

virtual void AddPoint3Channel ( Point3  p)
pure virtual
Remarks
This method allows you to add a Point3 channel in the fragment cache, uncompressed.
Parameters:
Point3 p

The Point3 to add.

◆ SetColorChannel()

virtual void SetColorChannel ( int  nChan,
RGBA  tex 
)
pure virtual
Remarks
This method sets the existing color channel number nChan to the new value.
Parameters:
int nChan

The color channel number.

RGBA text

The new color value.

◆ SetFloatChannel()

virtual void SetFloatChannel ( int  nChan,
float  f 
)
pure virtual
Remarks
This method allows you to set a float channel in the fragment cache to a new value.
Parameters:
int nChan

The float channel number.

float f

The new value to set.

◆ SetIntChannel()

virtual void SetIntChannel ( int  nChan,
int  i 
)
pure virtual
Remarks
This method allows you to set an int channel in the fragment cache to a new value.
Parameters:
int nChan

The int channel number.

int i

The new value to set.

◆ SetUnitVecChannel()

virtual void SetUnitVecChannel ( int  nChan,
Point3  v 
)
pure virtual
Remarks
This method allows you to set a unit vector channel in the fragment cache to a new value.
Parameters:
int nChan

The unit vector channel number.

Point3 v

The new value to set.

◆ SetPoint2Channel()

virtual void SetPoint2Channel ( int  nChan,
Point2  p 
)
pure virtual
Remarks
This method allows you to set a Point2 channel in the fragment cache to a new value.
Parameters:
int nChan

The Point2 channel number.

Point2 p

The new value to set.

◆ SetPoint3Channel()

virtual void SetPoint3Channel ( int  nChan,
Point3  p 
)
pure virtual
Remarks
This method allows you to set a Point3 channel in the fragment cache to a new value.
Parameters:
int nChan

The Point3 channel number.

Point3 p

The new value to set.

◆ GetColorChannel()

virtual RGBA GetColorChannel ( int  nChan)
pure virtual
Remarks
This method will return an existing color channel, expanded to float RGBA.
Parameters:
int nChan

The color channel you wish to return.

◆ GetFloatChannel()

virtual float GetFloatChannel ( int  nChan)
pure virtual
Remarks
This method will return an existing float channel.
Parameters:
int nChan

The float channel you wish to return.

◆ GetIntChannel()

virtual int GetIntChannel ( int  nChan)
pure virtual
Remarks
This method will return an existing int channel.
Parameters:
int nChan

The int channel you wish to return.

◆ GetUnitVecChannel()

virtual Point3 GetUnitVecChannel ( int  nChan)
pure virtual
Remarks
This method will return an existing unit vector channel.
Parameters:
int nChan

The unit vector channel you wish to return.

◆ GetPoint2Channel()

virtual Point2 GetPoint2Channel ( int  nChan)
pure virtual
Remarks
This method will return an existing Point2 channel.
Parameters:
int nChan

The Point2 channel you wish to return.

◆ GetPoint3Channel()

virtual Point3 GetPoint3Channel ( int  nChan)
pure virtual
Remarks
This method will return an existing Point3 channel.
Parameters:
int nChan

The Point3 channel you wish to return.