Change lighting for an object in display conduit


(Alexander Schiftner) #1

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.


(Steve Baer) #2

@jeff can you help here?


(Jeff Lasor) #3

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


(Alexander Schiftner) #4

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