Rendering/ShadeContext.h File Reference

ShadeContext.h File Reference
#include "RenderGlobalContext.h"
#include "../BaseInterface.h"
#include "../Color.h"
#include "../AColor.h"
#include "../CoreExport.h"
#include "../Box3.h"

Classes

class  ShadeOutput
 
class  ShadeContext
 

Macros

#define N_MAX_RENDER_ELEMENTS   32
 
#define SHADECONTEXT_REGATHERING_FLAG   0x80000000
 
#define SHADECONTEXT_IS_REGATHERING(sc)    ( (sc).xshadeID & SHADECONTEXT_REGATHERING_FLAG )
 
#define SHADECONTEXT_PREPASS_FLAG   0x40000000
 
#define SHADECONTEXT_IS_PREPASS(sc)    ( (sc).xshadeID & SHADECONTEXT_PREPASS_FLAG )
 
#define SHADECONTEXT_RECURSIVE_EVAL_FLAG   0x20000000
 
#define SHADECONTEXT_IS_RECURSIVE_EVAL(sc)   ( (sc).xshadeID & SHADECONTEXT_RECURSIVE_EVAL_FLAG )
 
#define SHADECONTEXT_GUESS_SHADOWS_FLAG   0x10000000
 
#define SHADECONTEXT_GUESS_SHADOWS(sc)    ( (sc).xshadeID & SHADECONTEXT_GUESS_SHADOWS_FLAG )
 
#define SHADECONTEXT_THREAD_MASK   0x0000F000
 
#define SHADECONTEXT_THREAD_SHIFT   12
 
#define SHADECONTEXT_GET_THREAD(sc)    ( ( (sc).xshadeID & SHADECONTEXT_THREAD_MASK ) >> SHADECONTEXT_THREAD_SHIFT )
 
#define SHADECONTEXT_SET_THREAD(sc, thread)    { (sc).xshadeID = ( (sc).xshadeID & (~SHADECONTEXT_THREAD_MASK) ) | ( ( (thread) << SHADECONTEXT_THREAD_SHIFT ) & SHADECONTEXT_THREAD_MASK ); }
 
#define SHADECONTEXT_WORKER_MASK   0x00000F00
 
#define SHADECONTEXT_WORKER_SHIFT   8
 
#define SHADECONTEXT_GET_WORKER(sc)    ( ( (sc).xshadeID & SHADECONTEXT_WORKER_MASK ) >> SHADECONTEXT_WORKER_SHIFT )
 
#define SHADECONTEXT_SET_WORKER(sc, worker)    { (sc).xshadeID = ( (sc).xshadeID & (~SHADECONTEXT_WORKER_MASK) ) | ( ( (worker) << SHADECONTEXT_WORKER_SHIFT ) & SHADECONTEXT_WORKER_MASK ); }
 
#define SHADECONTEXT_BOUNCE_MASK   0x000000FF
 
#define SHADECONTEXT_GET_BOUNCE(sc)    ( (sc).xshadeID & SHADECONTEXT_BOUNCE_MASK )
 
#define SHADECONTEXT_SET_BOUNCE(sc, bounce)    { (sc).xshadeID = ( (sc).xshadeID & (~SHADECONTEXT_BOUNCE_MASK) ) | ( (bounce) & SHADECONTEXT_BOUNCE_MASK ); }
 
#define SHADECONTEXT_SET_REGATHERING_INFO(sc, thread, worker, bounce)
 

Enumerations

enum  RefFrame { REF_CAMERA =0, REF_WORLD, REF_OBJECT }
 
enum  SCMode {
  SCMODE_NORMAL = 0, SCMODE_SHADOW = 1, SCMODE_BAKE = 2, SCMODE_TEXMAP = 3,
  SCMODE_TEXTURE_BAKE = 4
}
 Values that may be assigned to ShadeContext::mode. More...
 

Macro Definition Documentation

#define N_MAX_RENDER_ELEMENTS   32
#define SHADECONTEXT_REGATHERING_FLAG   0x80000000
#define SHADECONTEXT_IS_REGATHERING (   sc)    ( (sc).xshadeID & SHADECONTEXT_REGATHERING_FLAG )
#define SHADECONTEXT_PREPASS_FLAG   0x40000000
#define SHADECONTEXT_IS_PREPASS (   sc)    ( (sc).xshadeID & SHADECONTEXT_PREPASS_FLAG )
#define SHADECONTEXT_RECURSIVE_EVAL_FLAG   0x20000000
#define SHADECONTEXT_IS_RECURSIVE_EVAL (   sc)    ( (sc).xshadeID & SHADECONTEXT_RECURSIVE_EVAL_FLAG )
#define SHADECONTEXT_GUESS_SHADOWS_FLAG   0x10000000
#define SHADECONTEXT_GUESS_SHADOWS (   sc)    ( (sc).xshadeID & SHADECONTEXT_GUESS_SHADOWS_FLAG )
#define SHADECONTEXT_THREAD_MASK   0x0000F000
#define SHADECONTEXT_THREAD_SHIFT   12
#define SHADECONTEXT_GET_THREAD (   sc)    ( ( (sc).xshadeID & SHADECONTEXT_THREAD_MASK ) >> SHADECONTEXT_THREAD_SHIFT )
#define SHADECONTEXT_SET_THREAD (   sc,
  thread 
)    { (sc).xshadeID = ( (sc).xshadeID & (~SHADECONTEXT_THREAD_MASK) ) | ( ( (thread) << SHADECONTEXT_THREAD_SHIFT ) & SHADECONTEXT_THREAD_MASK ); }
#define SHADECONTEXT_WORKER_MASK   0x00000F00
#define SHADECONTEXT_WORKER_SHIFT   8
#define SHADECONTEXT_GET_WORKER (   sc)    ( ( (sc).xshadeID & SHADECONTEXT_WORKER_MASK ) >> SHADECONTEXT_WORKER_SHIFT )
#define SHADECONTEXT_SET_WORKER (   sc,
  worker 
)    { (sc).xshadeID = ( (sc).xshadeID & (~SHADECONTEXT_WORKER_MASK) ) | ( ( (worker) << SHADECONTEXT_WORKER_SHIFT ) & SHADECONTEXT_WORKER_MASK ); }
#define SHADECONTEXT_BOUNCE_MASK   0x000000FF
#define SHADECONTEXT_GET_BOUNCE (   sc)    ( (sc).xshadeID & SHADECONTEXT_BOUNCE_MASK )
#define SHADECONTEXT_SET_BOUNCE (   sc,
  bounce 
)    { (sc).xshadeID = ( (sc).xshadeID & (~SHADECONTEXT_BOUNCE_MASK) ) | ( (bounce) & SHADECONTEXT_BOUNCE_MASK ); }
#define SHADECONTEXT_SET_REGATHERING_INFO (   sc,
  thread,
  worker,
  bounce 
)
Value:
{ (sc).xshadeID = SHADECONTEXT_REGATHERING_FLAG | \
( (bounce) & SHADECONTEXT_BOUNCE_MASK ); }
#define SHADECONTEXT_BOUNCE_MASK
Definition: ShadeContext.h:87
#define SHADECONTEXT_WORKER_MASK
Definition: ShadeContext.h:81
#define SHADECONTEXT_THREAD_SHIFT
Definition: ShadeContext.h:76
#define SHADECONTEXT_WORKER_SHIFT
Definition: ShadeContext.h:82
#define SHADECONTEXT_THREAD_MASK
Definition: ShadeContext.h:75
#define SHADECONTEXT_REGATHERING_FLAG
Definition: ShadeContext.h:56

Enumeration Type Documentation

enum RefFrame
Enumerator
REF_CAMERA 
REF_WORLD 
REF_OBJECT 
Definition: ShadeContext.h:32
Definition: ShadeContext.h:32
Definition: ShadeContext.h:32
enum SCMode

Values that may be assigned to ShadeContext::mode.

Enumerator
SCMODE_NORMAL 

In normal mode, the material should do the entire illumination including transparency, refraction, etc.

SCMODE_SHADOW 

In shadow mode, you are just trying to find out what color the shadow is that is falling on an object.In this case, all you care about is transmitted color.

SCMODE_BAKE 

Performing render to texture.

SCMODE_TEXMAP 

The shade context is currently used to render (or bake) a Texmap, for use as a preview in the material editor or for viewport display.

In this mode, no renderer is used - the texture map is evaluated directly.

SCMODE_TEXTURE_BAKE 

The shade context is currently used to bake a 2D Texmap, for use in a renderer/viewer that does not support the texmap.

The UVGenerator is disabled in this mode, so the unit square of the texture will be renderer. As in the previous mode, no renderer is used - the texture map is evaluated directly.

102 {
104  SCMODE_NORMAL = 0,
106  SCMODE_SHADOW = 1,
108  SCMODE_BAKE = 2,
111  SCMODE_TEXMAP = 3,
115 };
The shade context is currently used to render (or bake) a Texmap, for use as a preview in the materia...
Definition: ShadeContext.h:111
In normal mode, the material should do the entire illumination including transparency, refraction, etc.
Definition: ShadeContext.h:104
In shadow mode, you are just trying to find out what color the shadow is that is falling on an object...
Definition: ShadeContext.h:106
The shade context is currently used to bake a 2D Texmap, for use in a renderer/viewer that does not s...
Definition: ShadeContext.h:114
Performing render to texture.
Definition: ShadeContext.h:108