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:	1017
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 aboutadam 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
  #16  
Old 08-14-2010, 07:41 PM
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
To be honest I'm not sure if such things can be added anytime soon. We use it for some of our iPhone games but it's not that easy to expose to script. There are however other things in the works which can also improve Graal graphically in the future.
Reply With Quote
  #17  
Old 08-14-2010, 10:14 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 Stefan View Post
To be honest I'm not sure if such things can be added anytime soon. We use it for some of our iPhone games but it's not that easy to expose to script. There are however other things in the works which can also improve Graal graphically in the future.
Do it! An ETA on v6 wouldn't be bad, either.
Reply With Quote
  #18  
Old 08-15-2010, 11:33 PM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Quote:
Originally Posted by Stefan View Post
To be honest I'm not sure if such things can be added anytime soon. We use it for some of our iPhone games but it's not that easy to expose to script. There are however other things in the works which can also improve Graal graphically in the future.
I've seen the stencil buffer bound to Lua functions and a clientside interpreted language added to Quake, but if you don't feel capable..

Another thing I'd like to see is showimg, minus the layer sorting, depth sorting, and all that. Just draw it directly to the frame buffer as soon as it's called, and forget about it forever once the frame ends; just like blitting an image in SDL or whatever other graphics front. It'd make certain scripts easier to write where you have to manually draw an entire world for, say, an isometric or raycasting script, draw back-to-front, or front-to-back to get certain things looking right, and if I'm not mistaken it'd probably be significantly faster, since the client wouldn't be creating and destroying, sorting depth through tons of image objects.
Reply With Quote
  #19  
Old 08-16-2010, 01:05 AM
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:
Originally Posted by Stefan View Post
To be honest I'm not sure if such things can be added anytime soon. We use it for some of our iPhone games but it's not that easy to expose to script. There are however other things in the works which can also improve Graal graphically in the future.
Please try
__________________

Don Hertzfeldt <3
Reply With Quote
  #20  
Old 08-16-2010, 02:44 AM
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
Quote:
Originally Posted by Stefan View Post
To be honest I'm not sure if such things can be added anytime soon. We use it for some of our iPhone games but it's not that easy to expose to script. There are however other things in the works which can also improve Graal graphically in the future.
What other things?
Reply With Quote
  #21  
Old 08-16-2010, 03:58 AM
gravator gravator is offline
Joe Cruddas (VIP)
Join Date: Oct 2003
Posts: 279
gravator has a spectacular aura aboutgravator has a spectacular aura about
Stefan, you make it sound as if the current developers are stuck using the same tools as during 2001 and are just waiting for V6 release, there has to have been some new goodies added to make a really fun and beautiful server, Konidias managed to get some very nice graphics in bomy island so i'm very certain similar quality should be available now instead of the much older tilesets that are still in use on Era, UN and Zodiac or many of the hosted and under construction servers.

Combining Koni level work with Gonstruct would make one impressive and very professional looking server.
Reply With Quote
  #22  
Old 08-16-2010, 04:19 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 gravator View Post
Stefan, you make it sound as if the current developers are stuck using the same tools as during 2001 and are just waiting for V6 release, there has to have been some new goodies added to make a really fun and beautiful server, Konidias managed to get some very nice graphics in bomy island so i'm very certain similar quality should be available now instead of the much older tilesets that are still in use on Era, UN and Zodiac or many of the hosted and under construction servers.

Combining Koni level work with Gonstruct would make one impressive and very professional looking server.
But there are limitations... Sure, we've had some advancements in effects like particles and scaling of images and such, but that's about it. There are some more dramatic effects that would make the game look way better... like already mentioned, reflections in the water, screen distortion that you often see in RPGs(think the waves from heat, making the screen slowly flow with waves), the ability to subtract from an image(for lamps like in Minish Cap), the ability to desaturate/color the screen for things like an ol' time effect. All these things would give creative developers an edge to make something that looks that much better.

And Koni's BI didn't really push Graal to its limits.
Reply With Quote
  #23  
Old 08-16-2010, 02:23 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
Quote:
Originally Posted by DustyPorViva View Post
But there are limitations... Sure, we've had some advancements in effects like particles and scaling of images and such, but that's about it. There are some more dramatic effects that would make the game look way better... like already mentioned, reflections in the water, screen distortion that you often see in RPGs(think the waves from heat, making the screen slowly flow with waves), the ability to subtract from an image(for lamps like in Minish Cap), the ability to desaturate/color the screen for things like an ol' time effect. All these things would give creative developers an edge to make something that looks that much better.

And Koni's BI didn't really push Graal to its limits.
just an oddball idea but couldn't you just set the RGB value of all objects to sepia tone levels for ol' time effect?
Reply With Quote
  #24  
Old 08-16-2010, 03:16 PM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Doesn't Graal have a subtractive blending mode?
Reply With Quote
  #25  
Old 08-16-2010, 08:39 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by DustyPorViva View Post
But there are limitations... Sure, we've had some advancements in effects like particles and scaling of images and such, but that's about it. There are some more dramatic effects that would make the game look way better... like already mentioned, reflections in the water, screen distortion that you often see in RPGs(think the waves from heat, making the screen slowly flow with waves), the ability to subtract from an image(for lamps like in Minish Cap), the ability to desaturate/color the screen for things like an ol' time effect. All these things would give creative developers an edge to make something that looks that much better.

And Koni's BI didn't really push Graal to its limits.
With this said, I'd like to add: oh my god I wish you could have images subtract from seteffects and other images.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #26  
Old 08-16-2010, 08:42 PM
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 Tigairius View Post
With this said, I'd like to add: oh my god I wish you could have images subtract from seteffects and other images.
Stefan actually replied to one of my topics about it and said it's require a new buffer of the sort... and that was it. He didn't sound too enthusiastic about it.
Reply With Quote
  #27  
Old 08-16-2010, 08:50 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by DustyPorViva View Post
Stefan actually replied to one of my topics about it and said it's require a new buffer of the sort... and that was it. He didn't sound too enthusiastic about it.
That's rather unfortunate. I could have used these effects many times. I know I've brought it up with him personally before too.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #28  
Old 08-16-2010, 09:31 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 12171217 View Post
Doesn't Graal have a subtractive blending mode?
Mode 2 is subtractive, yes.
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:00 PM.


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