• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

179 Neutral

About Antonym

  • Rank
    Advanced Member
  1. OpenGL painting texture

    Thanks! Aren't shaders kind of advanced stuff though? If so is there no simpler method? Also aren't shaders a broad subject? Any guide on where to start looking is very much appreciated.
  2. OpenGL painting texture

    I was thinking of asking this in the openGL section but it struck me as a fairly basic question. I know that you can change the color of a texture with glColor, that however will only act upon the colors that are already there. Is there a way to completely change the color of the whole texture without affecting the parts of the texture that are alphaed out? An image could complement my lousy explanatory skills. http://yfrog.com/5mchangecolorj Thanks.
  3. Laser sound(s)

    Thanks for the help guys. That sound tutorial is really neat. I haven't had to pay for the sounds I've used so far and I'd like to stretch it aslong as possible :P. I started working with some of the sounds I already had and found that one of them with a lowered pitch did the trick quite well. The wonders of pitch. I got the idea from the suggestions. Thanks.
  4. Laser sound(s)

    Thanks for the reply. Interesting tool, I'll start messing with it to see if I can come up with something.
  5. Laser sound(s)

    Sorry to ask, I've tried google and the sound resources but my luck has been bad. I asked here before and it turned up some good results so I was hoping it would happen again. I am looking for a powerful laser beam sound. Perhaps a birth, loop and death sounds or just a single sound would be great. If someone has run into such a sound, any info is appreciated. Edit: a charging sound for such a laser would also be welcome ^_^'. In case a picture of what it's for could help. http://yfrog.com/bfultimatep Thanks [Edited by - Antonym on November 6, 2010 12:57:42 PM]
  6. Parsing folder

    I want to parse a folder with c++. I did some search in google and found this. It uses boost although it seems native_file_string() is deprecated. I tried finding an alternative, some info on it but nothing. It'd be nice if I could find a platform independent solution. Any help is appreciated. Edit: problem solved by looking at boost homepage, silly me -_-. iter->path().filename() void GameEngine::get_files( const path & directory, std::vector<std::string> &files) { if( exists( directory ) ) { directory_iterator end ; for( directory_iterator iter(directory) ; iter != end ; ++iter ) if (!is_directory( *iter ) ) { files.push_back(iter->native_file_string()); } } } [Edited by - Antonym on August 29, 2010 12:56:21 AM]
  7. OpenGL Graphics Error?

    Hello, I am rendering some sprites with openGL and they render fine. When I zoom in or out however a line shows up at the bottom of the sprites. Wondering if I did something wrong or if it's something normal. Middle picture is fine, left zoom in, right zoom out. http://yfrog.com/f/n6glitchqj/ Thanks.
  8. OpenGL stencil buffer graphical effect

    Thanks for the replies. Quote: You were told by who? I'm not entirely sure by what you mean but stencil doesn't seem to be the right tool. Supposing your background goes 0-1 (lower left being 0,0 to upper right being 1,1) just compute the relative position of the block and set as a texcoord, then fetch the texture as you want. Am I missing something? You might need to elaborate a bit. That's an intuitive solution! If I can't get stencil buffers to work I'll go with that, thanks. Quote: I think I understand what you mean. Stencil buffers are quite easy once you get the idea behind it and yes, the thing you want to do can be done perfectly with it. What is a stencil buffer? It's a buffer with the exact same size as your back buffer (render target, your screen) containing information about exactly all the pixels. Imagine you are one of the pieces of the pipeline, and you were in charge of deciding whether a pixel should be drawn or not. You would make yourself some kind of a lookup table so you could go and find if the requested pixel should be drawn or not. The stencil buffer does this for you. There would also be a way for another piece in the pipeline to tell you which pixels you should "mask" or not. The stencil buffer is not a true/false buffer like in my example above, but can be perfectly used this way. Usually it is a 8-bit buffer but I'm sure there are other formats available. Anyway, 8-bit is probably the best supported buffer. I'm not sure about that but almost every game just uses it for simplicity. So you can store a 1 and a 0 in it for true/false. How to store in it? I don't know how to do it in OpenGl, but you just tell the hardware that whatever you are about to draw should "do something" with the stencil buffer. It can be added by 1, subtracted by 1, or something entirely crazy. You should check the docs for that. First you draw everything except the blocks/windows. So if you would look at that result, you would see the game UI, the background of the arkanoid scene, everything except the blocks. So then, when you are drawing your blocks (that would be windows later), you don't draw them to the back buffer (disable drawing to the backbuffer) and you don't draw them to the depth buffer (disable drawing to the z-buffer if you use it), but you draw them on the stencil buffer (putting 1 in it where you are drawing). Make sure of course, that before you do this, the stencil buffer contains all 0's. Then after this, you should re-enable your backbuffer and draw a quad all over the play-screen with your glass background, but doing this with an extra stencil-buffer test: only draw when the stencil buffer is 1 (or greater) at that pixel! Be sure to disable z-buffer (if used) reads at that point as you really should overwrite any previously drawn pixels. And hazaa... your blocks that weren't drawn to the backbuffer but to the stencilbuffer earlier are now see through pieces of another background! It's really quite simple, don't be overwhelmed, just take your time to understand the magic of the stencil buffer and you will succeed! Thanks for clearing things up for me. I kind of understand the theory now although the openGL implementation still eludes me a bit. I went on and found this. http://www.opengl.org/resources/code/samples/advanced/advanced97/notes/node197.html It seems to be kind of what I want to do. I tried implementing but nothing seems to be changing(In case someone who knows openGL is looking). //Draw first background glClear(GL_STENCIL_BUFFER_BIT); glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); glDepthMask(GL_FALSE); glEnable(GL_STENCIL_TEST); glStencilFunc(GL_NEVER,1,1); glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); glStencilMask(GL_FALSE); glStencilFunc(GL_EQUAL,0,1); glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); glDepthMask(GL_TRUE); //Draw blocks glStencilFunc(GL_EQUAL,1,1); //Draw second background glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); glDisable(GL_STENCIL_TEST); Am I missing something? Could a moderator move this to the openGL section please?
  9. Sorry for the title, I can't think of a good summary for what I am trying to do. So I am using openGL for an arkanoid/breakout clone and want to be able to draw a background and then draw the blocks on top but have the blocks be "windows" to a different background, not sure I am explaining myself. I was told stencil buffers could be the way to go so I googled a bit but was quite overwhelmed by the subject, I just started with openGL and am not sure if it's worth it. Couldn't find much that gave me an idea as to how to accomplish the effect with the stencil buffers. Either way, any info/ideas are much appreciated. Thanks.
  10. warcraft cooldown icon

    Yeah that sounds like a good solution, thanks.
  11. warcraft cooldown icon

    Thanks for the replies. Quote:A lot of us were not involved, and therefore do not know. But, they could have used shaders, dark maps or even another 3rd-party graphic library. Code-wise, they would need to know how much time needs to pass before they can reactivate an ability, and how much time the user already sat waiting. Pretty much everything else can be deciphered from that. I meant the effect only, the timing and such ain't a problem. I don't know much at all about shaders and going out of my way to learn them just to achieve this effect seems like overkill, so does using a third party library. Could you elaborate on doing the effect with dark maps? Quote: I wanted to say something similar as Zyrolasting. OP: can you do blending? can you render triangles? can you do shaders? You have tons of choices, and all of them are fairly simple. I can do some blending and render triangles. Sorry, I am using openGL and I am a little bit new to it. Thanks again.
  12. warcraft cooldown icon

    I've been wondering how they do the clock shade thingy whenever an ability is undergoing cooldown. Thanks.
  13. OpenGL Alpha

    Thank you! That did the trick.
  14. OpenGL Alpha

    So I have an image with some parts alphaed out, I am wondering how to use glBlendFunc(If that's what I should use) to have the image rendered with those same parts alphaed out. Right now what I end up with is not just the parts that are alphaed out not showing up but the colors seem to be adding and any part colored black doesn't show up either :S. Any info is much appreciated. glColor4f(1.0f,1.0f,1.0f,0.5f); glBlendFunc(GL_SRC_ALPHA,GL_ONE); glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST);
  15. fullscreen image shifted

    That worked! Thanks guys ^_^. [Edited by - Antonym on July 19, 2010 2:05:53 AM]
  • Advertisement