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 

A little problem with HGE++ and Alpha-Blending

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



Joined: 20 Mar 2008
Posts: 9

PostPosted: Thu Mar 20, 2008 3:32 am    Post subject: A little problem with HGE++ and Alpha-Blending Reply with quote

Hi all,

I'm having a little problem using the HGE++ library and textures with transparency (PNG).

I tried to ask in the official forum, but it seams almost dead.

For what I could see, the code renders fine textures with transparency in 2d, but fails in 3d. And only fails on PSP (works well with OpenGL in windows).


You can see the PSP specific code here:
http://code.google.com/p/jge/source/browse/trunk/JGE/JGE/src/JGfx.cpp

This is the initialization code:


Code:

// enable alpha channel
   sceGuEnable(GU_BLEND);
   sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
   
   sceGuTexFilter(GU_LINEAR,GU_LINEAR);

   if (m3DEnabled)
   {

      sceGuDepthRange(65535,0);
      sceGuEnable(GU_DEPTH_TEST);
      sceGuDepthFunc(GU_GEQUAL);

      sceGuEnable(GU_CULL_FACE);
      sceGuEnable(GU_CLIP_PLANES);

      sceGuClearColor(0x00ff0000);
      sceGuClearDepth(0);

      sceGuTexEnvColor(0xffffffff);
      
      sceGuTexScale(1.0f,1.0f);
      sceGuTexOffset(0.0f,0.0f);
      sceGuAmbientColor(0xffffffff);

      sceGumMatrixMode(GU_PROJECTION);
      sceGumLoadIdentity();
      sceGumPerspective(mFOV,16.0f/9.0f,0.5f,1000.0f);
      //sceGumPerspective(90.0f,480.0f/272.0f,0.5f,1000.0f);

   }


Thanks for all the help.
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