 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
HexDump
Joined: 07 Jun 2005 Posts: 70
|
Posted: Wed Apr 12, 2006 4:47 pm Post subject: Disable texturing... |
|
|
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 |
|
 |
memon
Joined: 03 Oct 2005 Posts: 63
|
Posted: Wed Apr 12, 2006 6:30 pm Post subject: |
|
|
| sceGuDisable(GU_TEXTURE_2D) disables sceGuEnable(GU_TEXTURE_2D) enables. |
|
| Back to top |
|
 |
HexDump
Joined: 07 Jun 2005 Posts: 70
|
Posted: Wed Apr 12, 2006 6:47 pm Post subject: |
|
|
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 |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Wed Apr 12, 2006 6:51 pm Post subject: |
|
|
| 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 |
|
 |
starman2049
Joined: 19 Sep 2005 Posts: 75
|
Posted: Thu Apr 13, 2006 7:18 am Post subject: |
|
|
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 |
|
 |
|
|
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
|