ISoftShaderContext

Functions

CID

GetClassID

const int *

GetStateVector

RenderCode &

GetRenderCode

const RenderCode &

GetRenderCode

void

GetProgramLocal

void

GetMatrixLocal

void

MatrixLocalMultiply4

Object *

GetTexture

double

GetGlossyAngle

double

GetGlossyAngleAniso

int

GetGlossySamplesCount

Detailed Description

class ISoftShaderContext : public RED::IREDObject

Shader evaluation context. Contains shader evaluation parameters.

@related The CPU Programming Pipeline, Writing a Custom Software Rendering Shader, class RED::ISoftRenderingContext, class RED::ISoftRayContext

Public Functions

virtual const int *GetStateVector() const = 0

Gets the state vector.

The state vector is unused if we are used for a render shader.

Returns

The statevector in this shader context.

virtual RenderCode &GetRenderCode() = 0

Gets the shader binding specification.

Returns

The address of the RED::RenderCode to use for this shader.

virtual const RenderCode &GetRenderCode() const = 0
virtual void GetProgramLocal(double oParameter[4], int iBindPos, const RED::ISoftRayContext &iRayContext, const RED::ISoftRenderingContext &iRenderContext) const = 0

Gets a program parameter.

Parameters
  • oParameter – Reference to the returned program local value.

  • iBindPos – Binding position of the parameter.

  • iRayContext – The actual ray context.

  • iRenderContext – The actual rendering context.

virtual void GetMatrixLocal(RED::Matrix &ioMatrix, int iBindPos, const RED::ISoftRayContext &iRayContext, const RED::ISoftRenderingContext &iRenderContext) const = 0

Gets a matrix parameter streamed as 4 program locals.

Parameters
  • ioMatrix – Receive the matrix components.

  • iBindPos – The matrix binding position (first row out of 4).

  • iRayContext – The actual ray context.

  • iRenderContext – The actual rendering context.

virtual void MatrixLocalMultiply4(double oVector[4], int iBindPos, double iVector[4], const RED::ISoftRayContext &iRayContext, const RED::ISoftRenderingContext &iRenderContext) const = 0

Homogeneous product of a vector by a local matrix.

Parameters
  • oVector – Resulting transformed vector (can be the same as ‘iVector’).

  • iBindPos – Binding position of the first matrix vector. If ‘iBindPos’ is negative, ‘oVector’ is returned equal to ‘iVector’.

  • iVector – Input vector.

  • iRayContext – The actual ray context.

  • iRenderContext – The actual rendering context.

virtual RED::Object *GetTexture(int iBindPos, const RED::ISoftRayContext &iRayContext, const RED::ISoftRenderingContext &iRenderContext) const = 0

Gets a shader texture.

Parameters
  • iBindPos – Binding position of the texture.

  • iRayContext – The actual ray context.

  • iRenderContext – The actual rendering context.

Returns

The texture address.

virtual double GetGlossyAngle() const = 0
Returns

the glossiness angle.

virtual double GetGlossyAngleAniso() const = 0
Returns

the anisotropic glossiness angle.

virtual int GetGlossySamplesCount() const = 0
Returns

The number of glossiness samples to fire.

Public Static Functions

static inline RED::CID GetClassID()