PVR_LIST_PT_POLY list not working - pvr_params set

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
Sigeru
DCEmu Newbie
DCEmu Newbie
Posts: 4
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Mon Aug 16, 2021 12:40 pm
Has thanked: 0
Been thanked: 0

PVR_LIST_PT_POLY list not working - pvr_params set

Post by Sigeru »

Hi!

I'm trying to render some PT polys, using the code below, but nothing gets displayed.

Code: Select all

pvr_list_begin(PVR_LIST_PT_POLY);
{
	pvr_vertex_t *l_current_vert = &m_kos_vertices_pt[0];

	for (ui i = 0; i < m_faces_pt_count; i++)
	{
		pvr_poly_cxt_t l_context;
		pvr_poly_hdr_t l_header;

		DC_POLY *l_current_face = &m_dc_poly_pt[i];
		pvr_poly_cxt_txr(&l_context, PVR_LIST_PT_POLY, PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_TWIDDLED | PVR_TXRFMT_VQ_ENABLE, l_current_face->m_width, l_current_face->m_height, l_current_face->m_textid, PVR_FILTER_BILINEAR);
		pvr_poly_compile(&l_header, &l_context);
		pvr_prim(&l_header, sizeof(l_header));

		ui l_num_vertex = l_current_face->m_num_vertex; 
		for (ui j = 0; j < l_num_vertex; j++)
		{
			pvr_prim(l_current_vert, sizeof(pvr_vertex_t));             
			l_current_vert++;
		}
	}
			
}pvr_list_finish();
If I change all the occurrences of PVR_LIST_PT_POLY to PVR_LIST_OP_POLY in the code above it all works fine.

I initiliaze the PVR like so:

Code: Select all

pvr_init_params_t pvr_params = { { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16 },  512 * 1024 };
pvr_init(&pvr_params);
And the textures are PNGs converted with vqenc using the following options

Code: Select all

vqenc -v -t -q -k -a
I tried also with vqenc -v -t -q -k -b and PVR_TXRFMT_ARGB1555 but got the same result.

Any idea what I might be doing wrong?

Thanks!
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: PVR_LIST_PT_POLY list not working - pvr_params set

Post by BlueCrab »

How did you initialize the PVR in your code? The default setup in KOS does not enable the PT list, so if you used pvr_init_defaults() (or didn't call pvr_init() yourself at all), then PT polygons will not work.

You need to do something like this:

Code: Select all

int my_pvr_init(void) {
    pvr_init_params_t params = {
        /* Enable opaque, translucent, and punch-thru polygons with size 16 */
        { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16 },

        /* Vertex buffer size 512K */
        512 * 1024,

        /* No DMA */
        0,

        /* No FSAA */
        0,

        /* Translucent Autosort enabled. */
        0
    };

    return pvr_init(&params);
}
And, of course, call that function instead of pvr_init_defaults().
Sigeru
DCEmu Newbie
DCEmu Newbie
Posts: 4
Joined: Mon Aug 16, 2021 12:40 pm
Has thanked: 0
Been thanked: 0

Re: PVR_LIST_PT_POLY list not working - pvr_params set

Post by Sigeru »

Hey @BlueCrab many thanks for the response.

That's what I'm doing to set it up. The code was below the rendering one in my post. I was doing exactly the same except for setting to 0 the FSAA and the translucent part, but unfortunately initializing those to 0 doesn't change the result :(
Sigeru
DCEmu Newbie
DCEmu Newbie
Posts: 4
Joined: Mon Aug 16, 2021 12:40 pm
Has thanked: 0
Been thanked: 0

Re: PVR_LIST_PT_POLY list not working - pvr_params set

Post by Sigeru »

Ok, mistery solved. The alpha component in argb when setting the vertex was set to 0... Duh
Post Reply