VTK
|
GLSL Shader. More...
#include <vtkShader2.h>
Public Types | |
typedef vtkObject | Superclass |
![]() |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
const char * | GetTypeAsString () |
void | Compile () |
bool | GetLastCompileStatus () |
const char * | GetLastCompileLog () |
virtual void | ReleaseGraphicsResources () |
virtual char * | GetSourceCode () |
virtual void | SetSourceCode (const char *) |
virtual int | GetType () |
virtual void | SetType (int) |
void | SetContext (vtkOpenGLRenderWindow *context) |
virtual vtkOpenGLRenderWindow * | GetContext () |
virtual unsigned int | GetId () |
virtual vtkUniformVariables * | GetUniformVariables () |
virtual void | SetUniformVariables (vtkUniformVariables *variables) |
![]() | |
virtual void | DebugOn () |
virtual void | DebugOff () |
unsigned char | GetDebug () |
void | SetDebug (unsigned char debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &os) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static vtkShader2 * | New () |
static int | IsTypeOf (const char *type) |
static vtkShader2 * | SafeDownCast (vtkObject *o) |
static bool | IsSupported (vtkOpenGLRenderWindow *context) |
static bool | LoadExtensions (vtkOpenGLRenderWindow *context) |
![]() | |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Protected Member Functions | |
vtkShader2 () | |
virtual | ~vtkShader2 () |
![]() | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &os) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
char * | SourceCode |
int | Type |
unsigned int | Id |
bool | LastCompileStatus |
char * | LastCompileLog |
size_t | LastCompileLogCapacity |
vtkTimeStamp | LastCompileTime |
vtkUniformVariables * | UniformVariables |
vtkOpenGLRenderWindow * | Context |
bool | ExtensionsLoaded |
bool | SupportGeometryShader |
![]() | |
unsigned char | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
![]() | |
int | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
GLSL Shader.
A vtkShader2 object is made of a source code encoded into a string and a type, identifying the hardware programmable stage it is attached to. Hardware programmable stages are (or will be)
Note: tessellation control shader is called hull shader in DirectX11 Note: tessellation evaluation shader is called domain shader in DirectX11 Ref: OpenGL spec 4.0 http://www.opengl.org/registry/doc/glspec40.core.20100311.withchanges.pdf Ref: "Introducing DirectX 11" http://www.gamasutra.com/view/feature/3759/sponsored_feature_introducing_.php
Definition at line 59 of file vtkShader2.h.
typedef vtkObject vtkShader2::Superclass |
Reimplemented from vtkObject.
Definition at line 63 of file vtkShader2.h.
|
protected |
Default constructor. SourceCode is NULL. Type is vertex.
|
protectedvirtual |
Destructor. Delete SourceCode and LastCompileLog if any.
|
static |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
|
virtual |
Reimplemented from vtkObject.
|
static |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
|
static |
Reimplemented from vtkObject.
|
virtual |
|
static |
Returns if the context supports the required extensions.
|
static |
Returns if the context supports the required extensions.
|
virtual |
String containing the shader source code. Reminder SetString makes a copy of its argument.
|
virtual |
String containing the shader source code. Reminder SetString makes a copy of its argument.
|
virtual |
Return the shader type, .
|
virtual |
Set the shader type, .
const char* vtkShader2::GetTypeAsString | ( | ) |
Return the shader type as a string.
void vtkShader2::Compile | ( | ) |
Compile the shader code. The result of compilation can be query with GetLastCompileStatus() The log of compilation can be query with GetLastCompileLog()
bool vtkShader2::GetLastCompileStatus | ( | ) |
Tells if the last call to compile succeeded (true) or not (false). Initial value is false.
const char* vtkShader2::GetLastCompileLog | ( | ) |
Return the log of the last call to compile as a string. Initial value is the empty string ""='\0'.
void vtkShader2::SetContext | ( | vtkOpenGLRenderWindow * | context | ) |
Get/Set the context. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.
|
virtual |
Get/Set the context. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.
|
virtual |
Release OpenGL resource (shader id).
|
virtual |
Return the OpenGL shader object id.
|
virtual |
Get/Set the list of uniform variables values. Initial value is an empty list (not null pointer).
|
virtual |
Get/Set the list of uniform variables values. Initial value is an empty list (not null pointer).
|
protected |
Definition at line 144 of file vtkShader2.h.
|
protected |
Definition at line 145 of file vtkShader2.h.
|
protected |
Definition at line 147 of file vtkShader2.h.
|
protected |
Definition at line 149 of file vtkShader2.h.
|
protected |
Definition at line 150 of file vtkShader2.h.
|
protected |
Definition at line 151 of file vtkShader2.h.
|
protected |
Definition at line 153 of file vtkShader2.h.
|
protected |
Definition at line 154 of file vtkShader2.h.
|
protected |
Definition at line 155 of file vtkShader2.h.
|
protected |
Definition at line 157 of file vtkShader2.h.
|
protected |
Definition at line 158 of file vtkShader2.h.