Disable texturing...

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Disable texturing...

Post by HexDump »

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.
memon
Posts: 63
Joined: Mon Oct 03, 2005 10:51 pm

Post by memon »

sceGuDisable(GU_TEXTURE_2D) disables sceGuEnable(GU_TEXTURE_2D) enables.
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Post by HexDump »

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.
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

Code: Select all

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
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

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.
Post Reply