In P3D v4 I created a dynamic light from the example given in the PDK, my impression was there wasn't an effect needed. The light would appear anywhere I positioned it as long as the camera was not within 1 meter of its location. Here's the draw call:
void DrawLight(IObjectRendererV400* pRenderer, ObjectWorldTransform& objTrans, ObjectWorldTransform& cameraTrans)
{
// get body relative offset of camera and light box
ObjectLocalTransform objToCameraTrans;
pRenderer->CalculateBodyRelativeOffset(objTrans, cameraTrans, objToCameraTrans);
// calculate heading offset
int headingOffset = int(abs(objToCameraTrans.PBH.Heading)) % 360;
if (headingOffset > 180)
{
headingOffset -= 180;
}
// Add White color in based on heading offset
unsigned int color = WHITE_COLOR | (headingOffset << 16);
// draw a group to hold the light
pRenderer->BeginLightGroup(objTrans);
// add a light to the group
// X Y Z are positioning coordinates
pRenderer->AddLight(0.0, 0.656, 0.8, LIGHT_TYPE, color, LIGHT_WIDTH, 4000.0f, false);
// End the light group. Because it's attached to a sim object, sort this group
// to prevent drawing behind other transparent objects like clouds
pRenderer->EndLightGroup(true);
}
//bool m_bDrawGroundLightGrid;
bool m_bDrawCockpitLightGrid;
int m_uOneSecondTick;
// default light type and width
const float LIGHT_WIDTH = 1.0f;
const unsigned int LIGHT_TYPE = 1;