If you’re already in a “Shaded” mode, then light calculations should be getting done. If they’re not, then either there is a bug, or you’re not drawing your meshes at the correct time within the pipeline.
Rhino’s display pipeline is driven by Display Mode Attributes, which get defined and set within the Display Mode Settings (Options->View->Display modes->[MODE]). There really isn’t any special processing made from one mode to the next… The only difference between each display mode, is that each one has specific settings that are set or unset compared to other modes.
For example: The only “main” difference between “Rendered” mode and “Shaded” mode, is that:
Render Mode has:
- “Color & material usage” set to “Rendering material”…which means use the materials assigned from the Material Editor/Library when shading…
- “Lighting method” set to “Scene lighting”…which means “Use the lights found in the scene/model to shade objects”
Shaded Mode has:
- “Color & material usage” set to “Custom material for all objects”, which you can drill down (“Customize…” button) and see how that’s configured.
- “Lighting method” is set to “Custom lighting”, which you can also drill down and see the lighting definitions (3 Directional lights).
So there’s really nothing different being done (internally) between the two modes…it’s just that each mode tells the pipeline where to get its information, and what that information contains will determine the final results.
Given that, if you’re drawing your meshes in the proper place within the pipeline, then your objects should “shade” exactly the same way all other Rhino objects are being shaded…if you’re in Rendered mode, then your objects should shade according to the lights within the scene. If you’re in Shaded mode, then your objects should shade according to the customized lights defined in the Shaded mode settings… The bottom line is that your objects should appear and shade the same as all/any other objects in the scene, according to whatever the current display mode is.
However, if you’re trying to draw shaded meshes in a Wireframe mode, then you need to make some minor changes… Wireframe modes have their “Lighting method” set to “Default lighting”…which for “wireframe” means “No lights at all”… If you want your meshes to shade in Wireframe, using the lights in your scene, then you need to set the “Wireframe” mode’s “Lighting method” to “Scene lighting” (just like Rendered mode does)… If you want your own custom lighting, then you should set the lighting method to “Custom lighting” and define the light(s) accordingly.
Most of the time when a plugin requires specific display modes settings to be made, the plugin defines and installs its own set of display attributes and display mode name(s) (i.e. “Albertos Mode1”, “Albertos Mode2”, etc…etc…), then the plugin can set the display mode to one of its desired modes, rather than require or expect the users to make the appropriate settings to the appropriate modes.
So having said all of that… Are you still having a problem getting your meshes to shade in a “Shaded” mode? And by “shaded”, I don’t necessarily mean Rhino’s “Shaded” mode, I mean any mode that requires shading of mesh objects… If you are, then I’d like to see your plugin code (or small example program that demonstrates the problem)…and I can then make the appropriate tweaks to get things working… If I wrote an example program here, I’m pretty sure it would work as I’d expect … So I really need to see what it is you’re doing…the small snippets of code aren’t enough… I want something I can compile, install and run.