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 

SVN PSPGL updated

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



Joined: 12 Jul 2005
Posts: 254

PostPosted: Mon Nov 07, 2005 3:27 pm    Post subject: SVN PSPGL updated Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Grom



Joined: 29 Oct 2005
Posts: 21
Location: Russia

PostPosted: Mon Nov 07, 2005 7:51 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
rinco



Joined: 21 Jan 2005
Posts: 255
Location: Canberra, Australia

PostPosted: Mon Nov 07, 2005 8:51 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Grom



Joined: 29 Oct 2005
Posts: 21
Location: Russia

PostPosted: Mon Nov 07, 2005 9:25 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Grom



Joined: 29 Oct 2005
Posts: 21
Location: Russia

PostPosted: Mon Nov 07, 2005 9:59 pm    Post subject: Reply with quote

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

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
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Tue Nov 08, 2005 2:32 am    Post subject: Reply with quote

Yeah, that stuff is probably a bit specific to my (linux-based) setup. I'll see if I can clean it up.
Back to top
View user's profile Send private message Visit poster's website
Grom



Joined: 29 Oct 2005
Posts: 21
Location: Russia

PostPosted: Tue Nov 15, 2005 2:27 am    Post subject: Reply with quote

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:

...
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 );
...
Back to top
View user's profile Send private message
Dev-Express



Joined: 11 Oct 2005
Posts: 5

PostPosted: Tue Nov 15, 2005 2:47 am    Post subject: Reply with quote

Haven't you missed the pointer in this call ?

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

Try this...
Back to top
View user's profile Send private message
Thanhda



Joined: 09 Apr 2005
Posts: 331
Location: Canada

PostPosted: Tue Nov 15, 2005 9:58 am    Post subject: Reply with quote

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:

...
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:
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...
Back to top
View user's profile Send private message Visit poster's website
Thanhda



Joined: 09 Apr 2005
Posts: 331
Location: Canada

PostPosted: Tue Nov 15, 2005 10:19 am    Post subject: Re: SVN PSPGL updated Reply with quote

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:
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...
Back to top
View user's profile Send private message Visit poster's website
Grom



Joined: 29 Oct 2005
Posts: 21
Location: Russia

PostPosted: Tue Nov 15, 2005 6:22 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Grom



Joined: 29 Oct 2005
Posts: 21
Location: Russia

PostPosted: Tue Nov 15, 2005 6:22 pm    Post subject: Re: SVN PSPGL updated Reply with quote

Thanhda wrote:


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

Code:
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.
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Wed Nov 16, 2005 5:49 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website
Grom



Joined: 29 Oct 2005
Posts: 21
Location: Russia

PostPosted: Wed Nov 16, 2005 11:51 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Arwin



Joined: 12 Jul 2005
Posts: 426

PostPosted: Tue Nov 22, 2005 1:52 am    Post subject: Reply with quote

Can I add one? (crackpot theory)

The host-chip is replaced by pure software ... is that possible?
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Tue Nov 22, 2005 3:26 am    Post subject: Reply with quote

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?

Quote:
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.
Back to top
View user's profile Send private message Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Tue Nov 22, 2005 11:12 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Podj



Joined: 18 Dec 2005
Posts: 3

PostPosted: Sun Dec 18, 2005 9:00 am    Post subject: Reply with quote

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

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?
Back to top
View user's profile Send private message AIM Address
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Sun Dec 18, 2005 3:12 pm    Post subject: Reply with quote

You're missing "file". I think you need to install more cygwin stuff.
Back to top
View user's profile Send private message Visit poster's website
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