forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Disable texturing...

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Wed Apr 12, 2006 4:47 pm    Post subject: Disable texturing... Reply with quote

Hi,

Perhaps this is a dumb question, but I did not find how to disable texturing. I mean, I want to render a textured cuad and a blue cuad (using vertex colors). I first render the textured cuad and set the corresponding texture, but to render the second one I need to set no texture in order to render using vertex color. I have tried to Set a texture of NULL with the sceSetImageTexture, but this hangs my console, any help please?.


Thanks in advance,
HexDump.
Back to top
View user's profile Send private message
memon



Joined: 03 Oct 2005
Posts: 63

PostPosted: Wed Apr 12, 2006 6:30 pm    Post subject: Reply with quote

sceGuDisable(GU_TEXTURE_2D) disables sceGuEnable(GU_TEXTURE_2D) enables.
Back to top
View user's profile Send private message
HexDump



Joined: 07 Jun 2005
Posts: 70

PostPosted: Wed Apr 12, 2006 6:47 pm    Post subject: Reply with quote

Dumb!, didnīt noticed that (late at night working).

Anyway I thought there were a way to do not render polys with textures without disabling textures all around. For example in dx you do a settexture(NULL), and although textures are activated it renders the polys using vertex colors.

Thanks mam,
HexDump.
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Wed Apr 12, 2006 6:51 pm    Post subject: Reply with quote

Code:
class VertexTEXTURED
{
  public:

  float u, v;         // UV-texture
  unsigned int color; // AABBGGRR no have to
  float x, y, z;
};

class VertexVertexPainted
{
  public:

  unsigned int color; // AABBGGRR no have to
  float x, y, z;
};

// for drawing textured
          /* Set texture as current texture for the GU */
          sceGuTexImage(0,mesh.texture_width, mesh.texture_height, mesh.texture_width, mesh.VRAM_pointer);

          // enable this when V4 will be released ;)
          sceGumDrawArray(GU_TRIANGLES,
                          GU_INDEX_16BIT | GU_TEXTURE_32BITF | GU_VERTEX_32BITF | GU_TRANSFORM_3D,
                          (int)mesh.faceCount * 3,
                          mesh.faces,
                          mesh.vertices);


//for drawing non-textured
          sceGumDrawArray(GU_TRIANGLES,
                          GU_INDEX_16BIT | GU_VERTEX_32BITF | GU_TRANSFORM_3D,
                          (int)mesh.faceCount * 3,
                          mesh.faces,
                          mesh.vertices);


this should work
btw: i did not find a better solution (use one struct to draw both types...)
if you find one let me know

greets
lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Thu Apr 13, 2006 7:18 am    Post subject: Reply with quote

PSP graphics rendering is state based, so you can in one frame sceGuEnable(GU_TEXTURE_2D) and render a bunch of textured triangles, then sceGuDisable(GU_TEXTURE_2D) and render a bunch of un-textured triangles and back and forth.

I use this method and it works for sure.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group