# 3D sphere is rendering flat

**URL:** <https://discourse.processing.org/t/3d-sphere-is-rendering-flat/2278>\
**Category:** Beginners\
**Created:** [August 1, 2018, 6:07pm UTC](https://discourse.processing.org/t/3d-sphere-is-rendering-flat/2278 "2018-08-01T18:07:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstarbell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jstarbell/32/970_2.png) [@jstarbell](https://discourse.processing.org/u/jstarbell)\
**Post date:** [August 1, 2018, 6:07pm UTC](https://discourse.processing.org/t/3d-sphere-is-rendering-flat/2278/1 "2018-08-01T18:07:32Z")

</div>

I’m so confused. I can’t seem to get anything to render shaded. Everything is just a flat color with no specular or diffusion.

Here is a simple example with one sphere:

void setup() {  
size(1000,1000,P3D);  
background(0);

lights();  
sphereDetail(30);  
}

void draw() {  
fill(192);  
noStroke();

pushMatrix();  
translate(width/2,height/2,0);  
sphere(100);  
popMatrix();  
}

Just creates this flat grey circle:

 ![Screenshot%20(104)](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/751de11b69533087b96c38c0b43f4b5a493a89c8.png)

I have tried adding directional lights, spot lights, changing the camera’s perspective, changing the sphere level of detail, and other shapes.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [August 1, 2018, 6:41pm UTC](https://discourse.processing.org/t/3d-sphere-is-rendering-flat/2278/2 "2018-08-01T18:41:23Z")

</div>

Does moving lights() to draw() fix it?

---

<div class="post-metadata">

**Author:** ![jstarbell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jstarbell/32/970_2.png) [@jstarbell](https://discourse.processing.org/u/jstarbell)\
**Post date:** [August 1, 2018, 6:43pm UTC](https://discourse.processing.org/t/3d-sphere-is-rendering-flat/2278/3 "2018-08-01T18:43:41Z")

</div>

Yes! Thank you Neil I am most grateful!

 ![Screenshot%20(106)c](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/6fb6cda839e4541b9ea5b003a8181aefbe6c2e33.png)
