Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
WSGLLightsProcessor Class Reference

Lights processor which outputs appropriate OpenGL commands for each enabled light in a scene.

#include <Rendering/OpenGL/Shaders/wsgllightsprocessor.h>

Inheritance diagram for WSGLLightsProcessor:
[legend]

Public Member Functions

 WSGLLightsProcessor ()
 
 ~WSGLLightsProcessor () override
 
bool process (WSGLShaderProgram &program, WSGLRenderer &renderer, const QList< Light * > &lights)
 
bool setLightingEnabled (bool b)
 
void setupUniforms (WSGLShaderProgram &program)
 
- Public Member Functions inherited from LightsProcessor
 ~LightsProcessor () override
 
bool process (const QList< Light * > &lights)
 
bool process (Scene &scene)
 
bool visit (AmbientLight &light)
 
bool visit (DirectionalLight &light)
 
bool visit (PointLight &light)
 
bool visit (SpotLight &light)
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 

Protected Member Functions

bool postVisits (const QList< Light * > &lights) override
 
bool preVisits (const QList< Light * > &lights) override
 
bool visitImpl (AmbientLight &light) override
 
bool visitImpl (DirectionalLight &light) override
 
bool visitImpl (PointLight &light) override
 
bool visitImpl (SpotLight &light) override
 
- Protected Member Functions inherited from LightsProcessor
 LightsProcessor ()
 
 LightsProcessor (const LightsProcessor &p)
 
void logText (const QString &msg)
 
LightsProcessoroperator= (const LightsProcessor &p)
 
virtual bool postVisits (const QList< Light * > &lights)
 
virtual bool postVisits (Scene &scene)
 
virtual bool preVisits (const QList< Light * > &lights)
 
virtual bool preVisits (Scene &scene)
 
virtual bool visitImpl (AmbientLight &light)
 
virtual bool visitImpl (DirectionalLight &light)
 
virtual bool visitImpl (PointLight &light)
 
virtual bool visitImpl (SpotLight &light)
 
- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Constructor & Destructor Documentation

◆ WSGLLightsProcessor()

◆ ~WSGLLightsProcessor()

~WSGLLightsProcessor ( )
override

Member Function Documentation

◆ postVisits()

bool postVisits ( const QList< Light * > &  lights)
overrideprotectedvirtual
Parameters
lightsThe list of lights which are being processed.

Alternative postVisits function for processing a list of lights, rather than the entire scene.

Returns
True if successful, false if an error was encountered.
See also
postVists(Scene&)

Reimplemented from LightsProcessor.

◆ preVisits()

bool preVisits ( const QList< Light * > &  lights)
overrideprotectedvirtual
Parameters
lightsThe list of lights which are being processed.

Alternative preVisits function for processing a list of lights, rather than the entire scene.

Returns
True if successful, false if an error was encountered.
See also
preVists(Scene&)

Reimplemented from LightsProcessor.

◆ process()

bool process ( WSGLShaderProgram program,
WSGLRenderer renderer,
const QList< Light * > &  lights 
)

◆ setLightingEnabled()

bool setLightingEnabled ( bool  b)

◆ setupUniforms()

void setupUniforms ( WSGLShaderProgram program)

◆ visitImpl() [1/4]

bool visitImpl ( AmbientLight light)
overrideprotectedvirtual

See visit() for details.

Returns
True if the light was successfully processed, or false if the function failed and processing should be aborted. The default implementation performs no action and simply returns true.

Reimplemented from LightsProcessor.

◆ visitImpl() [2/4]

bool visitImpl ( DirectionalLight light)
overrideprotectedvirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from LightsProcessor.

◆ visitImpl() [3/4]

bool visitImpl ( PointLight light)
overrideprotectedvirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from LightsProcessor.

◆ visitImpl() [4/4]

bool visitImpl ( SpotLight light)
overrideprotectedvirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from LightsProcessor.