coastline 0.0.4
Loading...
Searching...
No Matches
shadowclip.h File Reference
Include dependency graph for shadowclip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ShadowClipVertex
 A clipping link with a pointer to its attributes and inline vertex storage. More...
struct  ShadowClipPolygon
 A circular list of shadow vertices being clipped to a texture boundary. More...

Macros

#define SHADOW_CLIP_VERTEX_COUNT   64
 The number of entries of g_aShadowClipVertexPool.

Typedefs

typedef struct ShadowClipVertex ShadowClipVertex
 A clipping link with a pointer to its attributes and inline vertex storage.
typedef struct ShadowClipPolygon ShadowClipPolygon
 A circular list of shadow vertices being clipped to a texture boundary.
typedef long double(* ShadowClipDistance) (const ConvertedModelVertex *vertex)
 Compute a vertex's signed distance from a shadow-clipping boundary.

Functions

ShadowClipVertex * LerpShadowClipVertex (const ShadowClipVertex *first, const ShadowClipVertex *second, f32 fraction)
 Take a clipping node from the free list and interpolate all eight vertex components.
void ClipShadowPolygon (ShadowClipPolygon *polygon, ShadowClipDistance distance)
 Clip a circular polygon against a signed texture-boundary distance.

Variables

ShadowClipVertex g_aShadowClipVertexPool [SHADOW_CLIP_VERTEX_COUNT]
 The pool of the vertices of the clipping of shadows.
ShadowClipVertex * g_pShadowClipVertexFreeList
 The first free vertex of g_aShadowClipVertexPool.

Macro Definition Documentation

◆ SHADOW_CLIP_VERTEX_COUNT

#define SHADOW_CLIP_VERTEX_COUNT   64

The number of entries of g_aShadowClipVertexPool.

Typedef Documentation

◆ ShadowClipVertex

typedef struct ShadowClipVertex ShadowClipVertex

A clipping link with a pointer to its attributes and inline vertex storage.

◆ ShadowClipPolygon

typedef struct ShadowClipPolygon ShadowClipPolygon

A circular list of shadow vertices being clipped to a texture boundary.

◆ ShadowClipDistance

typedef long double(* ShadowClipDistance) (const ConvertedModelVertex *vertex)

Compute a vertex's signed distance from a shadow-clipping boundary.

Function Documentation

◆ LerpShadowClipVertex()

ShadowClipVertex * LerpShadowClipVertex ( const ShadowClipVertex * first,
const ShadowClipVertex * second,
f32 fraction )

Take a clipping node from the free list and interpolate all eight vertex components.

Parameters
firstThe vertex at fraction 0.
secondThe vertex at fraction 1.
fractionThe weight of the second vertex.
Returns
The allocated node, or null on pool exhaustion with patches enabled.
Ghidra address:
BRD3D: 0x10010b00
Ghidra address:
BRGlide: 0x1000e060

◆ ClipShadowPolygon()

void ClipShadowPolygon ( ShadowClipPolygon * polygon,
ShadowClipDistance distance )

Clip a circular polygon against a signed texture-boundary distance.

With patches enabled, pool exhaustion discards the polygon and recycles its nodes.

Parameters
polygonThe circular polygon to modify.
distanceThe signed distance callback.
Ghidra address:
BRD3D: 0x100109a0
Ghidra address:
BRGlide: 0x1000df00

Variable Documentation

◆ g_aShadowClipVertexPool

ShadowClipVertex g_aShadowClipVertexPool[SHADOW_CLIP_VERTEX_COUNT]
extern

The pool of the vertices of the clipping of shadows.

Ghidra address:
BRD3D: 0x102e54c0
Ghidra address:
BRGlide: 0x102e0ca8

◆ g_pShadowClipVertexFreeList

ShadowClipVertex* g_pShadowClipVertexFreeList
extern

The first free vertex of g_aShadowClipVertexPool.

Ghidra address:
BRD3D: 0x102e5ecc
Ghidra address:
BRGlide: 0x102e16b4