Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3681630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:42:32+00:00 2026-05-19T03:42:32+00:00

I bumped into a problem with normal mapping and surfaces pointing away from light.

  • 0

I bumped into a problem with normal mapping and surfaces pointing away from light. These surfaces should not be lit at all since they are not facing the light. However, it is possible that quite a few fragments from these surfaces will be lit if fragments’ normals happen to be bent enough. Artifacts caused by this are clearly visible e.g. on a box which has one side pointing directly away from light: almost all fragments of that side are black (as they are supposed to) but still couple of white fragments are visible (sorry, screenshot is not currently available but if you have done normal mapping before you should know what I am talking about).

I found a simple way to fix this in forward renderer: just multiply light intensity by (4*lightDirection.Z). Reasoning is that you should multiply light intensity by (clamped) dot product of light vector and surface’s normal vector (if face is pointing away, dot product will be negative and light intensity will be clamped to 0), and since we are doing calculations in tangent space, this normal is always (0,0,1) and thus dot product is simply lightDirection.z. Multiplier 4 is there just to make sure that light intensity will not drop (if face is not pointing away).

Now I tried to implement same functionality to deferred renderer but noticed soon that this simple approach will not work since I am doing calculations in world space. To do this calculation I would need both real normal of that fragment AND normal of the surface on which this fragment is located. Of course I could store this information to a texture but spending 3 more floats (or 2 if I was to pack them) just to do this trick seems quite expensive.

Are there any workarounds?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:42:33+00:00Added an answer on May 19, 2026 at 3:42 am

    In deferred shading you store normal in view space, so I think you just need to transform your light direction from world space to view space first, then you can do the same calculation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all,I'm not into web programming. I bumped into django and read a
Recently I bumped into a problem where my OpenGL program would not render textures
I am running php 5.3, and have bumped into a problem I've not encountered
I've bumped into a problem while working at a project. I want to crawl
I'm working on a quiz for school but I've bumped into a problem. I
Bumped into another templates problem: The problem: I want to partially specialize a container-class
I bumped into the following problem: I'm writing a Linux bash script which does
I've bumped into a strange problem. I wrote a little daemon in Perl which
Hi I bumped into this problem this morning (I've already found a work around)
I've recently bumped into facelift, an alternative to sIFR and I was wondering if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.