Jump to content

  • Log In with Google      Sign In   
  • Create Account


Getting the damn stencil buffer to work.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 MENTAL   Members   -  Reputation: 379

Like
Likes
Like

Posted 09 October 2001 - 11:49 PM

Okay, here''s the deal. I have a square in the middle of the screen, and a mesh circling around it. when the mesh gets behind the quad, i want another mesh to be drawn instead (i know it sounds strange, but i''ll post a completed demo and you will be amazed at how cool it looks with the rest of the effects). anyway, i figured it would go like this: draw the initial mesh. draw the quad stencil in the outline of the quad draw the second mesh, but only when the depth test fails. only draw in the stenciled area. i''ve been hacking away at this for god knows how many hours and still it refuses to work. any suggestions welcome, and please, PLEASE, with some source code . MENTAL

Sponsor:

#2 MButchers   Members   -  Reputation: 123

Like
Likes
Like

Posted 10 October 2001 - 12:04 AM

Hi there,

well i did somthing simular -

draw the initial mesh.
draw the quad
stencil in the outline of the quad

(* Clear the depth buffer *)
glClear(GL_DEPTH_BUFFER_BIT)

draw the second mesh in the stenciled area.

(* Restore depth buffer *)
ReRender the scene with color buffer writes turned off.

(* Re Enable color buffer writes *)

you may want to scissor the area of the quad to speed things
up. Use glColorMask to switch color buffer writes on and off.

Hope it helps

Mark.



Edited by - MButchers on October 10, 2001 7:05:20 AM

#3 MENTAL   Members   -  Reputation: 379

Like
Likes
Like

Posted 10 October 2001 - 12:07 AM

oh boy, i knew i forgot to do something (damn depth buffer). okay, i''ll try it out. thanks for the help .


ARGH!!!!


MENTAL

#4 mittens   Moderators   -  Reputation: 1315

Like
Likes
Like

Posted 10 October 2001 - 09:08 AM

Hey MENTAL! Haven''t heard from you in a *LONG* while! COME BACK TO #GAMEDEV!

Anyhoo, here are my two cents: the stencil buffer isn''t the best idea to use right now... A lot of cards still don''t have very good support for it, and is pretty slow.

------------------------------
Trent (ShiningKnight)
E-mail me
ShiningKnight Games

#5 MENTAL   Members   -  Reputation: 379

Like
Likes
Like

Posted 10 October 2001 - 09:52 AM

bleh been busy with coding cool stuff. i lied. been bogged down with college work .

i still cant understand the OpenGL stencil buffer, it definaly needs a GL_DWIM contant in there.

oh, SK, i dont suppose you can send me just the DX8 libs and headers please? i dont particularly want a 45mb download just so i can compile your tuts .

i''ll be back in #gd this weekend hopefully.

see ya later

MENTAL




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS