Browse Source

Added a separate CLUT for transparent surfaces, and set semi-transparency mode on water polygons.

unrollquadloop
Nico de Poel 3 years ago
parent
commit
314b52e99e
  1. BIN
      atlas-n64start.tim
  2. 1
      common.h
  3. 3
      draw.h
  4. 2
      main.c

BIN
atlas-n64start.tim

1
common.h

@ -26,5 +26,6 @@ extern SVECTOR cam_dir;
extern u_short cam_leaf; extern u_short cam_leaf;
extern u_short quake_clut; extern u_short quake_clut;
extern u_short water_clut;
#endif // __COMMON_H__ #endif // __COMMON_H__

3
draw.h

@ -289,6 +289,7 @@ static INLINE void draw_quadstrip_water(const ps1bsp_vertex_t *vertices, const p
// Draw a flat-shaded textured quad // Draw a flat-shaded textured quad
POLY_FT4 *poly = (POLY_FT4*)mem_prim(sizeof(POLY_FT4)); POLY_FT4 *poly = (POLY_FT4*)mem_prim(sizeof(POLY_FT4));
setPolyFT4(poly); setPolyFT4(poly);
setSemiTrans(poly, 1);
gte_stsxy3_ft3(poly); gte_stsxy3_ft3(poly);
// Transform the fourth vertex to complete the quad // Transform the fourth vertex to complete the quad
@ -298,7 +299,7 @@ static INLINE void draw_quadstrip_water(const ps1bsp_vertex_t *vertices, const p
// Texture UVs // Texture UVs
setUV4(poly, v0->u, v0->v, v1->u, v1->v, v2->u, v2->v, v3->u, v3->v); setUV4(poly, v0->u, v0->v, v1->u, v1->v, v2->u, v2->v, v3->u, v3->v);
poly->clut = quake_clut;
poly->clut = water_clut;
poly->tpage = tpage; poly->tpage = tpage;
// Unlit // Unlit

2
main.c

@ -17,6 +17,7 @@ u_short cam_leaf = 0;
world_t world; world_t world;
u_short quake_clut; u_short quake_clut;
u_short water_clut;
// BSP face rendering: // BSP face rendering:
// - Gather vertex data from face start index + length // - Gather vertex data from face start index + length
@ -35,6 +36,7 @@ void init(void)
ps1texture_t maptex; ps1texture_t maptex;
asset_loadTexture(tim_start, &maptex); asset_loadTexture(tim_start, &maptex);
quake_clut = getClut(maptex.crect.x, maptex.crect.y); quake_clut = getClut(maptex.crect.x, maptex.crect.y);
water_clut = getClut(maptex.crect.x, maptex.crect.y + 1);
world_load(bsp_test, &world); world_load(bsp_test, &world);
} }

Loading…
Cancel
Save