![]() |
vrecko
virtual reality framework
|
#include <Lights.h>
Public Types | |
enum | shadowModes { NONE, SHADOW_MAP, SOFT_SHADOW_MAP } |
enum | shadingModes { GOURAUD, PHONG } |
enum | giModes { FULL, HALF, NO } |
![]() | |
typedef std::vector < ParameterStruct > | ParameterVector |
Vector of the description of parameters. More... | |
![]() | |
enum | NotificationTypes { NOTIFICATION_DELETE_CLASS = 1, NOTIFICATION_EO_REGISTERING = 2, NOTIFICATION_EO_UNREGISTERING = 4, NOTIFICATION_PROGRAM_TERMINATION = 8, NOTIFICATION_ALL = 0xFFFFFFFF } |
Public Member Functions | |
bool | loadXMLParameters (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode) |
virtual void | preInitialize () |
OBSOLETE METHOD, kept for backwards compatibility. More... | |
virtual void | postInitialize () |
OBSOLETE METHOD, kept for backwards compatibility. More... | |
Lights (void) | |
~Lights (void) | |
void | InitializeGI () |
int | add (osg::Vec4 position=osg::Vec4(0, 0, 0, 1), osg::Vec3 direction=osg::Vec3(0, 0,-1), float spotCutOff=180, float spotExp=0) |
int | add (osg::LightSource *lightSource) |
int | addSun (int day, int month, int year, int hour, int minute, osg::Vec4 *sunPosition=NULL) |
bool | remove (int lightNum) |
bool | removeAll () |
int | size () |
osg::Light * | at (int lightNum) |
osg::LightSource * | getLightSource (int lightNum) |
osg::Light * | getLight (int lightNum) |
bool | setLightVisibility (int lightNum, bool on) |
bool | setActiveShadowLight (int lightNum) |
void | enableShadows (bool OnOrOff) |
void | setMode (shadowModes shadowMode, shadingModes shadingMode, giModes giMode) |
bool | isShadowsEnabled () |
void | setClearColor (osg::Vec4 color) |
osg::Vec4 & | getClearColor () |
int | getCurrentShadowLightID () |
shadowModes | getCurrentShadowMode () |
shadingModes | getCurrectShadingMode () |
giModes | getCurrentGIMode () |
void | setGlobalAmbient (osg::Vec4 color) |
const osg::Vec4 | getGlobalAmbient () |
int | getDOSampleCount () |
float | getDORadius () |
int | getBounceSampleCount () |
float | getBounceRadius () |
int | getBlurSize () |
void | setDOSampleCount (int count) |
void | setDORadius (float radius) |
void | setBounceSampleCount (int count) |
void | setBounceRadius (float radius) |
void | setBlurSize (int size) |
void | createFlare (int lightNum) |
const osg::Vec4 & | getSunDate () |
osgShadow::ShadowTechnique * | getShadowTechnique () |
std::vector< osg::Node * > & | getFlares () |
osg::Texture2D * | createBuffer (osg::Vec2 textureSize, osg::Texture::FilterMode filter, osg::Texture::WrapMode wrap, GLint internalFormat, GLenum sourceFormat) |
void | setUpCamera (osg::ref_ptr< osg::Camera > camera, osg::Vec2 textureSize, osg::ref_ptr< osg::StateSet > camSS, osg::ref_ptr< osg::Shader > vert, osg::ref_ptr< osg::Shader > frag) |
![]() | |
virtual | ~Ability () |
copy constructor More... | |
const std::string & | getName () const |
Returns the ability name. More... | |
void | setPluginName (const char *pName) |
Sets the plugin name. More... | |
const std::string & | getPluginName (void) const |
Returns the plugin name. More... | |
const std::string & | getID (void) const |
Returns ability the identification string. More... | |
void | setID (const char *pID) |
(Internal usage, most people should not need to use it.) Sets the ability ID. More... | |
virtual void | clean (void) |
void | setOwner (BaseClass *owner) |
(Internal usage, most people should not need to use it.) Sets ability owner. *l This method is called automatically in World::createAbility(), so one would (almost?) never want to use it directly. More... | |
BaseClass * | getOwner (void) |
Returns the ability owner. More... | |
virtual ParameterVector * | getParameterVector (void) |
Return vector of the parameter description. More... | |
bool | isUpdated (void) |
Set update flag. More... | |
virtual const std::string & | getSenderString (void) |
Returns the identification string of sender. More... | |
![]() | |
BaseClass (const char *startingSenderString) | |
The main constructor. More... | |
BaseClass (BaseClass &bc) | |
Copy constructor. Probably not really used. More... | |
virtual | ~BaseClass () |
Destructor. More... | |
virtual bool | initialize (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters=NULL) |
Core initialization. More... | |
virtual bool | initializeFromString (const char *xmlString) |
Helper method that allows to initialize ability from a XML-formatted string. More... | |
virtual void | update (void) |
This method is called periodically in case this instance is registered in Scheduler. More... | |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * | saveXMLParameters (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *) |
Save current setting into a XML node. More... | |
bool | inputPresent (const std::string &name) |
Returns true if input pin (not request inputpin ) with given name is present. More... | |
bool | outputPresent (const std::string &name) |
Returns true if output pin (not request output pin) with given name is present. More... | |
void | addInputPin (InputPinBase *pin) |
Adds an input pin. More... | |
void | removeInputPin (InputPinBase *pin) |
Removes an input pin. More... | |
void | addOutputPin (OutputPinBase *pin) |
Adds an output pin. More... | |
void | removeOutputPin (OutputPinBase *pin) |
Removes and output pin. More... | |
void | addRequestInputPin (RequestInputPinBase *pin) |
Adds a request input pin. More... | |
void | removeRequestInputPin (RequestInputPinBase *pin) |
Removes a request input pin. More... | |
void | addRequestOutputPin (RequestOutputPinBase *pin) |
Adds a request output pin. More... | |
void | removeRequestOutputPin (RequestOutputPinBase *pin) |
Removes a request output pin. More... | |
bool | addNotification (BaseClass *receiver, unsigned long notificationTypes) |
Registers an observer that will be notified if a specific change occurs. More... | |
bool | removeNotification (BaseClass *receiver, unsigned long notificationTypes=NOTIFICATION_ALL) |
Unregisters a previously registered observer. More... | |
virtual void | processEvent (const std::string &input_name, VreckoMessage *pMessage) |
Internal method for processing the events. More... | |
virtual VreckoMessage * | processRequest (const std::string &request_input_name, VreckoMessage *pMessage) |
Internal method for processing the requests. More... | |
void | reportError (const std::string &error) |
Print error message. More... | |
void | setPriority (long int pr) |
Sets the priority. (Possible problems - read the full description for more info) More... | |
long int | getPriority (void) const |
Returns current object priority. More... | |
void | setAttribute (const std::string &attr_name, int attr_value) |
Sets an attribute value. More... | |
int | getAttribute (const std::string &attr_name) |
Returns attribute value. More... | |
int | getAttribute (const char *attr_name) |
Returns attribute value. More... | |
void | deleteAttribute (const std::string &attr_name) |
Delete an attribute. More... | |
void | setSceneFile (const std::string &sceneFileName) |
Set the name of the file this component was in (and possibly will be saved to). More... | |
const std::string & | getSceneFile () const |
Get the name of the file this component was in. More... | |
virtual bool | loadXMLParameters (const char *xmlString) |
OBSOLETE METHOD, kept for backwards compatibility. More... | |
InputPinBase * | getInputPin (const char *strName) |
Returns pointer to an input pin with specified name. More... | |
OutputPinBase * | getOutputPin (const char *strName) |
Returns pointer to an output pin with specified name. More... | |
RequestInputPinBase * | getRequestInputPin (const char *strName) |
Returns pointer to an request input pin with specified name. More... | |
RequestOutputPinBase * | getRequestOutputPin (const char *strName) |
Returns pointer to an input pin with specified name. More... | |
Public Attributes | |
enum APLightsEditor::Lights::shadowModes | shadowMode |
enum APLightsEditor::Lights::shadingModes | shadeMode |
enum APLightsEditor::Lights::giModes | giMode |
Additional Inherited Members | |
![]() | |
typedef std::map< std::string, int > | AttributeMap |
Attributes. More... | |
typedef std::vector < osg::ref_ptr< IOPinBase > > | PinList |
![]() | |
Ability (const char *theAbilityName) | |
![]() | |
BaseClass * | pOwner |
Pointer to the owner of this ability. (Almost?) always an EnvironmentObject class. More... | |
std::vector< std::string > | parameterString |
bool | updated |
Update flag. It is used for save. More... | |
APLightsEditor::Lights::Lights | ( | void | ) |
APLightsEditor::Lights::~Lights | ( | void | ) |
int APLightsEditor::Lights::add | ( | osg::Vec4 | position = osg::Vec4(0,0,0,1) , |
osg::Vec3 | direction = osg::Vec3(0,0,-1) , |
||
float | spotCutOff = 180 , |
||
float | spotExp = 0 |
||
) |
Creates a new light and put it in the scene
position | vec4 position of the light (if last coord is zero creates directional light) |
direction | vec3 direction of the light |
spotCutOff | angle from the light axis (only for spot lights) |
spotExp | light intensity exponent from spot center to edges |
int APLightsEditor::Lights::add | ( | osg::LightSource * | lightSource | ) |
Creates a new light and put it in the scene
lightSource | pointer to lightSource object |
int APLightsEditor::Lights::addSun | ( | int | day, |
int | month, | ||
int | year, | ||
int | hour, | ||
int | minute, | ||
osg::Vec4 * | sunPosition = NULL |
||
) |
Put Sun in the scene
osg::Light * APLightsEditor::Lights::at | ( | int | lightNum | ) |
Returns a specific light, if lightNum doesn't exist, returns NULL
osg::Texture2D * APLightsEditor::Lights::createBuffer | ( | osg::Vec2 | textureSize, |
osg::Texture::FilterMode | filter, | ||
osg::Texture::WrapMode | wrap, | ||
GLint | internalFormat, | ||
GLenum | sourceFormat | ||
) |
Creates texture object for render to texture
void APLightsEditor::Lights::createFlare | ( | int | lightNum | ) |
Creates a flare for specific light
void APLightsEditor::Lights::enableShadows | ( | bool | OnOrOff | ) |
Enable/disable shadows (only for PHONG shading)
int APLightsEditor::Lights::getBlurSize | ( | ) |
Returns size of blur kernel
float APLightsEditor::Lights::getBounceRadius | ( | ) |
Returns indirect bounce maximal radius
int APLightsEditor::Lights::getBounceSampleCount | ( | ) |
Returns indirect bounce sample count
osg::Vec4 & APLightsEditor::Lights::getClearColor | ( | ) |
Returns current background color
|
inline |
Returns current shading mode: PHONG, GORAUD
|
inline |
Returns current global illumination mode: FULL, HALF, NO
int APLightsEditor::Lights::getCurrentShadowLightID | ( | ) |
Returns ID of current shadow light
|
inline |
Returns current shadow mode: SHADOW_MAP, SOFT_SHADOW_MAP, NONE
float APLightsEditor::Lights::getDORadius | ( | ) |
Returns ambient occlusion maximal radius
int APLightsEditor::Lights::getDOSampleCount | ( | ) |
Returns ambient occlusion sample count
|
inline |
Returns billboarding flares as a vector of pointers
|
inline |
Returns the global ambient intensity
osg::Light * APLightsEditor::Lights::getLight | ( | int | lightNum | ) |
Returns light according to given lightNum, if there is no such light, returns NULL
osg::LightSource * APLightsEditor::Lights::getLightSource | ( | int | lightNum | ) |
Returns a light source, if light source with given lightNum doesn't exists, null is returned
osgShadow::ShadowTechnique * APLightsEditor::Lights::getShadowTechnique | ( | ) |
Returns current shadow technique, otherwise NULL
|
inline |
Returns a sun date as in vec4 format - saved as osg::Vec4(day,month,year,hour*60+minute)
void APLightsEditor::Lights::InitializeGI | ( | ) |
Initializes all necessary parameters for Global Illumination
bool APLightsEditor::Lights::isShadowsEnabled | ( | ) |
|
virtual |
|–ShadowTechnique, (ShadowMap,SoftShadowMap,None) | | | | //For ShadowMap and SoftShadowMap | |–TextureSize, (vec2) Size of the depth texture | | | | //For SoftShadowMap | |–JitteringScale (float) Set the values for jittering scale the shader will use. | | Zero is no jittering (i.e. see the banding in penumbra) | | High values (>64) cause 'pixelization' of the penumbra. | | Usually but not necessarily power of two number. | | Default is 32. | |–SoftnessWidth (float) Set the values for width of the soft penumbra the shader will use. | Zero is for hard shadow (no penumbra). 0.01 is already very soft penumbra. | Default is 0.005. | |–ShadingTechnique, (Gouraud,Phong) |–GlobalAmbient, (vec4) |–ClearColor, (vec4) |–Sun, (DD MM YYYY HH MM, SystemTime) | |–GlobalIlluminatonResolution, (Full, Half, No) Texture resolution of global illumination: | | Full - same size as viewport window; | | Half - half size of viewport window; | | No - global illumination is not computed. | | | |–AOSampleCount (int) Number of samples (different directions) per each pixel. | |–AOSamplesPerDirection (int) Number of samples per each direction. | |–AORadius (float) Radius of sampling, maximal length of sample. | |–DPSSampleCount (int) Number of samples per each pixel per each light. | |–DPSRadius (float) Radius of sampling. | |–PrimaryShadowTechnique (ShadowMap, SoftShadowMap, DPS) Primary shadow technique for scene | | with only one light source. | |–BounceSampleCount (int) Number of samples per each pixel. | |–BounceRadius (float) Radius of sampling, maximal length of sample. | |–BlurSize (int) Size of blur kernel. | |–LightList, | |–Light, | |–Position, (vec3) |–Direction, (vec3) |–Cutoff, (0.0 - 90.0) |–Exponent, (float) |–Ambient, (vec4) |–Diffuse, (vec4) |–Specular, (vec4) |–ConstAtt, (0.0 - 1.0) |–LinAtt, (0.0 - 1.0) |–QuadAtt, (0.0 - 1.0) |–ShadowLight, (0,1) |–LensFlare, (0,1)
Reimplemented from vrecko::BaseClass.
|
virtual |
OBSOLETE METHOD, kept for backwards compatibility.
The preInitialize(), loadXMLParameters() and postInitialize() methods were replaced in 2011 by a single method initialize().
Reimplemented from vrecko::BaseClass.
|
virtual |
OBSOLETE METHOD, kept for backwards compatibility.
The preInitialize(), loadXMLParameters() and postInitialize() methods were replaced in 2011 by a single method initialize().
Reimplemented from vrecko::BaseClass.
bool APLightsEditor::Lights::remove | ( | int | lightNum | ) |
Remove light form the scene and recount all lights IDs
bool APLightsEditor::Lights::removeAll | ( | ) |
Remove all lights from the scene
bool APLightsEditor::Lights::setActiveShadowLight | ( | int | lightNum | ) |
Set active shadow light return true if operation succeded
void APLightsEditor::Lights::setBlurSize | ( | int | size | ) |
Sets size of blur kernel
void APLightsEditor::Lights::setBounceRadius | ( | float | radius | ) |
Sets indirect bounce maximal radius
void APLightsEditor::Lights::setBounceSampleCount | ( | int | count | ) |
Sets indirect bounce sample count
void APLightsEditor::Lights::setClearColor | ( | osg::Vec4 | color | ) |
Set the background color
void APLightsEditor::Lights::setDORadius | ( | float | radius | ) |
Sets ambient occlusion maximal radius
void APLightsEditor::Lights::setDOSampleCount | ( | int | count | ) |
Sets ambient occlusion maximal radius
void APLightsEditor::Lights::setGlobalAmbient | ( | osg::Vec4 | color | ) |
Sets the global ambient intensity
bool APLightsEditor::Lights::setLightVisibility | ( | int | lightNum, |
bool | on | ||
) |
Set light visibility, works only for gouraud shading If lightNum doesn't exist, returns false
void APLightsEditor::Lights::setMode | ( | shadowModes | shadowMode, |
shadingModes | shadingMode, | ||
giModes | giMode | ||
) |
Testing method for changing shadow/shading modes, osgShadow is not fully implemented, so it's not working yet.
void APLightsEditor::Lights::setUpCamera | ( | osg::ref_ptr< osg::Camera > | camera, |
osg::Vec2 | textureSize, | ||
osg::ref_ptr< osg::StateSet > | camSS, | ||
osg::ref_ptr< osg::Shader > | vert, | ||
osg::ref_ptr< osg::Shader > | frag | ||
) |
Sets up camera for render to texture
int APLightsEditor::Lights::size | ( | ) |
Returns currect number of active lights
enum APLightsEditor::Lights::giModes APLightsEditor::Lights::giMode |
enum APLightsEditor::Lights::shadingModes APLightsEditor::Lights::shadeMode |
enum APLightsEditor::Lights::shadowModes APLightsEditor::Lights::shadowMode |