and yet more cleanup...
This commit is contained in:
parent
26e855369d
commit
cf43538518
16 changed files with 80 additions and 107 deletions
|
|
@ -72,14 +72,7 @@ static void collect_face_to_mesh(const demo3d_bsp* bsp, const demo3d_bsp_render_
|
|||
f32 u = (pxl8_vec3_dot(pos, u_axis) + u_offset) / tex_scale;
|
||||
f32 v = (pxl8_vec3_dot(pos, v_axis) + v_offset) / tex_scale;
|
||||
|
||||
u8 light = 255;
|
||||
if (bsp->vertex_lights && vert_idx < bsp->num_vertex_lights) {
|
||||
u32 packed = bsp->vertex_lights[vert_idx];
|
||||
u8 direct = (packed >> 24) & 0xFF;
|
||||
u8 ao = (packed >> 16) & 0xFF;
|
||||
f32 combined = (f32)direct + ((f32)ambient / 255.0f) * (f32)ao;
|
||||
light = (u8)(combined > 255.0f ? 255.0f : combined);
|
||||
}
|
||||
u8 light = demo3d_bsp_vertex_light(bsp, vert_idx, ambient);
|
||||
|
||||
pxl8_vertex vtx = {
|
||||
.position = pos,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue