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 

Stencil buffer shadows

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



Joined: 22 Jun 2006
Posts: 70

PostPosted: Tue Aug 01, 2006 3:30 am    Post subject: Stencil buffer shadows Reply with quote

Hello,

i'm trying to draw stencil shadows with PSPGL but i can't get it working,

here is the code:

Code:

   glPushAttrib(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT |
      GL_POLYGON_BIT   | GL_STENCIL_BUFFER_BIT   );

   glDisable(GL_LIGHTING);
   glDisable(GL_FOG);
   glDepthMask(GL_FALSE);
   glDepthFunc(GL_LEQUAL);
   glEnable(GL_STENCIL_TEST);
   glColorMask(GL_FALSE, GL_FALSE,   GL_FALSE, GL_FALSE ); // no color buffer drawing
   glStencilFunc(GL_ALWAYS, 1,   0xFFFFFFFFL   );
   glColorMask(0, 0, 0, 0);
   glEnable(GL_CULL_FACE);

      glStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
      glCullFace(GL_FRONT);

      glBegin(GL_TRIANGLES);

      s32 i;
      for(i=0; i<count; ++i)
         glVertex3f(triangles[i].X, triangles[i].Y, triangles[i].Z);

      glEnd();

      glStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
      glCullFace(GL_BACK);

      glBegin(GL_TRIANGLES);

      for(i=0; i<count; ++i)
         glVertex3f(triangles[i].X, triangles[i].Y, triangles[i].Z);

      glEnd();


   glPopAttrib();


ant suggestion ?
Back to top
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Wed Aug 09, 2006 2:36 am    Post subject: Reply with quote

Did you have any luck with them?
Back to top
View user's profile Send private message
siberianstar



Joined: 22 Jun 2006
Posts: 70

PostPosted: Wed Aug 09, 2006 9:30 am    Post subject: Reply with quote

for now i'm working on something else, i will see for them later.
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