GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SG_LIGHT(3) FreeBSD Library Functions Manual SG_LIGHT(3)

SG_LightAgar-SG light source node

#include <agar/core.h>
#include <agar/sg.h>

The SG_Light node defines a light source in a SG(3) scene-graph. Each light source is associated with a priority number, which determines which lights are used in the rendering. The number of lights supported for rendering is dependent on the renderer implementation.

AG_Object(3) -> SG_Node(3) -> SG_Light.

SG_Light *
(SG_Node *parent, const char *name);


void
(SG_Light *lt, M_Color c);


void
(SG_Light *lt, M_Color c);


void
(SG_Light *lt, M_Color c);


void
(SG_Light *lt, M_Real cutoff, M_Real exponent, M_Vector3 dir);

The () function allocates, initializes, and attaches a SG_Light object.

The functions (), SG_LightDiffuse() and SG_LightSpecular() configure the colors associated with the ambient, diffuse and specular components of the light source.

() sets the spot parameters of the light source. cutoff specifies the cutoff angle in degrees, exponent specifies the light intensity (the higher the exponent, the more focused the light source; a value of 0 provides uniform distribution), and dir is the direction vector. If the cutoff angle is < 180 degrees, the light source is directional, otherwise it is treated as a point source and the direction vector is ignored.

void
SG_LightSetup(SG_Light *lt, SG_View *sv);

The () function sets up the renderer states associated with a light, prior to rendering. This function is usually invoked from the () operation of an SG_View(3) (or derived) widget, prior to rendering a scene.

For the SG_Light object:

int pri
Priority of light source when number of sources is limited (0 = highest priority).
M_Color ambient
Ambient color component of source.
M_Color diffuse
Diffuse color component of source.
M_Color specular
Specular color component of source.
M_Real spot_cutoff
Spotlight cutoff angle (or 180 for point source).
M_Real spot_exponent
Spotlight intensity distribution.
M_Vector3 spot_dir
Spotlight direction.
M_Real Kc
Constant light attenuation factor.
M_Real Kl
Linear light attenuation factor.
M_Real Kq
Quadratic light attenuation factor.

M_Real(3), M_Vector(3), SG(3), SG_Intro(3), SG_Node(3), SG_View(3)

The SG_Light node class first appeared in Agar 1.6.0.

December 21, 2022 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.