SVN PSPGL updated

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

Moderators: cheriff, TyRaNiD

Post Reply
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

SVN PSPGL updated

Post by jsgf »

I have now updated the SVN PSPGL to include everything in the goop.org PSPGL.
See http://www.goop.org/psp/gl for documentation about PSPGL.

Features:
  • Lots of standard OpenGL stuff
  • Textures cached in VRAM
  • Efficient vertex arrays
  • Vertex buffer objects
  • Hardware-generated mipmaps
  • Extensions for beziers and splines
  • Extension for skinning
  • Performance monitoring
As usual, work in progress, send me bugs, suggestions, etc.
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Post by Grom »

You're using a "convert" tool to convert images in samples. But I have no such tool in my WinXP/cygwin system.
I'm not a unix guru, please tell me how to install this tool.
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

convert is part of imagemagick, which should be listed in the cygwin setup.exe. If not, it can be downloaded from the homepage, http://www.imagemagick.org/script/binary-releases.php
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Post by Grom »

Thanks, rinco!
It works now.

I think, somebody have to upgrade http://wiki.ps2dev.org/psp:programming_faq
and write there about Imagemagick in cygwin installation.

I also found a problem - tests failed to compile because there is no .deps directory in ./tests. I added an empty ".deps" dir there and all started to work.
Last edited by Grom on Tue Nov 08, 2005 1:32 am, edited 1 time in total.
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Post by Grom »

..And it seems that unmount works improperly in cygwin. make install compiles and copies bezier to my PSP then fails:

Code: Select all

while [ ! -d /cygdrive/e/psp/game ]; do mount /cygdrive/e; sleep 1; done
PSP_MOUNTDIR=/cygdrive/e \
        ../tools/psp-install --psp-revision=1.50 bezier.elf \
        --eboot-title="bezier 2005/11/07 14:25:50" --eboot-icon="firefox.png"
install bezier.elf for rev1.50 on '/cygdrive/e/PSP/GAME/bezier/'...
umount /cygdrive/e
umount: /cygdrive/e: No such file or directory
make: *** [install-bezier] Error 1
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

Yeah, that stuff is probably a bit specific to my (linux-based) setup. I'll see if I can clean it up.
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Post by Grom »

We're trying to render a terrain with texture splatting. And following code doesn't work.
We need to modulate alpha values from texture with alpha values given in vertexes. Then to blend polygons with framebuffer using that alpha value. What are we doing wrong?

We're using latest pspgl from svn repository.

Code: Select all

...
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable( GL_TEXTURE_2D );
glDisable( GL_LIGHTING );
glDisable( GL_ALPHA_TEST );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;

glEnableClientState( GL_COLOR_ARRAY );

glUnlockArraysEXT() ;

glVertexPointer( 3, GL_FLOAT, sizeof(SMapVertex), &layer.pVertices->pos.x ) );
glTexCoordPointer( 2, GL_FLOAT, sizeof(SMapVertex), layer.pVertices->tex.x );
glNormalPointer( GL_FLOAT, sizeof(SMapVertex), &layer.pVertices->norm.x );
glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof(SMapVertex), &layer.pVertices->color );

glLockArraysEXT( 0, layer.nVertCount );
glDrawElements( GL_TRIANGLES, layer.nIndexCount, GL_UNSIGNED_SHORT, layer.pIndices );

glDisableClientState( GL_COLOR_ARRAY );
...
Dev-Express
Posts: 5
Joined: Tue Oct 11, 2005 4:07 am

Post by Dev-Express »

Haven't you missed the pointer in this call ?

glTexCoordPointer( 2, GL_FLOAT, sizeof(SMapVertex), &layer.pVertices->tex.x );

Try this...
User avatar
Thanhda
Posts: 331
Joined: Sat Apr 09, 2005 2:08 am
Location: Canada
Contact:

Post by Thanhda »

Grom wrote:We're trying to render a terrain with texture splatting. And following code doesn't work.
We need to modulate alpha values from texture with alpha values given in vertexes. Then to blend polygons with framebuffer using that alpha value. What are we doing wrong?

We're using latest pspgl from svn repository.

Code: Select all

...
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable( GL_TEXTURE_2D );
glDisable( GL_LIGHTING );
glDisable( GL_ALPHA_TEST );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;

glEnableClientState( GL_COLOR_ARRAY );

glUnlockArraysEXT() ;

glVertexPointer( 3, GL_FLOAT, sizeof(SMapVertex), &layer.pVertices->pos.x ) );
glTexCoordPointer( 2, GL_FLOAT, sizeof(SMapVertex), layer.pVertices->tex.x );
glNormalPointer( GL_FLOAT, sizeof(SMapVertex), &layer.pVertices->norm.x );
glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof(SMapVertex), &layer.pVertices->color );

glLockArraysEXT( 0, layer.nVertCount );
glDrawElements( GL_TRIANGLES, layer.nIndexCount, GL_UNSIGNED_SHORT, layer.pIndices );

glDisableClientState( GL_COLOR_ARRAY );
...
your supose to pass the code into the GLCHK(); function. example

Code: Select all

GLCHK(glDisable(GL_STENCIL_TEST));
try that.
There are 10 types of people in the world: Those who understand binary, and those who don't...
User avatar
Thanhda
Posts: 331
Joined: Sat Apr 09, 2005 2:08 am
Location: Canada
Contact:

Re: SVN PSPGL updated

Post by Thanhda »

jsgf wrote:I have now updated the SVN PSPGL to include everything in the goop.org PSPGL.
See http://www.goop.org/psp/gl for documentation about PSPGL.

Features:
  • Lots of standard OpenGL stuff
  • Textures cached in VRAM
  • Efficient vertex arrays
  • Vertex buffer objects
  • Hardware-generated mipmaps
  • Extensions for beziers and splines
  • Extension for skinning
  • Performance monitoring
As usual, work in progress, send me bugs, suggestions, etc.
cant seem to compile the makefile in the pspgl/test directory.

Code: Select all

convert firefox.png rgba:firefox.raw
(sym=`echo firefox | tr '-' '_'`; \
 echo -e ".data\n.global ${sym}_start\n${sym}_start:\n\t.incbin "firefox.raw"" | psp-as -o firefox.o)
make: *** No rule to make target `depthtest.elf', needed by `all'.  Stop.
rm firefox.raw
There are 10 types of people in the world: Those who understand binary, and those who don't...
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Post by Grom »

Dev-Express wrote:Haven't you missed the pointer in this call ?

glTexCoordPointer( 2, GL_FLOAT, sizeof(SMapVertex), &layer.pVertices->tex.x );

Try this...
thanks, but I missed an '&' while posting the code. In project it is where it has to be.
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Re: SVN PSPGL updated

Post by Grom »

Thanhda wrote:
cant seem to compile the makefile in the pspgl/test directory.

Code: Select all

convert firefox.png rgba:firefox.raw
(sym=`echo firefox | tr '-' '_'`; \
 echo -e ".data\n.global ${sym}_start\n${sym}_start:\n\t.incbin "firefox.raw"" | psp-as -o firefox.o)
make: *** No rule to make target `depthtest.elf', needed by `all'.  Stop.
rm firefox.raw
I have a same problem.
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

That fragment looks OK to me. Are any of the calls failing (setting the GL error code)?

What does happen? Does it look OK except the alpha modulation isn't happening, or is it something else? What texture format(s) are you using? Are your vertex colours set to (255,255,255,alpha), or (alpha,alpha,alpha,alpha), or something else?
Grom
Posts: 21
Joined: Sat Oct 29, 2005 1:00 am
Location: Russia

Post by Grom »

jsgf wrote:That fragment looks OK to me. Are any of the calls failing (setting the GL error code)?

What does happen? Does it look OK except the alpha modulation isn't happening, or is it something else? What texture format(s) are you using? Are your vertex colours set to (255,255,255,alpha), or (alpha,alpha,alpha,alpha), or something else?
We have found that indexed textures don't work with alpha. When we started using .raw RGBA textures, problem dissolved.

New question here:
Is it possible not to multiply alpha values (TEXalpha * VERTEXalpha) but add or substract them (TEXalpha - VERTEXalpha)?
If it is possible, please give a code sample.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Can I add one? (crackpot theory)

The host-chip is replaced by pure software ... is that possible?
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

Grom wrote:We have found that indexed textures don't work with alpha. When we started using .raw RGBA textures, problem dissolved.
Hm, strange. I'm pretty sure that should work, though I can't remember if I've tested it. What texture format and cmap format did you use?
New question here:
Is it possible not to multiply alpha values (TEXalpha * VERTEXalpha) but add or substract them (TEXalpha - VERTEXalpha)?
If it is possible, please give a code sample.
I don't think so. Muliply seems to be the only option; look at glTexEnv() to see if any of the GL_TEXTURE_ENV_MODEs do what you want. The hardware doesn't seem to have any capability beyond that.
Zenurb
Posts: 106
Joined: Fri Sep 30, 2005 8:33 am
Location: United Kingdom
Contact:

Post by Zenurb »

Arwin wrote:Can I add one? (crackpot theory)

The host-chip is replaced by pure software ... is that possible?
Wrong threead?
Proud Dvorak User
US 1.5 PSP (Original)
Podj
Posts: 3
Joined: Sun Dec 18, 2005 8:53 am

Post by Podj »

Grom got further than I got. When I run make install I get:

Code: Select all

while [ ! -d /cygdrive/e/psp/game ]; do mount /cygdrive/e; sleep 1; done
PSP_MOUNTDIR=/cygdrive/e \
	../tools/psp-install --psp-revision=1.50 bezier.elf \
	--eboot-title="bezier 2005/12/17 15:03:16" --eboot-icon="firefox.png"
../tools/psp-install: line 76: file: command not found
--------------------------------------------------------------------------------
 no MIPS32-ELF binary, not installing...
-----------------------------------------------------------------------------
But make works and the bezier.elf is there. I swear.
Any ideas?
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

You're missing "file". I think you need to install more cygwin stuff.
Post Reply