# \[Solved\] Debugging Normal Mapping

**URL:** https://discourse.libcinder.org/t/solved-debugging-normal-mapping/2132
**Category:** Using Cinder
**Created:** [July 26, 2025, 2:37pm UTC](https://discourse.libcinder.org/t/solved-debugging-normal-mapping/2132 "2025-07-26T14:37:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Gazoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gazoo/32/61_2.png) [@Gazoo](https://discourse.libcinder.org/u/Gazoo)
#### Post date: [July 26, 2025, 2:37pm UTC](https://discourse.libcinder.org/t/solved-debugging-normal-mapping/2132/1 "2025-07-26T14:37:32Z")

</div>

Hey 'Embers,

I’m trying to render a normal mapped sphere with a moon texture obtained from here:

> **[Computer rendering of the Earth and Moon |](https://richardandersson.net/?p=331)**

But for reasons that aren’t entirely clear to me, the render looks quite off and even super dark in spots. I’m using the vert/frag shader provided in the LibCinder `NormalMappingBasic` application with the specular highlight turned off.

I’m seeing two - possibly related issues:

 ![Screenshot 2025-07-26 163438](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/2X/f/f3136e83eeb33095e6ef2d2b3c9a993d184c555e.jpeg)

- The craters are clearly not lit correctly, they have the shadow on the ‘opposite side’.
- There are multiple strong dark patches that makes very little sense to me.

What I can confirm is that the normals and tangents look decent:

 ![Screenshot 2025-07-26 163404](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/2X/e/ee94223b2a521e6a29ddf6539251455a6721e12c.jpeg)

I’ve tried flipping the tangent (\* -1) without seeing the intended result, and I’m messed a fair bit with how the light source is placed but I feel like I’m kind of fumbling in the dark.

I’d much appreciate any concrete steps I could take to simplify the bug hunt I’m on, or - of course - a direct finger pointed at the likely culprit.

Cheers,  
Gazoo

---

<div class="post-metadata">

### Author: ![Gazoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gazoo/32/61_2.png) [@Gazoo](https://discourse.libcinder.org/u/Gazoo)
#### Post date: [August 6, 2025, 3:27pm UTC](https://discourse.libcinder.org/t/solved-debugging-normal-mapping/2132/2 "2025-08-06T15:27:53Z")

</div>

Turns out I’d forgotten to pass the bound texture IDs into the GLSL shader. I did bind the texture resources to texture ID’s, but then didn’t pass them properly.
