# Need help: problems with light and material of the 3d object

**URL:** <https://discourse.processing.org/t/need-help-problems-with-light-and-material-of-the-3d-object/29566>\
**Category:** Beginners\
**Tags:** homework\
**Created:** [April 22, 2021, 8:41pm UTC](https://discourse.processing.org/t/need-help-problems-with-light-and-material-of-the-3d-object/29566 "2021-04-22T20:41:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergio\_dm](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sergio\_dm](https://discourse.processing.org/u/sergio_dm)\
**Post date:** [April 22, 2021, 8:41pm UTC](https://discourse.processing.org/t/need-help-problems-with-light-and-material-of-the-3d-object/29566/1 "2021-04-22T20:41:20Z")

</div>

Hi everyone,  
for my university project I have implemented the marching cubes algorithm and everything seems to work, the only problem is that I can’t manage the lights and the surface material.  
Here is an example:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/af9a3997d66e774952cdfa35ed544bfa891fc67b.png)

The size of the grid to create the head is 106 \* 256 \* 256, the screen size is 700x700.  
could someone help me please, thank you very much

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [April 23, 2021, 8:43am UTC](https://discourse.processing.org/t/need-help-problems-with-light-and-material-of-the-3d-object/29566/2 "2021-04-23T08:43:13Z")

</div>

Hi! Welcome to the forum! If it’s an assignment please add “homework” tag to the topic.

It’s difficult to give comments without the code as some contexts are missing. How are the boxes rendered? Are you using standard box geometry provided by Processing or did you make a custom shader?

Surface material is technically not implemented in Processing. You can set parameters such as [`specular`](https://processing.org/reference/specular_.html), which may do the job, but they are rudimentary. [PBR](https://en.wikipedia.org/wiki/Physically_based_rendering) is more common in real time rendering (e.g., standard shaders in Unity) and gives realistic effects. But PBR is not included in Processing so you need to implement your own or use extensions such as:

> **[kosowski/SimplePBR](https://github.com/kosowski/SimplePBR/)**
>
> A Processing library providing physically based rendering and materials
