refactor: move world concepts into engine
This commit is contained in:
parent
eeedcb8e48
commit
2d15c7ab8d
52 changed files with 3298 additions and 1558 deletions
|
|
@ -115,8 +115,8 @@ export namespace Rasterizer {
|
|||
* NEAR_W) with a single Sutherland-Hodgman pass, writing the result (0, 3, or
|
||||
* 4 verts) to `dst` and returning its vertex count.
|
||||
*
|
||||
* This matters even when standing inside the room: a wall to your side has
|
||||
* vertices both in front of and behind the eye. Without clipping, the behind
|
||||
* Geometry intersecting the camera plane has vertices both in front of and
|
||||
* behind the eye. Without clipping, the behind
|
||||
* vertices have w <= 0 and invert under the perspective divide, smearing the
|
||||
* triangle across the whole screen (and risking divide-by-zero).
|
||||
*/
|
||||
|
|
@ -201,7 +201,7 @@ export namespace Rasterizer {
|
|||
return
|
||||
}
|
||||
// Backface cull: a back-facing triangle has positive area here. Only for
|
||||
// solid, consistently-wound meshes; sprites/room stay double-sided.
|
||||
// solid, consistently-wound meshes; other materials may stay double-sided.
|
||||
if (cull && area > 0) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue