gsKit, ZBuffer etc ...
Posted: Mon May 26, 2008 6:37 pm
Hi,
Need little help with gsKit. What I want is to make function
gsKit_prim_triangle_gouraud_3d()
to work similar to:
draw_triangles() from libdraw.
Point is to store all the vertices like draw_triangles() does.
I'm fresh here (ps2 code) so if i misunderstood smtg plese correct me.
Calculating color values and pasing them to gsKit function is not a problem (i get them using Z depth so it's simple gouraud - no light angle etc.)
draw_triangles() makes smtg like this:
[...]
GIF_SET_TAG(count, 1, 0, 0, GIF_TAG_REGLIST, 2).
then loops with sending XYZ and it's colour.
Count is number of points of triangles.
gsKit_prim_triangle_gouraud_3d() does:
[...]
*p_data++ = GS_SETREG_PRIM( GS_PRIM_PRIM_TRIANGLE,...[...]
then stores XYZ with colours of three points of one triangle.
I didn't find out how to make it with gsKit to use hw zbuffering. Sorting vertices by hand to get triangles that should be drawn first works but is not a solution i need.
Jah bless
Need little help with gsKit. What I want is to make function
gsKit_prim_triangle_gouraud_3d()
to work similar to:
draw_triangles() from libdraw.
Point is to store all the vertices like draw_triangles() does.
I'm fresh here (ps2 code) so if i misunderstood smtg plese correct me.
Calculating color values and pasing them to gsKit function is not a problem (i get them using Z depth so it's simple gouraud - no light angle etc.)
draw_triangles() makes smtg like this:
[...]
GIF_SET_TAG(count, 1, 0, 0, GIF_TAG_REGLIST, 2).
then loops with sending XYZ and it's colour.
Count is number of points of triangles.
gsKit_prim_triangle_gouraud_3d() does:
[...]
*p_data++ = GS_SETREG_PRIM( GS_PRIM_PRIM_TRIANGLE,...[...]
then stores XYZ with colours of three points of one triangle.
I didn't find out how to make it with gsKit to use hw zbuffering. Sorting vertices by hand to get triangles that should be drawn first works but is not a solution i need.
Jah bless