Data Structures | |
| struct | RpD3D9AttenuationParams |
Functions | |
| void | RpD3D9LightSetAttenuationParams (RpLight *light, const RpD3D9AttenuationParams *params) |
| void | RpD3D9LightGetAttenuationParams (const RpLight *light, RpD3D9AttenuationParams *params) |
RWD3D9 can create any number of lights. For video cards supporting hardware TnL, all lights will be in hardware but it is dependent on the driver as to how many are supported and how any lights beyond that limit are handled. Non-TnL video cards do not have this restriction. As a performance restriction it is recommended that a maximum of 9 lights are used.
RenderWare Graphics sums all ambient lights and sets the summed color as the constant ambient. rpLIGHTPOINT, rpLIGHTSPOT and rpLIGHTSPOTSOFT do not match generic RenderWare lighting equations but are close approximations.
Note that the lighting attenuation function used in D3D9 is different to that used in RenderWare. The function used in RWD3D9 is
1
-----------------------------------
L Q
C + --- * D + --------- * (D * D)
R (R * R)
where D is the distance to the vertex from the light source, R is the radius of the light and C, L and Q are the constant, linear and quadratic attenuation parameters, respectively.
The attentuation parameters are set by default to C = 1, L = 0, Q = 5.
|
||||||||||||
|
RpD3D9LightGetAttenuationParams is used to retrieve the attenuation parameters of the specified light. The world plugin must be attached before using this function.
|
|
||||||||||||
|
RpD3D9LightSetAttenuationParams is used to set the attenuation model of the supplied spot or point light. The default model specifies constant, linear and quadratic attenuation coefficients to be 1, 0, 5 respectively. The attenuation parameters are used as follows:
1
-----------------------------------
L Q
C + --- * D + --------- * (D * D)
R (R * R)
where D is the distance to the vertex from the light source, R is the radius of the light and C, L and Q are the constant, linear and quadratic attenuation parameters, respectively. The world plugin must be attached before using this function.
|
© 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:46:57 2004.
Send Feedback