Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Feature request
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 07-10-2010, 09:35 PM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Stencil buffer.

Why can't we touch the stencil buffer in GS2?

I wanted to do reflection effects for players in water, among many other things..
Reply With Quote
  #2  
Old 07-11-2010, 12:39 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
This can probably be interesting but could you explain a little bit more what you want to do and how?
Reply With Quote
  #3  
Old 07-11-2010, 03:12 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
You would enable writing to the stencil buffer by doing a generic function, like
graphicsEnable(STENCIL_BUFFER);

then, you would, in most cases, clear the stencil buffer before you start using it.
graphicsClear(STENCIL_BUFFER);

Following, since you're in stencil mode, any showimgs, anything that would normally be drawn to the draw buffer is now drawn to the stencil buffer. You set an operation using
setStencilOp(STENCILOP);
and could choose from the following operations:

NPC Code:
STENCILOP_KEEP
STENCILOP_ZERO
STENCILOP_REPLACE
STENCILOP_INVERT
STENCILOP_INCR
STENCILOP_DECR



Finally, after creating a proper stencil buffer, you could then test against it when drawing images:
stencilTestFunc(STENCILTEST);

NPC Code:
STENCILTEST_NEVER
STENCILTEST_LESS
STENCILTEST_LESSEQUAL
STENCILTEST_EQUAL
STENCILTEST_GREATER
STENCILTEST_GREATEREQUAL
STENCILTEST_NOTEQUAL
STENCILTEST_ALWAYS



Setting a reference value could just be something like
stencilSetReference(int);

Could be used for tons of stuff.. Parallax scrolling backgrounds, reflections of sky images in water, reflections of players in water.. Tons of very interesting uses if it's put to good use.

If you've ever used the stencil buffer in an OpenGL application, you'd be familiar with how to use it and you'd see a bunch of potentional, too
Reply With Quote
  #4  
Old 07-13-2010, 08:52 PM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Not to mention this could be used to clip images against bounding boxes, for minigames and such.. I really ****ing need that, especially since clipping showpolys is slow compared to taking advantage of the stencil buffer.
Reply With Quote
  #5  
Old 07-26-2010, 08:21 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Bump.
Reply With Quote
  #6  
Old 08-03-2010, 05:59 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
This sounds interesting, should do something with it.
Reply With Quote
  #7  
Old 08-07-2010, 02:04 AM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
u cud use it to fulfil my dream~
Attached Thumbnails
Click image for larger version

Name:	coolwater.gif
Views:	715
Size:	30.4 KB
ID:	51466  
__________________
Reply With Quote
  #8  
Old 08-07-2010, 04:25 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Crono View Post
u cud use it to fulfil my dream~
I've been wanting reflections for so long

Graal needs way more special effects. It can add so much atmosphere!
Reply With Quote
  #9  
Old 08-07-2010, 04:27 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Crono View Post
u cud use it to fulfil my dream~
I've always wanted a lake and a fence.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #10  
Old 08-07-2010, 05:18 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Stencil buffer plz <3

Also, render-to-texture support while we're at it! If I'm not mistaken in the technique you use for certain GUIControls, it's nothing more than adapting your GUIDrawingPanel's.
Reply With Quote
  #11  
Old 08-13-2010, 12:50 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
I guessing this would be more efficient than having an extra image/NPC, rotating it, and lowering the alpha?
Reply With Quote
  #12  
Old 08-13-2010, 12:50 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by MrOmega View Post
I guessing this would be more efficient than having an extra image/NPC, rotating it, and lowering the alpha?
Hell yes!
__________________
Reply With Quote
  #13  
Old 08-13-2010, 01:35 PM
smirt362 smirt362 is offline
Tee Hee
smirt362's Avatar
Join Date: Feb 2005
Location: Texas
Posts: 2,101
smirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant future
Send a message via AIM to smirt362 Send a message via MSN to smirt362
Quote:
Parallax scrolling backgrounds
Hell yes
__________________

Don Hertzfeldt <3
Reply With Quote
  #14  
Old 08-13-2010, 03:16 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
So graal will go from basically Zelda 3 with upgrades to to pretty much the four sword adventures? Effects wise. I vote yes.
Reply With Quote
  #15  
Old 08-14-2010, 01:43 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Would be nice if graal could compete with other 1-man team indie games someday.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.