ssloy / ssloy/tinyrenderer

How to do the shadow mapping after perspective deformations?

Open
#130 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
24.3k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Hi, I am having a hard time doing the shadow mapping after changing my code according to the chapter "Technical difficulties: linear interpolation with perspective deformations".

My own thought about this problem is that we used the z-value of the original P, but the index (x+y*width) of the shadowBuffer for that z-value comes from the P', (original P after the MVP transformation). So, the pixel doesn't match the z-value.

Please correct me if I am wrong.

Also, I tried to download the sample code from the master branch and run it. But I didn't see the shadow, either. Does anyone successfully do the shadow mapping? Any hints would be helpful, I would appreciate it!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the chapter “Technical difficulties: linear interpolation with perspective deformations” and the sample code from the master branch. Trace how the original P, the MVP-transformed P', and shadowBuffer coordinates are used, then reproduce the reported run without visible shadows. Done means the coordinate/depth relationship is understood and shadow mapping works in the sample.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.