Questions about PVR ...

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
User avatar
Newbie
Insane DCEmu
Insane DCEmu
Posts: 171
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sat Jul 27, 2013 1:16 pm
Has thanked: 0
Been thanked: 0

Questions about PVR ...

Post by Newbie »

I have some questions around PVR.

First, i have seen these structre in KOS :

Code: Select all

/** \brief  Generic PVR vertex type.

    The PVR chip itself supports many more vertex types, but this is the main
    one that can be used with both textured and non-textured polygons, and is
    fairly fast.

    \headerfile dc/pvr.h
*/
typedef struct {
    uint32  flags;              /**< \brief TA command (vertex flags) */
    float   x;                  /**< \brief X coordinate */
    float   y;                  /**< \brief Y coordinate */
    float   z;                  /**< \brief Z coordinate */
    float   u;                  /**< \brief Texture U coordinate */
    float   v;                  /**< \brief Texture V coordinate */
    uint32  argb;               /**< \brief Vertex color */
    uint32  oargb;              /**< \brief Vertex offset color */
} pvr_vertex_t;


I am wondering how z value could be used, especially what is the range of values and what it means.
I have also the same question about oargb what is it useful for ?

And to finish, i have not found a way to clear the screen after displaying textures. The only function i have seen is pvr_set_bg_color(0, 0, 0) but it does not clear anything.

Thanks a lot for your help.
User avatar
BB Hood
DC Developer
DC Developer
Posts: 189
Joined: Fri Mar 30, 2007 12:09 am
Has thanked: 41 times
Been thanked: 10 times

Re: Questions about PVR ...

Post by BB Hood »

Z Value: http://en.wikipedia.org/wiki/Z-buffering Basically helps arrange the order you want to draw things. Things could have the same x,y coordinates but z coordinate will tell you what to draw last (on top).

oargb: I dont know, not many people use from what I understand.

Clear the screen: This might help viewtopic.php?f=29&t=55103&hilit=clear+screen.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5659
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Questions about PVR ...

Post by BlueCrab »

In response to the question on clearing the screen... You shouldn't ever have to do it manually. The framebuffer is effectively cleared before each render is done. There's no way to clear the screen in the middle of a rendering pass, nor should there ever be any utility in doing so.
User avatar
Newbie
Insane DCEmu
Insane DCEmu
Posts: 171
Joined: Sat Jul 27, 2013 1:16 pm
Has thanked: 0
Been thanked: 0

Re: Questions about PVR ...

Post by Newbie »

As you said, here : viewtopic.php?f=29&t=55103&hilit=clear+screen, someone says that drawing nothing clears the screen.

So i use this solution by calling a PVR drawing sequence with an empty list.
User avatar
Newbie
Insane DCEmu
Insane DCEmu
Posts: 171
Joined: Sat Jul 27, 2013 1:16 pm
Has thanked: 0
Been thanked: 0

Re: Questions about PVR ...

Post by Newbie »

For oargb field it seems to be close to shading calculations.
Post Reply