ctx->arrindices = (u32*)(((u8*)buffer) + vertex_length);
}
-static void scene_vert_pack_norm( scene_vert *vert, v3f norm )
-{
+static void scene_vert_pack_norm( scene_vert *vert, v3f norm, f32 blend ){
v3f n;
v3_muls( norm, 127.0f, n );
v3_minv( n, (v3f){ 127.0f, 127.0f, 127.0f }, n );
vert->norm[0] = n[0];
vert->norm[1] = n[1];
vert->norm[2] = n[2];
- vert->norm[3] = 0; /* free byte :D */
+ vert->norm[3] = blend * 127.0f;
}
/*
v3f normal;
m3x3_mulv( normal_matrix, src->norm, normal );
- scene_vert_pack_norm( pvert, normal );
+ scene_vert_pack_norm( pvert, normal, src->colour[0]*(1.0f/255.0f) );
v2_copy( src->uv, pvert->uv );
}
.item_closest = scene_bh_closest,
.item_swap = scene_bh_swap,
.item_debug = scene_bh_debug,
+ .system_type = 0x1
};
/*
v3_copy( s->arrvertices[tri[i]].co, vs[i] );
f32 t;
- if( ray_tri( vs, co, dir, &t ) ){
+ if( ray_tri( vs, co, dir, &t, 0 ) ){
if( t < hit->dist ){
hit->dist = t;
hit->tri = tri;