Skip to main content

Lighting and MaterialPreset

Scene3D currently supports ambient lighting plus a directional light.


Directional Light

sunEntity is scene.CreateEntity("Sun");
sun is sunEntity.AddDirectionalLight();
sun.SetColor(Color(1.0, 1.0, 1.0, 1.0));
sun.SetIntensity(1.2);

MaterialPreset Values

modelRenderer.SetMaterialStyle(MaterialPreset.Unlit);
modelRenderer.SetMaterialStyle(MaterialPreset.Lit);
  • Unlit: color and optional texture, no directional lighting
  • Lit: ambient plus single directional light contribution

No Numeric Presets

Use enum values only:

  • MaterialPreset.Unlit
  • MaterialPreset.Lit

Do not use raw integers like 0 or 1.


Next Steps