• Content count

  • Joined

  • Last visited

Community Reputation

104 Neutral

About zaneski13

  • Rank
  1. Top Down Rpg

    [img][/img] yup right here. working on the engine though. a lot more programming and testing to be done. Working on the lighting system right now. then I'll try to implement shadows, then ill rewrite the engine with everything i know. Going for a diablo 2 look
  2. Ok, so I need to access a texture in my vertex shader, but I want the game to run on cards that only support shader model 2. Anyone know if acessing a texture in a vertex shader crashes on old cards? also is there a website that shows the limitations of shader models. like what they support and dont support? Thanks.
  3. sphere vs isometric frustum collision

    How would one go about finding the 4 planes of the isometric 3D camera? The 4 planes being left, right, top bottom. Dont really care about near and far because its a 2.5 D isometric game so lights wont be above the camera or below the floor. The camera data I have access to in my engine is the position, rotation, modelview matrix, projection matrix.
  4. So I'm in the process of developing a 3D Isometric game in c++ and opengl. I'm currently working on the lighting system. Basicly I have a max number of lights that can be viewable at one time, but the level has no bounds of how many lights can exist. So I need to filter out the lights that are not viewable. some valuable information: EVERY LIGHT IN THE SCENE IS A POINT LIGHT, so a sphere... The camera frustum is ISOMETRIC 3D. Its positioned about 30 feet above the character, and rotated 45degrees down X and 135 degrees Y (this may change) I have a function implemented that casts rays from each corner of the screen. For each ray I calculate the x and z value when the y value is 0. this is because the game is 2.5 D, no terrain to worry about. Ground is always at y = 0 So with these 4 points I can figure out how much of the level is in view (how many ground tiles i have to draw) Each light has a 3D position and a radius. Using that information, how can I figure out which lights in the level are visible at a given time? Any help is appreciated. Thanks!
  5. Thanks for clarifying! [img][/img] I can move onto my editor now
  6. Heres what I have for code at the moment [CODE] bool TextureEditable::SetSubData(int x, int y, int w, int h, unsigned char *pixels) { if ( !pixels ) return false; if ( x < 0 || x >= width || y < 0 || y >= height ) return false; Texture::EnableGLTextures(); glBindTexture(GL_TEXTURE_2D, texID); Texture::lastBoundTexture = texID; if (format == TEX_RGBA ) { glPixelStorei( GL_UNPACK_ALIGNMENT, 4); glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels); } else if ( format == TEX_RGB ) { glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGB, GL_UNSIGNED_BYTE, pixels); } else if ( format == TEX_ALPHA ) { glPixelStorei( GL_UNPACK_ALIGNMENT, 1); glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_LUMINANCE, GL_UNSIGNED_BYTE, &pixels[0]); } } [/CODE] Right now TEX_RGBA and TEX_ALPHA formats are working. idk what to do about TEX_RGB since '3' isnt a valid value to pass to glPixelStore
  7. Thanks, that sounds like the function I should be using. Just a question. I checked the reference guide for glPixelStore and the parameter [b]GL_UNPACK_ALIGNMENT, and appariently the only valid values you can pass to the function is 1,2,4, or 8. According to [/b][url=""][/url] So when the pixel data I'm passing to the texture is GL_LUMIANCE I'd call glPixelStore([b]GL_UNPACK_ALIGNMENT, 1); before calling glTexSubImage2D()[/b] [b]But, when the pixel data I'm passing to the texture is GL_RGB I'd call glPixelStore([/b][b]GL_UNPACK_ALIGNMENT, 3) before calling glTexSubImage2D() but '3' isn't a valid value to pass to [/b]glPixelStore([b]GL_UNPACK_ALIGNMENT, n); According to the link above, only 1,2,4, and 8 are valid values. 1 being (L,L,L,1) 2 being (L,L,L,A) ??? 4 being (R,G,B,A) 8 being (R,G,B,A,ummmmmmmmmm idk)[/b]
  8. Ok, so I'm having a problem with the glTexSubImage2D function. The function only works with GL_RGBA textures, but when I use GL_RGB or GL_LUMINANCE textures, glTexSubImage2D acts funny. I've created a class called TextureEditable Bellow are the 2 functions I made. SetData, and SetSubData(). formatType can be TEX_RGB, TEX_RGBA, or TEX_ALPHA [CODE] bool TextureEditable::SetData(int width_, int height_, unsigned char *pixels, int formatType) { if ( !math::IsPower2(width_) || !math::IsPower2(height_) ) return false; if ( !pixels ) return false; if ( formatType != TEX_RGB && formatType != TEX_RGBA && formatType != TEX_ALPHA ) return false; //ok, so the data that was passed in is good, only error that can possibly happen is if the data has less elements that width*height*bpp format = formatType; width = width_; height = height_; if ( data ) delete [] data; int bpp = 1; if ( format == TEX_RGB ) bpp = 3; else if ( format == TEX_RGBA ) bpp = 4; cout << "bpp = " << bpp << endl; data = new unsigned char[width*height*bpp]; for ( int i=0; i < width*height*bpp; i++ ) data[i] = pixels[i]; //now we have the data if ( texID == 0 ) //then we haven't generated a gl texture yet, so generate one { Texture::EnableGLTextures(); glGenTextures(1, &texID); glBindTexture(GL_TEXTURE_2D, texID); Texture::lastBoundTexture = texID; cout << "creating tex " << texID << endl; } Texture::EnableGLTextures(); glBindTexture(GL_TEXTURE_2D, texID); Texture::lastBoundTexture = texID; glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); if ( format == TEX_RGB ) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data); } else if ( format == TEX_RGBA ) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); } else if ( format == TEX_ALPHA ) { glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE , GL_UNSIGNED_BYTE, data); } return true; } bool TextureEditable::SetSubData(int x, int y, int w, int h, unsigned char *pixels) { if ( !pixels ) return false; if ( x < 0 || x >= width || y < 0 || y >= height ) return false; Texture::EnableGLTextures(); glBindTexture(GL_TEXTURE_2D, texID); Texture::lastBoundTexture = texID; if (format == TEX_RGBA ) { glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels); } else if ( format == TEX_RGB ) { glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGB, GL_UNSIGNED_BYTE, pixels); } else if ( format == TEX_ALPHA ) glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels); } [/CODE] OK, so those are the main functions I'm working with in that class. in my main program I do this... [CODE] tex2 = new TextureEditable(""); unsigned char pixels[4*4] = {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}; tex2->SetData(4,4,pixels,TEX_ALPHA); unsigned char sub[2*2] = {255,255,255,255}; tex2->SetSubData(1,1,2,2,sub); [/CODE] I render a quad with the texture mapped on it. What I should see is a grey square with a white square in the middle Instead I see a grey square with a square in the middle that is shaded white in the first 2 texels and shaded different shades of grey for the other 2 texels Note, the desired effect works when I use a texture that has GL_RGBA data. I think whats happening is when I call glTexSubImage2D its taking the pixel data i send it assumes its a RGBA texture when its a greyscale texture. But I'm not sure. Any help would be greatly appreciated.
  9. Making money to start game project

    "[color=#1C2837][size=2]For now you don't need a website. You don't need a website until you've actually written a game (if that ever happens), and even then you might not need one."[/size][/color] [color=#1C2837][size=2] [/size][/color] [color=#1C2837][size=2]Yeah I think I'll just keep designing the game and when I get far enough into development I'll just start a blog and make videos on youtube. Hopefully by then I'll have enough cash to get my own domain and hosting service.[/size][/color] [size="2"][color="#1c2837"] [/color][/size] [color=#1C2837][size=2] [/size][/color] [color=#1C2837][size=2] [/size][/color]
  10. Hi, so I'm 17 years old, currently unemployed, and am struggling to find ways to make money. I decided that since I can't find a job in my neighborhood at the moment that I was going to start developing a game and releasing it on my own website and sell it for a small amount of money. like 5$ maybe. And then maybe use google adsense to make a little more money off the website. Well, I've been designing games with C++ and OpenGL for almost 2 years now so making the game isn't a problem for me, what is is buying the domain and paying for hosting. And in order to make a website with a .com domain you need to pay something like 10$. I'ts never been this hard to find money before! No job, parents wont lend me money, friends are either broke or out on vaction for summer. I just don't know what to do. I like the idea of making money off developing a game but I need a starting budget which I unforchantly don't have. Does anyone have any ideas on how to raise just a little bit of money, say 20$ just to get the website up and running? I've tried taking surveys online but they usually don't work or are loaded with scams.
  11. Game Payment Security

    Thanks everyone for all your input. It ended up being a very interesting article. What I think I'm going to do is have single player free (if people manage to pirate it) but make the multiplayer aspect cost money. I could pull this off by, like I said, when the person buys the game from my website, the server would generate a 'key' and send it to their email. when the game is first played, it'll ask for a CD key and you paste the key that was sent to your email. The key would then be saved to a textfile. Then when the user tries to do online multiplayer the game could load the cdkey from the textfile and send the key to the server to check if its a valid key. if it is, allow user to join the master server (chat room) else, show error message. Another thing I could do is have it so that only 1 copy of the CDkey can be used at a time. IE: if user1 (legitimate customer) logs in to the game and user2 (pirated copy user) tries to login with the same CDkey, it would display an error message "that CDKey is in use at this time" This would make it so that if people released their key, they might not be able to play at times, this could be motivation for them to not give away their keys. Another thing I could do is if someone uninstalls the game using the uninstaller.exe it could try to remove that cdKey from the database if the user is connected to the internet. If the user isn't connected to the internet, then don't panic, they're probably not even planning to release their key to anyone anyway. How does this sound? It would ensure that I would get at least 50% honest sales worst case senerio X number of people buy the game. they all release their key. X number of people get the key. 2X number of people play the game [taking turns, because only 1 key can be used at a given time]
  12. Game Payment Security

    the problem with registering the product with the CD key is what if the person registers, then installs the program. Then if the person uploads the [installed] program (not the installer) to a website like rapidshare then the people who download the software will be 'registered'
  13. So, I've been thinking about creating some commercial projects now, but I'd like to collect ideas on how to do this safely and how to make it so that everyone who plays the game needs to pay for it, no mediashare downloads, etc. What I was going to do was to design a website where people use paypal accounts to buy the software. When the order goes through, a link will be emailed to them and they can download the game from that link. The problem about this is say someone buys the game but then puts it on a website like mediashare where other people can download it... for free, I'd be losing profit. I'm trying to minimize profit loss obviously. What I was considering was making some sort of key system, where when you buy the game, a random sequence of characters is generated and put on a database and sent to the buyers email. When the buyer first play the game, it'll ask you for a key. you would type in the key that was sent in the email and it would connect to the database and check if there's any matching keys. If there is, the program would continue, else it would close. The problem with this is then the buyer would only have to upload the game and his/her key to a website like mediashare. Should I make it so that the key has an IPadress associated to it so that when the game runs it checks for the persons IPAdress and checks if its an address that bought it? but then if I did it that way, the buyer could only install the game on one computer, which isn't fair if s/he buys a new computer and needs to install it on that computer. errrr I seem like I just can't win. I'm trying to come up with a fair solution but anything I come up with has some sort of flaw. Does anyone know how large companies pull it off? Or does anyone have any good ideas? Thanks
  14. I use SDL for window interface purposes and OpenGL for graphics. NEHE is where I learned, just don't go through the Win32 API code because win32 is pretty ugly, especially for beginners. What I did when I was first starting off was download the source for Linix/SDL It'll work on windows too, don't worry. I looked at the opengl parts of the tutorials but completely bypassed the win32 API parts. another place i went to for tutorials was that should start you off, then when you get better you can poke around some source code for help.
  15. Hi, simple question. Is it possible to use the SDL API and use OpenGL 4.0 or is it unsupported by SDL. Should I just start learning the Win32 API if I want Windows to be able to handle OpenGL 4.0?