Change lighting for an object in display conduit

Hi,
how do I change lighting for a single object to no lighting in a display conduit (channel SC_DRAWOBJECT)? I have tried

m_pDisplayAttrs->m_eLightingScheme = LS_NONE;

and

m_pChannelAttrs->m_eLightingScheme = LS_NONE;

but both didn’t help. I’m using m_pVP->DrawFalseColorMesh to display analysis results, for which lighting should be switched off.

@jeff can you help here?

Because of the way the multipass rendering pipeline works, you cannot disable lighting for individual objects simply by changing the lighting scheme.

Instead, this is controlled at the material level for each object. In your SC_DRAWOBJECT conduit you would do something like the following:

  CDisplayPipelineMaterial* dspMat = m_pDisplayAttrs->m_pMaterial;

  if ( (dspMat != NULL) && TURN_OFF_LIGHTING_FOR_THIS_OBJECT )
  {
    dspMat->m_FrontMaterial.m_bDisableLighting = true;
    dspMat->m_BackMaterial.m_bDisableLighting = true;
  }

The “TURN_OFF_LIGHTING_FOR_THIS_OBJECT” is something you need to determine (and it already sounds like you have this in place). Note: I disable both the front face and back face materials since some display modes can override backface materials.

Let me know if you have any questions.

Thanks,
-Jeff

Dear Jeff,
many thanks, work like a charm!
Alex