Public Member Functions

IReshadeFragment Class Reference

Search for all occurrences

Detailed Description

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

Description:
This class is available in release 4.0 and later only.

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.

#include <imtl.h>

Inheritance diagram for IReshadeFragment:
Inheritance graph
[legend]

List of all members.

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

Member Function Documentation

virtual int NChannels ( ) [pure virtual]
Remarks:
This method returns the number of textures for the fragment.
virtual int NFirstChannel ( ) [pure virtual]
Remarks:
This method returns the index of the first channel.
virtual int NTextures ( ) [pure virtual]
Remarks:
This method returns the number of textures.
virtual Color32 Channel ( int  nChan ) [pure virtual]
Remarks:
This method returns the specified channel.
Parameters:
int nChan

The channel you wish to return.
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.
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.
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.

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment
IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment IReshadeFragment