playcanvas / playcanvas/engine
Toksvig specular doesn't work
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Toksvig specular antialiasing has been broken in the engine for the last two years.
This was unintentionally broken when detail normal maps were added to the engine (see https://github.com/playcanvas/engine/pull/1968/files#diff-dc5bc7097c897bc531ef1e99641a4b3dbd3f70b96fd0c906e264c6f540771414R5).
Toksvig factor is based on the length of the dNormalMap vector as read from the texture/mipmap. The normalise call on this line results in length always being 1.0, effectively disabling toksvig.
We must decide how to proceed: either we re-enable toksvig support in the engine or we remote it.
| Keep | |
|---|---|
| Advantages |
|
| Disadvantage |
|
| Remove | |
|---|---|
| Advantages |
|
| Disadvantages |
|
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked pull request diff and the shader code around the dNormalMap normalise call. Determine whether Toksvig support should be restored or removed, then verify that the chosen direction addresses the stated specular aliasing and compatibility concerns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100