# How-To: Adjust scene light brightness

**URL:** <https://forum.techsoft3d.com/t/how-to-adjust-scene-light-brightness/1407>\
**Category:** HOOPS Visualize Desktop\
**Tags:** code, learn, knowledge-base, how-to\
**Created:** [May 12, 2022, 4:00am UTC](https://forum.techsoft3d.com/t/how-to-adjust-scene-light-brightness/1407 "2022-05-12T04:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel.peragine](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/gabriel.peragine/32/1535_2.png) [@gabriel.peragine](https://forum.techsoft3d.com/u/gabriel.peragine)\
**Post date:** [May 12, 2022, 4:00am UTC](https://forum.techsoft3d.com/t/how-to-adjust-scene-light-brightness/1407/1 "2022-05-12T04:00:00Z")

</div>

When using distant light in a HOOPS Visualize scene, you may want to adjust the brightness, and have a better contrast between darkest and brightest faces.

 ![image-20211221-081450](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/d1b3e119d69fa1084a857b2d8199a5af2defe01a.png)

## 📘 Instructions

### Too bright

Change the Specular value of the model to Gray to decrease the brightness or to Black to remove the spark on faces:

`ModelKey.GetMaterialMappingControl().SetFrontFaceColor(RGBAColor(0.0, 0.0, 0.0), Material::Color::Channel::Specular);`

 ![image-20211221-081649](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/8be64e6f44ade8bf4980899350b8241ad07f9e48.png)

### Too dark

Change the [Ambient Light](https://docs.techsoft3d.com/hps/latest/build/api_ref/cpp/class_h_p_s_1_1_material_mapping_kit.html#a997088c59b9e97c10f311a570a763f29) value of the model to Gray will light up the darkest faces:

`ModelKey.GetMaterialMappingControl().SetAmbientLightColor(RGBAColor(0.5, 0.5, 0.5));`

 ![image-20211221-082635](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/ba37b2602732551373b597cf9bc39047ed86e3ff.png)

### Combined example

Adjusting both color to balance the contrast between darkest and brightest faces:

```auto
ModelKey.GetMaterialMappingControl().SetFrontFaceColor(RGBAColor(0.1, 0.1, 0.1), Material::Color::Channel::Specular);
ModelKey.GetMaterialMappingControl().SetAmbientLightColor(RGBAColor(0.75, 0.75, 0.75));

```

 ![image-20211221-082644](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/98fcbf2e14291082113c702c46923cea116cc210.png)
