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
gsKit, ZBuffer etc ...
http://home.tele2.fr/~fr-51785/ps2_initial_fantasy.zip
(250000 vertices/frame 3D rendering loop)
Old stuff, but 'optimal' I think.
Note that gsKit is not used as main rendering loop, but used as comfortable graphic library for all non speed-sensitive 3D stuff.
(250000 vertices/frame 3D rendering loop)
Old stuff, but 'optimal' I think.
Note that gsKit is not used as main rendering loop, but used as comfortable graphic library for all non speed-sensitive 3D stuff.
Yes. It's the insane -probably professional- method. You prepare everything to go to gs through massive non-stop dma transferts.
I think you can still use gskit normal stuff to draw and it will act properly in regard of Z buffer. I mean, in order to have my little yellow line drawn I had to carefully choose the Z value.
I think you can still use gskit normal stuff to draw and it will act properly in regard of Z buffer. I mean, in order to have my little yellow line drawn I had to carefully choose the Z value.
Man, that Z value tip was what i need :) To draw it properly (object) i had tops2devman wrote: I think you can still use gskit normal stuff to draw and it will act properly in regard of Z buffer. I mean, in order to have my little yellow line drawn I had to carefully choose the Z value.
GS_ZTEST_ON, then call gsKit_prim_triangle_gouraud_3d() in loop with z1,z2,z3 set as positive integer value and GS_ZTEST_OFF. When Z is < 0 it doesn't sort vertices. Thx a lot and Jah bless.